1

For hyperparameters like learning rate, generating random numbers between 0.0001 and 1 will not provide an accurate representation of the hyperspace.

How would I generate 100 random numbers between 0.0001 and 1 with logscale?

michael0196
  • 1,497
  • 1
  • 9
  • 21
  • You can use [np.logspace](https://docs.scipy.org/doc/numpy/reference/generated/numpy.logspace.html) to create evenly spaced numbers on a log scale between start and stop, it's not technically random numbers as in your question, but much more repeatable – G. Anderson Jun 19 '19 at 21:33
  • x = np.logspace(start=0.0001, stop=1, num=5, endpoint=True, base=10.0, dtype=None) produces this array [1.0002302850208247, 1.778586534531975, 3.1626417517967864, 5.623736970908922, 10.0]. What am I getting wrong here? – michael0196 Jun 19 '19 at 21:42
  • 1
    [this answer](https://stackoverflow.com/a/31480118/7835267) suggests taking the `np.log10()` of the endpoints due to how numpy calculates start and stop for logspace – G. Anderson Jun 19 '19 at 21:50

0 Answers0