pyhgf.utils.weight_initialisation.he_init#
- pyhgf.utils.weight_initialisation.he_init(n_parents, n_children, seed=None)[source]#
He / Kaiming normal initialisation.
Draws weights from \(\\mathcal{N}(0, \\sigma^2)\) where \(\\sigma = \\sqrt{2 / n_{\\text{parents}}}\). Designed for layers followed by ReLU activations.
- Parameters:
n_parents (int) – Number of parent (input) nodes — fan-in.
n_children (int) – Number of child (output) nodes — fan-out.
seed (int | None) – Optional random seed for reproducibility.
- Returns:
Weight vector of length
n_parents * n_children.- Return type:
numpy.ndarray