Skip to content
DeepForgeby svx
All problems
EasyDeep Learningdl-018

Xavier Init Std

Problem

Return the Xavier/Glorot normal initialization standard deviation sqrt(2 / (fan_in + fan_out)).

The signature is xavier_std(fan_in, fan_out).

Hint

Average the fan-in and fan-out inside the denominator.

Test cases

case 1
in: [100,100]
expected: 0.1
case 2
in: [1,1]
expected: 1
case 3
in: [3,12]
expected: 0.3651483717
case 4
in: [256,512]
expected: 0.0510310363
Starter codePython
import math
def xavier_std(fan_in, fan_out):
    # Your code here
    pass

4 test cases · run your code against them in the editor