TorchedUp
LearnBetaProblemsSystem DesignSoonPremium
TorchedUp
LearnBetaProblemsSystem DesignSoonPremium
←

17. He Weight Initialization

Easy

Implement He (Kaiming) initialization for a weight matrix.

Signature: def he_init(fan_in: int, fan_out: int, seed: int = 0) -> np.ndarray

Return a weight matrix of shape (fan_out, fan_in) sampled from N(0, sqrt(2/fan_in)).

Use np.random.seed(seed) for reproducibility.

Math

W∼N(0,nin​2​​)

Asked at

Python 30/10 runs today

Output

Anything you print() in your code will show up here after you click Run.

Test Results

○shape 3x4 seed 0
○shape 2x2 seed 0
○shape 1x3 seed 42🔒 Premium