56 [[nodiscard]]
inline float glorot_limit(Index fan_in, Index fan_out)
58 return sqrt(6.0f /
static_cast<float>(fan_in + fan_out));
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.
Index random_integer(Index, Index)
Draws an integer uniformly in [min, max].
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
long long get_seed()
Returns the seed currently used by the library RNG.
float random_uniform(float=-1, float=1)
Draws a float uniformly in [min, max].
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 set_seed(unsigned seed)
Seeds the library-wide pseudo-random number generator.
void shuffle(VectorB &vector_to_shuffle)
Randomly permutes the entries of a boolean vector in place.
Map< VectorR, AlignedMax > VectorMap
Definition pch.h:185
Matrix< bool, Dynamic, 1 > VectorB
Definition pch.h:183
Matrix< float, Dynamic, Dynamic, Layout > MatrixR
Definition pch.h:177
Map< MatrixR, Layout|AlignedMax > MatrixMap
Definition pch.h:186