rnn.py 文件源码

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

项目:LSTM-TensorSpark 作者: EmanuelOverflow 项目源码 文件源码
def minimize(self, data, t_label, s, optimizer):
        label = tf.Variable(t_label, name="label", trainable=False, dtype=tf.float32)
        s.run(tf.initialize_variables([label]))
        with tf.name_scope('cost_function'):
            cost = self.output_layer.compute_loss(tf.transpose(self.ht), label)
        with tf.name_scope('minimization'):
            #optimizer = tf.train.GradientDescentOptimizer(learning_rate=0.01)
            return optimizer.minimize(cost, aggregation_method=tf.AggregationMethod.EXPERIMENTAL_ACCUMULATE_N)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号