Skip to content
Snippets Groups Projects
Commit e4728984 authored by tgupta6's avatar tgupta6
Browse files

global step in optimizer

parent ef44688d
No related branches found
No related tags found
No related merge requests found
...@@ -705,7 +705,9 @@ class attach_optimizer(): ...@@ -705,7 +705,9 @@ class attach_optimizer():
vars_to_train, vars_to_train,
learning_rate = self.learning_rate) learning_rate = self.learning_rate)
self.train_op = self.optimizer.minimize(graph.total_loss) self.train_op = self.optimizer.minimize(
graph.total_loss,
self.global_step)
# self.add_adam_optimizer( # self.add_adam_optimizer(
# graph.total_loss, # graph.total_loss,
...@@ -854,6 +856,8 @@ class log_mgr(): ...@@ -854,6 +856,8 @@ class log_mgr():
eval_vars_dict['per_region_answer_prob'].shape) eval_vars_dict['per_region_answer_prob'].shape)
print np.max(eval_vars_dict['per_region_answer_prob']) print np.max(eval_vars_dict['per_region_answer_prob'])
print 'Learning Rate: {}'.format(eval_vars_dict['lr'])
if (iter % self.log_every_n_iter==0 or is_last) and (iter!=0): if (iter % self.log_every_n_iter==0 or is_last) and (iter!=0):
self.model_saver.save( self.model_saver.save(
self.sess, self.sess,
...@@ -956,6 +960,7 @@ if __name__=='__main__': ...@@ -956,6 +960,7 @@ if __name__=='__main__':
'answer_scores': graph.answer_inference.answer_score[0], 'answer_scores': graph.answer_inference.answer_score[0],
'accuracy': graph.moving_average_accuracy, 'accuracy': graph.moving_average_accuracy,
'total_loss': graph.total_loss, 'total_loss': graph.total_loss,
'lr': optimizer.learning_rate,
# 'question_embed_concat': graph.question_embed_concat, # 'question_embed_concat': graph.question_embed_concat,
# 'answer_embed_concat': graph.answers_embed_concat, # 'answer_embed_concat': graph.answers_embed_concat,
# 'noun_embed': graph.noun_embed['positive_nouns'], # 'noun_embed': graph.noun_embed['positive_nouns'],
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment