Created
October 22, 2022 02:37
-
-
Save wolfecameron/20859e719118050cd09f08605eb2b295 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import matplotlib.pyplot as plt | |
def calc_demon_decay(total_iter, curr_iter, min_val, max_val): | |
z = float(total_iter - curr_iter) / total_iter | |
return min_val + float(max_val - min_val) * (z / (1 - 0.9 + 0.9*z)) | |
train_iters = 100 | |
max_mom = 0.9 | |
min_mom = 0.0 | |
plt.title('Demon Decay') | |
plt.ylabel('Momentum') | |
ply.xlabel('Training Iterations') | |
all_demon = [calc_demon_decay(train_iters, x, min_mom, max_mom) for x in range(train_iters)] | |
plt.plot(all_demon) | |
plt.show() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment