Skip to content

Instantly share code, notes, and snippets.

@anujonthemove
Created July 25, 2021 09:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anujonthemove/95402d67262db92f8b947671321680ba to your computer and use it in GitHub Desktop.
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
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