Skip to content

Commit

Permalink
updating script to use new learning APIs
Browse files Browse the repository at this point in the history
  • Loading branch information
mx-iao authored Apr 6, 2018
1 parent ca0f889 commit d4781c1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Examples/1stSteps/MNIST_Complex_Training.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ def criterion(data, label_one_hot):
def adjust_lr_callback(index, average_error, cv_num_samples, cv_num_minibatches):
global prev_metric
if (prev_metric - average_error) / prev_metric < 0.05: # relative gain must reduce metric by at least 5% rel
learner.reset_learning_rate(C.learning_parameter_per_sample(learner.learning_rate() / 2))
learner.reset_learning_rate(C.learning_parameter_schedule_per_sample(learner.learning_rate() / 2))
if learner.learning_rate() < lr_per_sample / (2**7-0.1): # we are done after the 6-th LR cut
print("Learning rate {} too small. Training complete.".format(learner.learning_rate()))
return False # means we are done
Expand Down

0 comments on commit d4781c1

Please sign in to comment.