Loading...
Searching...
No Matches
random_utilities.h
Go to the documentation of this file.
Definition adaptive_moment_estimation.h:14
void set_random_normal(MatrixMap, float=0, float=1)
Fills the matrix with normal random values of the given mean and standard deviation.
void set_random_uniform(MatrixR &, float=-0.1, float=0.1)
Fills the matrix with uniform random values in [min, max].
Index get_random_element(const vector< Index > &)
Picks one element uniformly at random from the given vector.
float glorot_limit(Index fan_in, Index fan_out)
Returns the Glorot/Xavier uniform initialization limit sqrt(6 / (fan_in + fan_out)).
Definition random_utilities.h:56
void shuffle_vector(vector< T > &)
Randomly permutes the entries of the given vector in place.
bool random_bool(float=0.5)
Draws a boolean that is true with the given probability.
void shuffle_vector_blocks(vector< Index > &, size_t=20)
Shuffles contiguous blocks of the given length while preserving in-block order.
void set_random_integer(MatrixR &, Index, Index)
Fills the matrix with uniform random integers in [min, max].
void shuffle(VectorB &vector_to_shuffle)
Randomly permutes the entries of a boolean vector in place.