Created
July 25, 2021 09:05
-
-
Save anujonthemove/95402d67262db92f8b947671321680ba to your computer and use it in GitHub Desktop.
Generate learning rate value from a uniform random distribution between a given range of values
This file contains hidden or 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 os | |
import numpy as np | |
def sample_learning_rate_value(low = 0.0001, high = 1): | |
log_low = np.log10(low) | |
log_high = np.log(high) | |
r = np.random.randint(log_low, log_high)*np.random.rand() | |
alpha = 10**r | |
return alpha |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment