iclr_2017_benchmark.py 文件源码

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

项目:fold 作者: tensorflow 项目源码 文件源码
def tree_fc(self, left, right):
    # A simple tree RNN with a single fully connected layer.
    if self._weights is None:
      with tf.variable_scope(self._vscope):
        self._weights = tf.get_variable(
            "weights", [FLAGS.vector_size*2, FLAGS.vector_size],
            initializer=tf.uniform_unit_scaling_initializer(1.43))
        self._bias = tf.get_variable("bias", [FLAGS.vector_size],
                                     initializer=tf.zeros_initializer())
    x = tf.concat([left, right], 1)
    result = tf.add(tf.matmul(x, self._weights), self._bias)
    return tf.nn.relu(result)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号