14-mnist-assert-alternative.py 文件源码

python
阅读 27 收藏 0 点赞 0 评论 0

项目:tensorflow-talk-debugging 作者: wookayin 项目源码 文件源码
def multilayer_perceptron(x):
    fc1 = layers.fully_connected(x, 256, activation_fn=tf.nn.relu, scope='fc1')
    fc2 = layers.fully_connected(fc1, 256, activation_fn=tf.nn.relu, scope='fc2')
    out = layers.fully_connected(fc2, 10, activation_fn=None, scope='out')
    tf.add_to_collection('Asserts', tf.Assert(tf.reduce_all(out > 0), [out], name='assert_out_positive'))     # (*)
    return out

# build model, loss, and train op
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号