protovoices-rl-0.1.0.0
Safe HaskellNone
LanguageGHC2021

RL.A2C

Synopsis

Documentation

printTensors :: forall (dev :: (DeviceType, Nat)). HList (ModelTensors dev) -> IO () Source #

printParams :: forall (dev :: (DeviceType, Nat)). HList (ModelParams dev) -> IO () Source #

data A2CState (dev :: (DeviceType, Nat)) Source #

Constructors

A2CState 

Fields

Instances

Instances details
Generic (A2CState dev) Source # 
Instance details

Defined in RL.A2C

Associated Types

type Rep (A2CState dev) 
Instance details

Defined in RL.A2C

type Rep (A2CState dev) = D1 ('MetaData "A2CState" "RL.A2C" "protovoices-rl-0.1.0.0-JjFFM1P77sPCI8QyjRIHUO" 'False) (C1 ('MetaCons "A2CState" 'PrefixI 'True) ((S1 ('MetaSel ('Just "a2cActor") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (QModel dev)) :*: S1 ('MetaSel ('Just "a2cCritic") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (QModel dev))) :*: (S1 ('MetaSel ('Just "a2cOptActor") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 GD) :*: S1 ('MetaSel ('Just "a2cOptCritic") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 GD))))

Methods

from :: A2CState dev -> Rep (A2CState dev) x #

to :: Rep (A2CState dev) x -> A2CState dev #

type Rep (A2CState dev) Source # 
Instance details

Defined in RL.A2C

type Rep (A2CState dev) = D1 ('MetaData "A2CState" "RL.A2C" "protovoices-rl-0.1.0.0-JjFFM1P77sPCI8QyjRIHUO" 'False) (C1 ('MetaCons "A2CState" 'PrefixI 'True) ((S1 ('MetaSel ('Just "a2cActor") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (QModel dev)) :*: S1 ('MetaSel ('Just "a2cCritic") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (QModel dev))) :*: (S1 ('MetaSel ('Just "a2cOptActor") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 GD) :*: S1 ('MetaSel ('Just "a2cOptCritic") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 GD))))

pieceStep Source #

Arguments

:: forall (dev :: (DeviceType, Nat)) label. IsValidDevice dev 
=> Eval (Edges SPitch) [Edge SPitch] (Notes SPitch) [Note SPitch] (Spread SPitch) (PVLeftmost SPitch) 
-> IOGenM StdGen 
-> PVRewardFn label 
-> label 
-> QType

learning rate

-> QType

temperature

-> Int

iteration

-> A2CState dev 
-> A2CStepState dev 
-> ExceptT String IO (A2CState dev, Either (A2CStepState dev) QType, QType) 

runAccuracy :: forall (dev :: (DeviceType, Nat)) slc' label. IsValidDevice dev => Eval (Edges SPitch) [Edge SPitch] (Notes SPitch) slc' (Spread SPitch) (PVLeftmost SPitch) -> PVRewardFn label -> QModel dev -> (Path slc' [Edge SPitch], label) -> IO (Either String (QType, PVAnalysis SPitch)) Source #

data A2CLoopState (dev :: (DeviceType, Nat)) Source #

Instances

Instances details
Generic (A2CLoopState dev) Source # 
Instance details

Defined in RL.A2C

Associated Types

type Rep (A2CLoopState dev) 
Instance details

Defined in RL.A2C

type Rep (A2CLoopState dev) = D1 ('MetaData "A2CLoopState" "RL.A2C" "protovoices-rl-0.1.0.0-JjFFM1P77sPCI8QyjRIHUO" 'False) (C1 ('MetaCons "A2CLoopState" 'PrefixI 'True) ((S1 ('MetaSel ('Just "a2clState") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (A2CState dev)) :*: S1 ('MetaSel ('Just "a2clRewards") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (List (List QType)))) :*: (S1 ('MetaSel ('Just "a2clLosses") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (List (List QType))) :*: S1 ('MetaSel ('Just "a2clAccs") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (List (List QType))))))

Methods

from :: A2CLoopState dev -> Rep (A2CLoopState dev) x #

to :: Rep (A2CLoopState dev) x -> A2CLoopState dev #

type Rep (A2CLoopState dev) Source # 
Instance details

Defined in RL.A2C

type Rep (A2CLoopState dev) = D1 ('MetaData "A2CLoopState" "RL.A2C" "protovoices-rl-0.1.0.0-JjFFM1P77sPCI8QyjRIHUO" 'False) (C1 ('MetaCons "A2CLoopState" 'PrefixI 'True) ((S1 ('MetaSel ('Just "a2clState") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (A2CState dev)) :*: S1 ('MetaSel ('Just "a2clRewards") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (List (List QType)))) :*: (S1 ('MetaSel ('Just "a2clLosses") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (List (List QType))) :*: S1 ('MetaSel ('Just "a2clAccs") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (List (List QType))))))

trainA2C Source #

Arguments

:: forall (dev :: (DeviceType, Nat)) label. IsValidDevice dev 
=> Eval (Edges SPitch) [Edge SPitch] (Notes SPitch) [Note SPitch] (Spread SPitch) (PVLeftmost SPitch) 
-> IOGenM StdGen 
-> PVRewardFn label 
-> (QType -> QType)

learning rate schedule

-> (QType -> QType)

temperature schedule

-> Maybe [QType] 
-> QModel dev 
-> QModel dev 
-> [(Path [Note SPitch] [Edge SPitch], label)] 
-> Int 
-> IO ([[QType]], [QType], QModel dev, QModel dev) 

Orphan instances

NoThunks a => NoThunks (List a) Source # 
Instance details