model_cifar_contract.py 文件源码

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

项目:deep_separation_contraction 作者: edouardoyallon 项目源码 文件源码
def block(x, n_in, n_out, subsample,  phase_train, scope='res_block'):
  with tf.variable_scope(scope):
    if subsample:
      y = conv2d(x, n_in, n_out, 3, 2, 'SAME', False,phase_train, scope='conv_1')
    else:
      y = conv2d(x, n_in, n_out, 3, 1, 'SAME', False,phase_train, scope='conv_1')

    y = \
      batch_norm(y, n_out, phase_train, scope='bn_1')

    y = tf.mul(tf.sign(y),tf.sqrt(tf.abs(y)+1e-5) + 0.1)

    y = conv2d(y, n_out, n_out, 3, 1, 'SAME', False, phase_train, scope='conv_2')
    y = batch_norm(y, n_out, phase_train, scope='bn_2')

    y = tf.mul(tf.sign(y), tf.sqrt(tf.abs(y)+1e-5) + 0.1)
    return y
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号