utils_combine.py 文件源码

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

项目:adversarial-deep-structural-networks 作者: wentaozhu 项目源码 文件源码
def buildmodel(X, paras):
  hconv1 = convlayer(X, paras['wconv1'], paras['bconv1'], flag='maxpool')
  hconv2 = convlayer(hconv1, paras['wconv2'], paras['bconv2'], flag='maxpool')

  hconv3 = tf.nn.conv2d(hconv2, paras['wconv3'], strides=[1,1,1,1], padding='VALID')
  hconv3bias = tf.nn.bias_add(hconv3, paras['bconv3'])
  hconv3tan = tf.nn.tanh(hconv3bias)

  hconv4 = tf.nn.conv2d_transpose(hconv3tan, paras['wconv4'], [batchsize,boxheight,boxwidth,2], 
                                  strides=[1,1,1,1], padding='VALID')
  hconv4 = tf.reshape(hconv4, [-1,boxheight*boxwidth*2])
  hconv4bias = tf.nn.bias_add(hconv4, paras['bconv4'])
  hconv4bias = tf.reshape(hconv4bias, [-1, boxheight, boxwidth, 2])
  hconv4bias = tf.reshape(hconv4bias, [-1,2])
  hconv4soft = tf.nn.softmax(hconv4bias)
  hconv4clip = tf.clip_by_value(hconv4soft, 1e-6, 1.)
  hconv4clip = (tf.reshape(hconv4clip, [-1, boxheight, boxwidth, 2]))
  return hconv4clip
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号