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

Torch.Typed.NN

Documentation

class HasForward f a b | f a -> b where Source #

Minimal complete definition

Nothing

Methods

forward :: f -> a -> b Source #

default forward :: (Generic f, Generic a, Generic b, GHasForward (Rep f) (Rep a) (Rep b)) => f -> a -> b Source #

forwardStoch :: f -> a -> IO b Source #

default forwardStoch :: (Generic f, Generic a, Generic b, GHasForward (Rep f) (Rep a) (Rep b)) => f -> a -> IO b Source #

Instances

Instances details
HasForward Linear Tensor Tensor Source # 
Instance details

Defined in Torch.NN

HasForward UpSample Tensor Tensor Source # 
Instance details

Defined in Torch.NN

HasForward ScriptModule [IValue] IValue Source # 
Instance details

Defined in Torch.Script

HasForward Dropout (Tensor device dtype shape) (Tensor device dtype shape) Source # 
Instance details

Defined in Torch.Typed.NN.Dropout

Methods

forward :: Dropout -> Tensor device dtype shape -> Tensor device dtype shape Source #

forwardStoch :: Dropout -> Tensor device dtype shape -> IO (Tensor device dtype shape) Source #

(IsSuffixOf normalizedShape shape, KnownShape normalizedShape) => HasForward (LayerNorm normalizedShape dtype device) (Tensor device dtype shape) (Tensor device dtype shape) Source # 
Instance details

Defined in Torch.Typed.NN.Normalization

Methods

forward :: LayerNorm normalizedShape dtype device -> Tensor device dtype shape -> Tensor device dtype shape Source #

forwardStoch :: LayerNorm normalizedShape dtype device -> Tensor device dtype shape -> IO (Tensor device dtype shape) 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 #

