Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Synopsis
- data GLinear (weight :: Type) (bias :: Type) where
- type family GLinearF (hasBias :: HasBias) (gradient :: Gradient RequiresGradient) (device :: Device (DeviceType Nat)) (dataType :: DataType DType) (inputDim :: Dim (Name Symbol) (Size Nat)) (outputDim :: Dim (Name Symbol) (Size Nat)) :: Type where ...
- type family LinearWeightF (gradient :: Gradient RequiresGradient) (device :: Device (DeviceType Nat)) (dataType :: DataType DType) (inputDim :: Dim (Name Symbol) (Size Nat)) (outputDim :: Dim (Name Symbol) (Size Nat)) :: Type where ...
- type family LinearBiasF (hasBias :: HasBias) (gradient :: Gradient RequiresGradient) (device :: Device (DeviceType Nat)) (dataType :: DataType DType) (outputDim :: Dim (Name Symbol) (Size Nat)) :: Type where ...
- linearSpec :: forall hasBias gradient device dataType inputDim outputDim. SHasBias hasBias -> SGradient gradient -> SDevice device -> SDataType dataType -> SDim inputDim -> SDim outputDim -> ModelSpec (GLinearF hasBias gradient device dataType inputDim outputDim)
Documentation
data GLinear (weight :: Type) (bias :: Type) where Source #
Generic linear model with weight and optional bias.
GLinear | |
|
Instances
Generic (GLinear weight bias) Source # | |
(Show weight, Show bias) => Show (GLinear weight bias) Source # | |
(Eq weight, Eq bias) => Eq (GLinear weight bias) Source # | |
(Ord weight, Ord bias) => Ord (GLinear weight bias) Source # | |
Defined in Torch.GraduallyTyped.NN.Linear compare :: GLinear weight bias -> GLinear weight bias -> Ordering Source # (<) :: GLinear weight bias -> GLinear weight bias -> Bool Source # (<=) :: GLinear weight bias -> GLinear weight bias -> Bool Source # (>) :: GLinear weight bias -> GLinear weight bias -> Bool Source # (>=) :: GLinear weight bias -> GLinear weight bias -> Bool Source # max :: GLinear weight bias -> GLinear weight bias -> GLinear weight bias Source # min :: GLinear weight bias -> GLinear weight bias -> GLinear weight bias Source # | |
(HasStateDict weight, HasStateDict bias) => HasStateDict (GLinear weight bias) Source # | |
Defined in Torch.GraduallyTyped.NN.Linear fromStateDict :: (MonadIO m, MonadThrow m, MonadState StateDict m) => ModelSpec (GLinear weight bias) -> StateDictKey -> m (GLinear weight bias) Source # toStateDict :: (MonadThrow m, MonadState StateDict m) => StateDictKey -> GLinear weight bias -> m () Source # | |
(output ~ GLinear (Tensor gradient ('Layout 'Dense) (device <+> generatorDevice) dataType ('Shape '[outputDim, inputDim])) (Tensor gradient ('Layout 'Dense) (device <+> generatorDevice) dataType ('Shape '[outputDim])), generatorOutputDevice ~ (device <+> generatorDevice), SGetGeneratorDevice generatorDevice, SGetGeneratorDevice generatorOutputDevice) => HasInitialize (GLinear (Tensor gradient ('Layout 'Dense) device dataType ('Shape '[outputDim, inputDim])) (Tensor gradient ('Layout 'Dense) device dataType ('Shape '[outputDim]))) generatorDevice output generatorOutputDevice Source # | |
Defined in Torch.GraduallyTyped.NN.Linear | |
(output ~ GLinear (Tensor gradient ('Layout 'Dense) (device <+> generatorDevice) dataType ('Shape '[outputDim, inputDim])) (), generatorOutputDevice ~ (device <+> generatorDevice), SGetGeneratorDevice generatorDevice) => HasInitialize (GLinear (Tensor gradient ('Layout 'Dense) device dataType ('Shape '[outputDim, inputDim])) ()) generatorDevice output generatorOutputDevice Source # | TODO: Add |
Defined in Torch.GraduallyTyped.NN.Linear | |
HasForward (GLinear weight bias) input generatorDevice output generatorDevice => HasForward (GLinear (NamedModel weight) (NamedModel bias)) input generatorDevice output generatorDevice Source # | |
Defined in Torch.GraduallyTyped.NN.Linear forward :: MonadThrow m => GLinear (NamedModel weight) (NamedModel bias) -> input -> Generator generatorDevice -> m (output, Generator generatorDevice) Source # | |
HasInitialize (GLinear weight bias) generatorDevice (GLinear weight bias) generatorDevice => HasInitialize (GLinear (NamedModel weight) (NamedModel bias)) generatorDevice (GLinear (NamedModel weight) (NamedModel bias)) generatorDevice Source # | |
Defined in Torch.GraduallyTyped.NN.Linear initialize :: MonadThrow m => ModelSpec (GLinear (NamedModel weight) (NamedModel bias)) -> Generator generatorDevice -> m (GLinear (NamedModel weight) (NamedModel bias), Generator generatorDevice) Source # | |
output ~ Tensor (gradient <|> gradient') ('Layout 'Dense <+> layout') (device <+> device') (dataType <+> dataType') (LinearWithBiasF ('Shape '[outputDim, inputDim]) ('Shape '[outputDim]) shape') => HasForward (GLinear (Tensor gradient ('Layout 'Dense) device dataType ('Shape '[outputDim, inputDim])) (Tensor gradient ('Layout 'Dense) device dataType ('Shape '[outputDim]))) (Tensor gradient' layout' device' dataType' shape') generatorDevice output generatorDevice Source # | |
Defined in Torch.GraduallyTyped.NN.Linear forward :: MonadThrow m => GLinear (Tensor gradient ('Layout 'Dense) device dataType ('Shape '[outputDim, inputDim])) (Tensor gradient ('Layout 'Dense) device dataType ('Shape '[outputDim])) -> Tensor gradient' layout' device' dataType' shape' -> Generator generatorDevice -> m (output, Generator generatorDevice) Source # | |
output ~ Tensor (gradient <|> gradient') ('Layout 'Dense <+> layout') (device <+> device') (dataType <+> dataType') (LinearWithoutBiasF ('Shape '[outputDim, inputDim]) shape') => HasForward (GLinear (Tensor gradient ('Layout 'Dense) device dataType ('Shape '[outputDim, inputDim])) ()) (Tensor gradient' layout' device' dataType' shape') generatorDevice output generatorDevice Source # | |
type Rep (GLinear weight bias) Source # | |
Defined in Torch.GraduallyTyped.NN.Linear type Rep (GLinear weight bias) = D1 ('MetaData "GLinear" "Torch.GraduallyTyped.NN.Linear" "hasktorch-gradually-typed-0.2.0.0-1KV1aIPzzbp6JpSr37tC1K" 'False) (C1 ('MetaCons "GLinear" 'PrefixI 'True) (S1 ('MetaSel ('Just "linearWeight") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 weight) :*: S1 ('MetaSel ('Just "linearBias") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 bias))) | |
type ModelSpec (GLinear weight bias) Source # | |
type family GLinearF (hasBias :: HasBias) (gradient :: Gradient RequiresGradient) (device :: Device (DeviceType Nat)) (dataType :: DataType DType) (inputDim :: Dim (Name Symbol) (Size Nat)) (outputDim :: Dim (Name Symbol) (Size Nat)) :: Type where ... Source #
GLinearF hasBias gradient device dataType inputDim outputDim = GLinear (NamedModel (LinearWeightF gradient device dataType inputDim outputDim)) (NamedModel (LinearBiasF hasBias gradient device dataType outputDim)) |
type family LinearWeightF (gradient :: Gradient RequiresGradient) (device :: Device (DeviceType Nat)) (dataType :: DataType DType) (inputDim :: Dim (Name Symbol) (Size Nat)) (outputDim :: Dim (Name Symbol) (Size Nat)) :: Type where ... Source #
LinearWeightF gradient device dataType inputDim outputDim = Tensor gradient ('Layout 'Dense) device dataType ('Shape '[outputDim, inputDim]) |
type family LinearBiasF (hasBias :: HasBias) (gradient :: Gradient RequiresGradient) (device :: Device (DeviceType Nat)) (dataType :: DataType DType) (outputDim :: Dim (Name Symbol) (Size Nat)) :: Type where ... Source #
LinearBiasF 'WithoutBias _ _ _ _ = () | |
LinearBiasF 'WithBias gradient device dataType outputDim = Tensor gradient ('Layout 'Dense) device dataType ('Shape '[outputDim]) |