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

Torch.Typed.Optim.CppOptim

Documentation

class CppOptimizer option where Source #

Minimal complete definition

initOptimizer

Methods

initOptimizer :: forall model tensors. (Parameterized model, HMap' ToDependent (Parameters model) tensors, Castable (HList tensors) [ATenTensor]) => option -> model -> IO (CppOptimizerState option (Parameters model)) Source #

unsafeStep :: forall model dev dtype lossShape tensors res. (Parameterized model, HMap' ToDependent (Parameters model) tensors, HMap' ToParameter tensors (Parameters model), Castable (HList tensors) [ATenTensor]) => model -> CppOptimizerState option (Parameters model) -> Tensor dev dtype lossShape -> IO (model, CppOptimizerState option (Parameters model)) Source #

Instances

Instances details
CppOptimizer AdamOptions Source # 
Instance details

Defined in Torch.Typed.Optim.CppOptim

Methods

initOptimizer :: forall model (tensors :: [Type]). (Parameterized model, HMap' ToDependent (Parameters model) tensors, Castable (HList tensors) [ATenTensor]) => AdamOptions -> model -> IO (CppOptimizerState AdamOptions (Parameters model)) Source #

unsafeStep :: forall model (dev :: (DeviceType, Nat)) (dtype :: DType) (lossShape :: [Nat]) (tensors :: [Type]) res. (Parameterized model, HMap' ToDependent (Parameters model) tensors, HMap' ToParameter tensors (Parameters model), Castable (HList tensors) [ATenTensor]) => model -> CppOptimizerState AdamOptions (Parameters model) -> Tensor dev dtype lossShape -> IO (model, CppOptimizerState AdamOptions (Parameters model)) Source #

CppOptimizer AdamwOptions Source # 
Instance details

Defined in Torch.Typed.Optim.CppOptim

Methods

initOptimizer :: forall model (tensors :: [Type]). (Parameterized model, HMap' ToDependent (Parameters model) tensors, Castable (HList tensors) [ATenTensor]) => AdamwOptions -> model -> IO (CppOptimizerState AdamwOptions (Parameters model)) Source #

unsafeStep :: forall model (dev :: (DeviceType, Nat)) (dtype :: DType) (lossShape :: [Nat]) (tensors :: [Type]) res. (Parameterized model, HMap' ToDependent (Parameters model) tensors, HMap' ToParameter tensors (Parameters model), Castable (HList tensors) [ATenTensor]) => model -> CppOptimizerState AdamwOptions (Parameters model) -> Tensor dev dtype lossShape -> IO (model, CppOptimizerState AdamwOptions (Parameters model)) Source #

CppOptimizer LbfgsOptions Source # 
Instance details

Defined in Torch.Typed.Optim.CppOptim

Methods

initOptimizer :: forall model (tensors :: [Type]). (Parameterized model, HMap' ToDependent (Parameters model) tensors, Castable (HList tensors) [ATenTensor]) => LbfgsOptions -> model -> IO (CppOptimizerState LbfgsOptions (Parameters model)) Source #

unsafeStep :: forall model (dev :: (DeviceType, Nat)) (dtype :: DType) (lossShape :: [Nat]) (tensors :: [Type]) res. (Parameterized model, HMap' ToDependent (Parameters model) tensors, HMap' ToParameter tensors (Parameters model), Castable (HList tensors) [ATenTensor]) => model -> CppOptimizerState LbfgsOptions (Parameters model) -> Tensor dev dtype lossShape -> IO (model, CppOptimizerState LbfgsOptions (Parameters model)) Source #

CppOptimizer RmspropOptions Source # 
Instance details

Defined in Torch.Typed.Optim.CppOptim

Methods

initOptimizer :: forall model (tensors :: [Type]). (Parameterized model, HMap' ToDependent (Parameters model) tensors, Castable (HList tensors) [ATenTensor]) => RmspropOptions -> model -> IO (CppOptimizerState RmspropOptions (Parameters model)) Source #

unsafeStep :: forall model (dev :: (DeviceType, Nat)) (dtype :: DType) (lossShape :: [Nat]) (tensors :: [Type]) res. (Parameterized model, HMap' ToDependent (Parameters model) tensors, HMap' ToParameter tensors (Parameters model), Castable (HList tensors) [ATenTensor]) => model -> CppOptimizerState RmspropOptions (Parameters model) -> Tensor dev dtype lossShape -> IO (model, CppOptimizerState RmspropOptions (Parameters model)) Source #

CppOptimizer SGDOptions Source # 
Instance details

Defined in Torch.Typed.Optim.CppOptim

Methods

initOptimizer :: forall model (tensors :: [Type]). (Parameterized model, HMap' ToDependent (Parameters model) tensors, Castable (HList tensors) [ATenTensor]) => SGDOptions -> model -> IO (CppOptimizerState SGDOptions (Parameters model)) Source #

unsafeStep :: forall model (dev :: (DeviceType, Nat)) (dtype :: DType) (lossShape :: [Nat]) (tensors :: [Type]) res. (Parameterized model, HMap' ToDependent (Parameters model) tensors, HMap' ToParameter tensors (Parameters model), Castable (HList tensors) [ATenTensor]) => model -> CppOptimizerState SGDOptions (Parameters model) -> Tensor dev dtype lossShape -> IO (model, CppOptimizerState SGDOptions (Parameters model)) Source #

data ToParameter Source #

Constructors

ToParameter 

Instances

Instances details
Apply' ToParameter (Tensor dev dtype shape) (Parameter dev dtype shape) Source # 
Instance details

Defined in Torch.Typed.Optim.CppOptim

Methods

apply' :: ToParameter -> Tensor dev dtype shape -> Parameter dev dtype shape Source #

data CppOptimizerState option (params :: [*]) Source #

Constructors

CppOptimizerState option CppOptimizerRef 

runStep :: (CppOptimizer option, Parameterized model, HMap' ToDependent (Parameters model) tensors, HMap' ToParameter tensors (Parameters model), Castable (HList tensors) [ATenTensor]) => model -> CppOptimizerState option (Parameters model) -> Loss dev dtype -> IO (model, CppOptimizerState option (Parameters model)) Source #

data AdamOptions Source #

Instances

Instances details
Show AdamOptions Source # 
Instance details

Defined in Torch.Optim.CppOptim

Default AdamOptions Source # 
Instance details

Defined in Torch.Optim.CppOptim

Eq AdamOptions Source # 
Instance details

Defined in Torch.Optim.CppOptim

CppOptimizer AdamOptions Source # 
Instance details

Defined in Torch.Optim.CppOptim

CppOptimizer AdamOptions Source # 
Instance details

Defined in Torch.Typed.Optim.CppOptim

Methods

initOptimizer :: forall model (tensors :: [Type]). (Parameterized model, HMap' ToDependent (Parameters model) tensors, Castable (HList tensors) [ATenTensor]) => AdamOptions -> model -> IO (CppOptimizerState AdamOptions (Parameters model)) Source #

unsafeStep :: forall model (dev :: (DeviceType, Nat)) (dtype :: DType) (lossShape :: [Nat]) (tensors :: [Type]) res. (Parameterized model, HMap' ToDependent (Parameters model) tensors, HMap' ToParameter tensors (Parameters model), Castable (HList tensors) [ATenTensor]) => model -> CppOptimizerState AdamOptions (Parameters model) -> Tensor dev dtype lossShape -> IO (model, CppOptimizerState AdamOptions (Parameters model)) Source #

data AdamwOptions Source #

Instances

Instances details
Show AdamwOptions Source # 
Instance details

Defined in Torch.Optim.CppOptim

Default AdamwOptions Source # 
Instance details

Defined in Torch.Optim.CppOptim

Eq AdamwOptions Source # 
Instance details

Defined in Torch.Optim.CppOptim

CppOptimizer AdamwOptions Source # 
Instance details

Defined in Torch.Optim.CppOptim

CppOptimizer AdamwOptions Source # 
Instance details

Defined in Torch.Typed.Optim.CppOptim

Methods

initOptimizer :: forall model (tensors :: [Type]). (Parameterized model, HMap' ToDependent (Parameters model) tensors, Castable (HList tensors) [ATenTensor]) => AdamwOptions -> model -> IO (CppOptimizerState AdamwOptions (Parameters model)) Source #

unsafeStep :: forall model (dev :: (DeviceType, Nat)) (dtype :: DType) (lossShape :: [Nat]) (tensors :: [Type]) res. (Parameterized model, HMap' ToDependent (Parameters model) tensors, HMap' ToParameter tensors (Parameters model), Castable (HList tensors) [ATenTensor]) => model -> CppOptimizerState AdamwOptions (Parameters model) -> Tensor dev dtype lossShape -> IO (model, CppOptimizerState AdamwOptions (Parameters model)) Source #

data LbfgsOptions Source #

Instances

Instances details
Show LbfgsOptions Source # 
Instance details

Defined in Torch.Optim.CppOptim

Default LbfgsOptions Source # 
Instance details

Defined in Torch.Optim.CppOptim

Eq LbfgsOptions Source # 
Instance details

Defined in Torch.Optim.CppOptim

CppOptimizer LbfgsOptions Source # 
Instance details

Defined in Torch.Optim.CppOptim

CppOptimizer LbfgsOptions Source # 
Instance details

Defined in Torch.Typed.Optim.CppOptim

Methods

initOptimizer :: forall model (tensors :: [Type]). (Parameterized model, HMap' ToDependent (Parameters model) tensors, Castable (HList tensors) [ATenTensor]) => LbfgsOptions -> model -> IO (CppOptimizerState LbfgsOptions (Parameters model)) Source #

unsafeStep :: forall model (dev :: (DeviceType, Nat)) (dtype :: DType) (lossShape :: [Nat]) (tensors :: [Type]) res. (Parameterized model, HMap' ToDependent (Parameters model) tensors, HMap' ToParameter tensors (Parameters model), Castable (HList tensors) [ATenTensor]) => model -> CppOptimizerState LbfgsOptions (Parameters model) -> Tensor dev dtype lossShape -> IO (model, CppOptimizerState LbfgsOptions (Parameters model)) Source #

data RmspropOptions Source #

Instances

Instances details
Show RmspropOptions Source # 
Instance details

Defined in Torch.Optim.CppOptim

Default RmspropOptions Source # 
Instance details

Defined in Torch.Optim.CppOptim

Eq RmspropOptions Source # 
Instance details

Defined in Torch.Optim.CppOptim

CppOptimizer RmspropOptions Source # 
Instance details

Defined in Torch.Optim.CppOptim

CppOptimizer RmspropOptions Source # 
Instance details

Defined in Torch.Typed.Optim.CppOptim

Methods

initOptimizer :: forall model (tensors :: [Type]). (Parameterized model, HMap' ToDependent (Parameters model) tensors, Castable (HList tensors) [ATenTensor]) => RmspropOptions -> model -> IO (CppOptimizerState RmspropOptions (Parameters model)) Source #

unsafeStep :: forall model (dev :: (DeviceType, Nat)) (dtype :: DType) (lossShape :: [Nat]) (tensors :: [Type]) res. (Parameterized model, HMap' ToDependent (Parameters model) tensors, HMap' ToParameter tensors (Parameters model), Castable (HList tensors) [ATenTensor]) => model -> CppOptimizerState RmspropOptions (Parameters model) -> Tensor dev dtype lossShape -> IO (model, CppOptimizerState RmspropOptions (Parameters model)) Source #

data SGDOptions Source #

Instances

Instances details
Show SGDOptions Source # 
Instance details

Defined in Torch.Optim.CppOptim

Default SGDOptions Source # 
Instance details

Defined in Torch.Optim.CppOptim

Eq SGDOptions Source # 
Instance details

Defined in Torch.Optim.CppOptim

CppOptimizer SGDOptions Source # 
Instance details

Defined in Torch.Optim.CppOptim

CppOptimizer SGDOptions Source # 
Instance details

Defined in Torch.Typed.Optim.CppOptim

Methods

initOptimizer :: forall model (tensors :: [Type]). (Parameterized model, HMap' ToDependent (Parameters model) tensors, Castable (HList tensors) [ATenTensor]) => SGDOptions -> model -> IO (CppOptimizerState SGDOptions (Parameters model)) Source #

unsafeStep :: forall model (dev :: (DeviceType, Nat)) (dtype :: DType) (lossShape :: [Nat]) (tensors :: [Type]) res. (Parameterized model, HMap' ToDependent (Parameters model) tensors, HMap' ToParameter tensors (Parameters model), Castable (HList tensors) [ATenTensor]) => model -> CppOptimizerState SGDOptions (Parameters model) -> Tensor dev dtype lossShape -> IO (model, CppOptimizerState SGDOptions (Parameters model)) Source #