(All KnownNat '[stride, padding, inputChannelSize, outputChannelSize, kernelSize, inputSize, batchSize, outputSize], ConvSideCheck inputSize kernelSize stride padding outputSize) => HasForward (Conv1d inputChannelSize outputChannelSize kernelSize dtype device) (Tensor device dtype '[batchSize, inputChannelSize, inputSize], Proxy stride, Proxy padding) (Tensor device dtype '[batchSize, outputChannelSize, outputSize]) Source # 
Instance details

Defined in Torch.Typed.NN.Convolution

Methods

forward :: Conv1d inputChannelSize outputChannelSize kernelSize dtype device -> (Tensor device dtype '[batchSize, inputChannelSize, inputSize], Proxy stride, Proxy padding) -> Tensor device dtype '[batchSize, outputChannelSize, outputSize] Source #

forwardStoch :: Conv1d inputChannelSize outputChannelSize kernelSize dtype device -> (Tensor device dtype '[batchSize, inputChannelSize, inputSize], Proxy stride, Proxy padding) -> IO (Tensor device dtype '[batchSize, outputChannelSize, outputSize]) Source #

(All KnownNat '[stride, padding, inputChannelSize, outputChannelSize, kernelSize, inputSize, batchSize, outputSize], ConvSideCheck inputSize kernelSize stride padding outputSize) => HasForward (ConvTranspose1d inputChannelSize outputChannelSize kernelSize dtype device) (Tensor device dtype '[batchSize, inputChannelSize, inputSize], Proxy stride, Proxy padding) (Tensor device dtype '[batchSize, outputChannelSize, outputSize]) Source # 
Instance details

Defined in Torch.Typed.NN.Convolution

Methods

forward :: ConvTranspose1d inputChannelSize outputChannelSize kernelSize dtype device -> (Tensor device dtype '[batchSize, inputChannelSize, inputSize], Proxy stride, Proxy padding) -> Tensor device dtype '[batchSize, outputChannelSize, outputSize] Source #

forwardStoch :: ConvTranspose1d inputChannelSize outputChannelSize kernelSize dtype device -> (Tensor device dtype '[batchSize, inputChannelSize, inputSize], Proxy stride, Proxy padding) -> IO (Tensor device dtype '[batchSize, outputChannelSize, outputSize]) Source #

(All KnownNat '[Fst stride, Snd stride, Fst padding, Snd padding, inputChannelSize, outputChannelSize, kernelSize0, kernelSize1, inputSize0, inputSize1, batchSize, outputSize0, outputSize1], ConvSideCheck inputSize0 kernelSize0 (Fst stride) (Fst padding) outputSize0, ConvSideCheck inputSize1 kernelSize1 (Snd stride) (Snd padding) outputSize1) => HasForward (Conv2d inputChannelSize outputChannelSize kernelSize0 kernelSize1 dtype device) (Tensor device dtype '[batchSize, inputChannelSize, inputSize0, inputSize1], Proxy stride, Proxy padding) (Tensor device dtype '[batchSize, outputChannelSize, outputSize0, outputSize1]) Source # 
Instance details

Defined in Torch.Typed.NN.Convolution

Methods

forward :: Conv2d inputChannelSize outputChannelSize kernelSize0 kernelSize1 dtype device -> (Tensor device dtype '[batchSize, inputChannelSize, inputSize0, inputSize1], Proxy stride, Proxy padding) -> Tensor device dtype '[batchSize, outputChannelSize, outputSize0, outputSize1] Source #

forwardStoch :: Conv2d inputChannelSize outputChannelSize kernelSize0 kernelSize1 dtype device -> (Tensor device dtype '[batchSize, inputChannelSize, inputSize0, inputSize1], Proxy stride, Proxy padding) -> IO (Tensor device dtype '[batchSize, outputChannelSize, outputSize0, outputSize1]) Source #

(All KnownNat '[Fst stride, Snd stride, Fst padding, Snd padding, inputChannelSize, outputChannelSize, kernelSize0, kernelSize1, inputSize0, inputSize1, batchSize, outputSize0, outputSize1], ConvSideCheck inputSize0 kernelSize0 (Fst stride) (Fst padding) outputSize0, ConvSideCheck inputSize1 kernelSize1 (Snd stride) (Snd padding) outputSize1) => HasForward (ConvTranspose2d inputChannelSize outputChannelSize kernelSize0 kernelSize1 dtype device) (Tensor device dtype '[batchSize, inputChannelSize, inputSize0, inputSize1], Proxy stride, Proxy padding) (Tensor device dtype '[batchSize, outputChannelSize, outputSize0, outputSize1]) Source # 
Instance details

Defined in Torch.Typed.NN.Convolution

Methods

forward :: ConvTranspose2d inputChannelSize outputChannelSize kernelSize0 kernelSize1 dtype device -> (Tensor device dtype '[batchSize, inputChannelSize, inputSize0, inputSize1], Proxy stride, Proxy padding) -> Tensor device dtype '[batchSize, outputChannelSize, outputSize0, outputSize1] Source #

forwardStoch :: ConvTranspose2d inputChannelSize outputChannelSize kernelSize0 kernelSize1 dtype device -> (Tensor device dtype '[batchSize, inputChannelSize, inputSize0, inputSize1], Proxy stride, Proxy padding) -> IO (Tensor device dtype '[batchSize, outputChannelSize, outputSize0, outputSize1]) Source #

(KnownMaybeNat paddingIdx, PaddingIdxCheck paddingIdx numEmbeds, shape' ~ Reverse (embedSize ': Reverse shape)) => HasForward (Embedding paddingIdx numEmbeds embedSize embeddingType dtype device) (Tensor device 'Int64 shape) (Tensor device dtype shape') Source # 
Instance details

Defined in Torch.Typed.NN.Sparse

Methods

forward :: Embedding paddingIdx numEmbeds embedSize embeddingType dtype device -> Tensor device 'Int64 shape -> Tensor device dtype shape' Source #

forwardStoch :: Embedding paddingIdx numEmbeds embedSize embeddingType dtype device -> Tensor device 'Int64 shape -> IO (Tensor device dtype shape') Source #

(All KnownNat '[Fst3 stride, Snd3 stride, Trd3 stride, Fst3 padding, Snd3 padding, Trd3 padding, inputChannelSize, outputChannelSize, kernelSize0, kernelSize1, kernelSize2, inputSize0, inputSize1, inputSize2, batchSize], ConvSideCheck inputSize0 kernelSize0 (Fst3 stride) (Fst3 padding) outputSize0, ConvSideCheck inputSize1 kernelSize1 (Snd3 stride) (Snd3 padding) outputSize1, ConvSideCheck inputSize2 kernelSize2 (Trd3 stride) (Trd3 padding) outputSize2) => HasForward (Conv3d inputChannelSize outputChannelSize kernelSize0 kernelSize1 kernelSize2 dtype device) (Tensor device dtype '[batchSize, inputChannelSize, inputSize0, inputSize1, inputSize2], Proxy stride, Proxy padding) (Tensor device dtype '[batchSize, outputChannelSize, outputSize0, outputSize1, outputSize2]) Source # 
Instance details

Defined in Torch.Typed.NN.Convolution

Methods

forward :: Conv3d inputChannelSize outputChannelSize kernelSize0 kernelSize1 kernelSize2 dtype device -> (Tensor device dtype '[batchSize, inputChannelSize, inputSize0, inputSize1, inputSize2], Proxy stride, Proxy padding) -> Tensor device dtype '[batchSize, outputChannelSize, outputSize0, outputSize1, outputSize2] Source #

forwardStoch :: Conv3d inputChannelSize outputChannelSize kernelSize0 kernelSize1 kernelSize2 dtype device -> (Tensor device dtype '[batchSize, inputChannelSize, inputSize0, inputSize1, inputSize2], Proxy stride, Proxy padding) -> IO (Tensor device dtype '[batchSize, outputChannelSize, outputSize0, outputSize1, outputSize2]) Source #

(All KnownNat '[Fst3 stride, Snd3 stride, Trd3 stride, Fst3 padding, Snd3 padding, Trd3 padding, inputChannelSize, outputChannelSize, kernelSize0, kernelSize1, kernelSize2, inputSize0, inputSize1, inputSize2, batchSize], ConvSideCheck inputSize0 kernelSize0 (Fst3 stride) (Fst3 padding) outputSize0, ConvSideCheck inputSize1 kernelSize1 (Snd3 stride) (Snd3 padding) outputSize1, ConvSideCheck inputSize2 kernelSize2 (Trd3 stride) (Trd3 padding) outputSize2) => HasForward (ConvTranspose3d inputChannelSize outputChannelSize kernelSize0 kernelSize1 kernelSize2 dtype device) (Tensor device dtype '[batchSize, inputChannelSize, inputSize0, inputSize1, inputSize2], Proxy stride, Proxy padding) (Tensor device dtype '[batchSize, outputChannelSize, outputSize0, outputSize1, outputSize2]) Source # 
Instance details

Defined in Torch.Typed.NN.Convolution

Methods

forward :: ConvTranspose3d inputChannelSize outputChannelSize kernelSize0 kernelSize1 kernelSize2 dtype device -> (Tensor device dtype '[batchSize, inputChannelSize, inputSize0, inputSize1, inputSize2], Proxy stride, Proxy padding) -> Tensor device dtype '[batchSize, outputChannelSize, outputSize0, outputSize1, outputSize2] Source #

forwardStoch :: ConvTranspose3d inputChannelSize outputChannelSize kernelSize0 kernelSize1 kernelSize2 dtype device -> (Tensor device dtype '[batchSize, inputChannelSize, inputSize0, inputSize1, inputSize2], Proxy stride, Proxy padding) -> IO (Tensor device dtype '[batchSize, outputChannelSize, outputSize0, outputSize1, outputSize2]) Source #

(All KnownNat '[paddingIdx, embedDim, seqLen, batchSize], (paddingIdx + 1) <= numEmbeds, 1 <= seqLen, HFoldrM IO (FoldLayers batchSize seqLen dtype device) (Tensor device dtype '[batchSize, seqLen, embedDim]) (HReplicateR numAttnLayers (TransformerLayer embedDim embedDim embedDim numHeads ffnDim dtype device)) (Tensor device dtype '[batchSize, seqLen, embedDim]), BasicArithmeticDTypeIsValid device dtype, ComparisonDTypeIsValid device dtype, ComparisonDTypeIsValid device 'Int64, KnownDType dtype, KnownDevice device) => HasForward (TransformerLM numAttnLayers numHeads ffnDim paddingIdx numEmbeds embedDim dtype device) (Tensor device 'Int64 '[batchSize, seqLen]) (Tensor device dtype '[batchSize, seqLen, numEmbeds]) Source # 
Instance details

Defined in Torch.Typed.NN.Transformer

Methods

forward :: TransformerLM numAttnLayers numHeads ffnDim paddingIdx numEmbeds embedDim dtype device -> Tensor device 'Int64 '[batchSize, seqLen] -> Tensor device dtype '[batchSize, seqLen, numEmbeds] Source #

forwardStoch :: TransformerLM numAttnLayers numHeads ffnDim paddingIdx numEmbeds embedDim dtype device -> Tensor device 'Int64 '[batchSize, seqLen] -> IO (Tensor device dtype '[batchSize, seqLen, numEmbeds]) Source #