UtilsTraining
Initialization of the trainable parameters (Kaiming uniform, zeros, ones).
Initialization of the trainable parameters of the standard training controllers (deserialize_and_load).
-
namespace utilstraining
Functions
-
inline std::vector<double> kaiming_uniform(size_t size, double fan_in)
Generate a vector of values using Kaiming (He) Uniform initialization. Limit is sqrt(6 / fan_in).
The counter is process-global and shared across every layer’s weight generation, so its value only advances in the deterministic order the caller requests weights in. Callers that may request weights from multiple threads concurrently (e.g. missing-file fallback during convolution weight loading) must pre-load weights sequentially in the intended order before touching them from worker threads — otherwise the interleaving becomes unspecified even though the counter itself is now race-free.
-
inline std::vector<double> init_ones(size_t size)
Return a vector of constant values 1.0 (Ones initialization).
-
inline std::vector<double> init_zeros(size_t size)
Return a vector of constant values 0.0 (Zeros initialization).
-
inline std::vector<double> kaiming_uniform(size_t size, double fan_in)