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)
评论列表
文章目录