hasktorch-0.2.0.0: Functional differentiable programming in Haskell
Safe HaskellSafe-Inferred
LanguageHaskell2010

Torch.Typed.NN.Linear

Synopsis

Documentation

data LinearSpec (inputFeatures :: Nat) (outputFeatures :: Nat) (dtype :: DType) (device :: (DeviceType, Nat)) Source #

Constructors

LinearSpec 

Instances

Instances details
Show (LinearSpec inputFeatures outputFeatures dtype device) Source # 
Instance details

Defined in Torch.Typed.NN.Linear

Methods

showsPrec :: Int -> LinearSpec inputFeatures outputFeatures dtype device -> ShowS Source #

show :: LinearSpec inputFeatures outputFeatures dtype device -> String Source #

showList :: [LinearSpec inputFeatures outputFeatures dtype device] -> ShowS Source #

Eq (LinearSpec inputFeatures outputFeatures dtype device) Source # 
Instance details

Defined in Torch.Typed.NN.Linear

Methods

(==) :: LinearSpec inputFeatures outputFeatures dtype device -> LinearSpec inputFeatures outputFeatures dtype device -> Bool Source #

(/=) :: LinearSpec inputFeatures outputFeatures dtype device -> LinearSpec inputFeatures outputFeatures dtype device -> Bool Source #

(KnownNat inputFeatures, KnownNat outputFeatures, KnownDType dtype, KnownDevice device, RandDTypeIsValid device dtype) => Randomizable (LinearSpec inputFeatures outputFeatures dtype device) (Linear inputFeatures outputFeatures dtype device) Source # 
Instance details

Defined in Torch.Typed.NN.Linear

Methods

sample :: LinearSpec inputFeatures outputFeatures dtype device -> IO (Linear inputFeatures outputFeatures dtype device) Source #

data Linear (inputFeatures :: Nat) (outputFeatures :: Nat) (dtype :: DType) (device :: (DeviceType, Nat)) where Source #

Constructors

Linear 

Fields

  • :: forall inputFeatures outputFeatures dtype device. { weight :: Parameter device dtype '[outputFeatures, inputFeatures]
     
  •    , bias :: Parameter device dtype '[outputFeatures]
     
  •    } -> Linear inputFeatures outputFeatures dtype device
     

Instances

Instances details
Generic (Linear inputFeatures outputFeatures dtype device) Source # 
Instance details

Defined in Torch.Typed.NN.Linear

Associated Types

type Rep (Linear inputFeatures outputFeatures dtype device) :: Type -> Type Source #

Methods

from :: Linear inputFeatures outputFeatures dtype device -> Rep (Linear inputFeatures outputFeatures dtype device) x Source #

to :: Rep (Linear inputFeatures outputFeatures dtype device) x -> Linear inputFeatures outputFeatures dtype device Source #

Show (Linear inputFeatures outputFeatures dtype device) Source # 
Instance details

Defined in Torch.Typed.NN.Linear

Methods

showsPrec :: Int -> Linear inputFeatures outputFeatures dtype device -> ShowS Source #

show :: Linear inputFeatures outputFeatures dtype device -> String Source #

showList :: [Linear inputFeatures outputFeatures dtype device] -> ShowS Source #

Parameterized (Linear inputFeatures outputFeatures dtype device) Source # 
Instance details

Defined in Torch.Typed.NN.Linear

Associated Types

type Parameters (Linear inputFeatures outputFeatures dtype device) :: [Type] Source #

Methods

flattenParameters :: Linear inputFeatures outputFeatures dtype device -> HList (Parameters (Linear inputFeatures outputFeatures dtype device)) Source #

replaceParameters :: Linear inputFeatures outputFeatures dtype device -> HList (Parameters (Linear inputFeatures outputFeatures dtype device)) -> Linear inputFeatures outputFeatures dtype device Source #

(shape'' ~ MatMul shape '[inputFeatures, outputFeatures], shape' ~ Broadcast shape'' shape'') => HasForward (Linear inputFeatures outputFeatures dtype device) (Tensor device dtype shape) (Tensor device dtype shape') Source # 
Instance details

Defined in Torch.Typed.NN.Linear

Methods

forward :: Linear inputFeatures outputFeatures dtype device -> Tensor device dtype shape -> Tensor device dtype shape' Source #

forwardStoch :: Linear inputFeatures outputFeatures dtype device -> Tensor device dtype shape -> IO (Tensor device dtype shape') Source #

(KnownNat inputFeatures, KnownNat outputFeatures, KnownDType dtype, KnownDevice device, RandDTypeIsValid device dtype) => Randomizable (LinearSpec inputFeatures outputFeatures dtype device) (Linear inputFeatures outputFeatures dtype device) Source # 
Instance details

Defined in Torch.Typed.NN.Linear

Methods

sample :: LinearSpec inputFeatures outputFeatures dtype device -> IO (Linear inputFeatures outputFeatures dtype device) Source #

type Rep (Linear inputFeatures outputFeatures dtype device) Source # 
Instance details

Defined in Torch.Typed.NN.Linear

type Rep (Linear inputFeatures outputFeatures dtype device) = D1 ('MetaData "Linear" "Torch.Typed.NN.Linear" "hasktorch-0.2.0.0-F6yFRaDiRF49lpq95SVuR8" 'False) (C1 ('MetaCons "Linear" 'PrefixI 'True) (S1 ('MetaSel ('Just "weight") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Parameter device dtype '[outputFeatures, inputFeatures])) :*: S1 ('MetaSel ('Just "bias") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Parameter device dtype '[outputFeatures]))))
type Parameters (Linear inputFeatures outputFeatures dtype device) Source # 
Instance details

Defined in Torch.Typed.NN.Linear

type Parameters (Linear inputFeatures outputFeatures dtype device) = GParameters (Rep (Linear inputFeatures outputFeatures dtype device))

linearForward :: _ => Linear _ _ _ _ -> Tensor _ _ _ -> Tensor _ _ _ Source #

linear The constraints on this one are _very_ involved, so the partial signatures make the code significantly cleaner.