hasktorch-0.2.1.2: Haskell bindings to libtorch, supporting both typed and untyped tensors.
Safe HaskellNone
LanguageHaskell2010

Torch.Initializers

Synopsis

Documentation

data FanMode Source #

Constructors

FanIn 
FanOut 

newtype Shape Source #

Constructors

Shape [Int] 

calculateGain :: NonLinearity -> Float Source #

Gain scaling value for He initialization

calculateFan :: [Int] -> (Int, Int) Source #

Fan-in / Fan-out scaling calculation

xavierUniform :: Float -> [Int] -> IO Tensor Source #

Xavier Initialization - Uniform

xavierNormal :: Float -> [Int] -> IO Tensor Source #

Xavier Initialization - Normal

getter :: FanMode -> (Int, Int) -> Int Source #

Get fan in or fan out value depending on selected fan mode, used by Kaiming

kaimingUniform :: FanMode -> NonLinearity -> [Int] -> IO Tensor Source #

Kaiming Initialization - Uniform

kaimingNormal :: FanMode -> NonLinearity -> [Int] -> IO Tensor Source #

Kaiming Initialization - Normal