Difference between a log scale and linear scale : np.random.rand()
Let us assume you want to do hyperparameteroptimization with a hyperparameter $h\in[0,1]$. Let us additionally assume that we want to test hundred possible values for the parameter.

If you choose a linear scale your parameter values will be uniformly selected form $[0,10^4]$. It will be very unlikely that you will small parameter values smaller than $10^{-4}$, because it is very unlikely to choose a number from this interval. The probability for randomly choosing a number from this interval is given by the following fraction

$$\dfrac{10^{-4}}{10^4}=10^{-8}.$$

Now if we choose our random numbers from the intervall $[-5,5]$ and use this as the power of the number $10$ we will stretch the interval onto an exponential scale which will make it more likely that we have numbers in $[0,10^{-4}]$ because the chance of choosing  a negative number for the exponent is much more likely. The probability will be $1/10$, because the wanted interval from $[-5,-4]$ has a width of $1$ and the whole interval from $[-5,5]$ has the width $10$.