protovoices-rl-0.1.0.0
Safe HaskellNone
LanguageGHC2021

RL.Model

Synopsis

Documentation

activation :: forall (dev :: (DeviceType, Nat)) (shape :: [Nat]). IsValidDevice dev => QTensor dev shape -> QTensor dev shape Source #

traceDyn :: forall (a :: (DeviceType, Nat)) (b :: DType) (c :: [Nat]). Tensor a b c -> Tensor a b c Source #

unsafeReshape :: forall (dev :: (DeviceType, Nat)) (dtype :: DType) (shape :: [Nat]) (shape' :: [Nat]). [Int] -> Tensor dev dtype shape -> Tensor dev dtype shape' Source #

data ConstEmbSpec (dev :: k) (shape :: [Nat]) Source #

Constructors

ConstEmbSpec 

Instances

Instances details
(IsValidDevice dev, TensorOptions shape QDType dev) => Randomizable (ConstEmbSpec dev shape) (ConstEmb dev shape) Source # 
Instance details

Defined in RL.Model

Methods

sample :: ConstEmbSpec dev shape -> IO (ConstEmb dev shape) #

newtype ConstEmb (dev :: (DeviceType, Nat)) (shape :: [Nat]) Source #

Constructors

ConstEmb (Parameter dev QDType shape) 

Instances

Instances details
NFData (ConstEmb dev shape) Source # 
Instance details

Defined in RL.Model

Methods

rnf :: ConstEmb dev shape -> () #

Generic (ConstEmb dev shape) Source # 
Instance details

Defined in RL.Model

Associated Types

type Rep (ConstEmb dev shape) 
Instance details

Defined in RL.Model

type Rep (ConstEmb dev shape) = D1 ('MetaData "ConstEmb" "RL.Model" "protovoices-rl-0.1.0.0-JjFFM1P77sPCI8QyjRIHUO" 'True) (C1 ('MetaCons "ConstEmb" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Parameter dev QDType shape))))

Methods

from :: ConstEmb dev shape -> Rep (ConstEmb dev shape) x #

to :: Rep (ConstEmb dev shape) x -> ConstEmb dev shape #

Show (ConstEmb dev shape) Source # 
Instance details

Defined in RL.Model

Methods

showsPrec :: Int -> ConstEmb dev shape -> ShowS #

show :: ConstEmb dev shape -> String #

showList :: [ConstEmb dev shape] -> ShowS #

Parameterized (ConstEmb dev shape) Source # 
Instance details

Defined in RL.Model

Associated Types

type Parameters (ConstEmb dev shape) 
Instance details

Defined in RL.Model

type Parameters (ConstEmb dev shape) = Parameters (Parameter dev QDType shape)

Methods

flattenParameters :: ConstEmb dev shape -> HList (Parameters (ConstEmb dev shape)) #

replaceParameters :: ConstEmb dev shape -> HList (Parameters (ConstEmb dev shape)) -> ConstEmb dev shape #

NoThunks (ConstEmb dev shape) Source # 
Instance details

Defined in RL.Model

Methods

noThunks :: Context -> ConstEmb dev shape -> IO (Maybe ThunkInfo) #

wNoThunks :: Context -> ConstEmb dev shape -> IO (Maybe ThunkInfo) #

showTypeOf :: Proxy (ConstEmb dev shape) -> String #

HasForward (ConstEmb dev size) () (QTensor dev size) Source # 
Instance details

Defined in RL.Model

Methods

forward :: ConstEmb dev size -> () -> QTensor dev size #

forwardStoch :: ConstEmb dev size -> () -> IO (QTensor dev size) #

(IsValidDevice dev, TensorOptions shape QDType dev) => Randomizable (ConstEmbSpec dev shape) (ConstEmb dev shape) Source # 
Instance details

Defined in RL.Model

Methods

sample :: ConstEmbSpec dev shape -> IO (ConstEmb dev shape) #

type Rep (ConstEmb dev shape) Source # 
Instance details

Defined in RL.Model

type Rep (ConstEmb dev shape) = D1 ('MetaData "ConstEmb" "RL.Model" "protovoices-rl-0.1.0.0-JjFFM1P77sPCI8QyjRIHUO" 'True) (C1 ('MetaCons "ConstEmb" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Parameter dev QDType shape))))
type Parameters (ConstEmb dev shape) Source # 
Instance details

Defined in RL.Model

type Parameters (ConstEmb dev shape) = Parameters (Parameter dev QDType shape)

data SliceSpec (dev :: k) Source #

Constructors

SliceSpec 

Instances

Instances details
IsValidDevice dev => Randomizable (SliceSpec dev) (SliceEncoder dev) Source # 
Instance details

Defined in RL.Model

Methods

sample :: SliceSpec dev -> IO (SliceEncoder dev) #

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

Instances

Instances details
NFData (SliceEncoder dev) Source # 
Instance details

Defined in RL.Model

Methods

rnf :: SliceEncoder dev -> () #

Generic (SliceEncoder dev) Source # 
Instance details

Defined in RL.Model

Associated Types

type Rep (SliceEncoder dev) 
Instance details

Defined in RL.Model

type Rep (SliceEncoder dev) = D1 ('MetaData "SliceEncoder" "RL.Model" "protovoices-rl-0.1.0.0-JjFFM1P77sPCI8QyjRIHUO" 'False) (C1 ('MetaCons "SliceEncoder" 'PrefixI 'True) ((S1 ('MetaSel ('Just "_slcL1") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (Conv2d 1 QSliceHidden 1 1 QDType dev)) :*: S1 ('MetaSel ('Just "_slcL2") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (Conv2d QSliceHidden EmbSize FifthSize OctaveSize QDType dev))) :*: (S1 ('MetaSel ('Just "_slcStart") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (ConstEmb dev EmbShape)) :*: S1 ('MetaSel ('Just "_slcStop") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (ConstEmb dev EmbShape)))))

Methods

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

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

Show (SliceEncoder dev) Source # 
Instance details

Defined in RL.Model

Parameterized (SliceEncoder dev) Source # 
Instance details

Defined in RL.Model

Associated Types

type Parameters (SliceEncoder dev) 
Instance details

Defined in RL.Model

NoThunks (SliceEncoder dev) Source # 
Instance details

Defined in RL.Model

(IsValidDevice dev, embshape ~ '[batchSize, EmbSize, FifthSize, OctaveSize]) => HasForward (SliceEncoder dev) (SliceEncoding dev '[batchSize]) (QTensor dev embshape) Source #

HasFoward for slice (batched)

Instance details

Defined in RL.Model

Methods

forward :: SliceEncoder dev -> SliceEncoding dev '[batchSize] -> QTensor dev embshape #

forwardStoch :: SliceEncoder dev -> SliceEncoding dev '[batchSize] -> IO (QTensor dev embshape) #

(embshape ~ EmbShape, IsValidDevice dev) => HasForward (SliceEncoder dev) (SliceEncoding dev ('[] :: [Nat])) (QTensor dev embshape) Source #

HasFoward for slice (unbatched)

Instance details

Defined in RL.Model

Methods

forward :: SliceEncoder dev -> SliceEncoding dev ('[] :: [Nat]) -> QTensor dev embshape #

forwardStoch :: SliceEncoder dev -> SliceEncoding dev ('[] :: [Nat]) -> IO (QTensor dev embshape) #

(IsValidDevice dev, outShape ~ (batchSize ': (EmbSize ': PShape)), 1 <= batchSize) => HasForward (ActionEncoder dev) (SliceEncoder dev, TransitionEncoder dev, ActionEncoding dev '[batchSize]) (QTensor dev outShape) Source #

HasForward for actions (batched)

Instance details

Defined in RL.Model

Methods

forward :: ActionEncoder dev -> (SliceEncoder dev, TransitionEncoder dev, ActionEncoding dev '[batchSize]) -> QTensor dev outShape #

forwardStoch :: ActionEncoder dev -> (SliceEncoder dev, TransitionEncoder dev, ActionEncoding dev '[batchSize]) -> IO (QTensor dev outShape) #

(IsValidDevice dev, embshape ~ (batchSize ': (EmbSize ': PShape))) => HasForward (SliceEncoder dev) (QStartStop dev '[batchSize] (SliceEncoding dev '[batchSize])) (QTensor dev embshape) Source #

HasForward for slice wrapped in QStartStop (batched).

Instance details

Defined in RL.Model

Methods

forward :: SliceEncoder dev -> QStartStop dev '[batchSize] (SliceEncoding dev '[batchSize]) -> QTensor dev embshape #

forwardStoch :: SliceEncoder dev -> QStartStop dev '[batchSize] (SliceEncoding dev '[batchSize]) -> IO (QTensor dev embshape) #

(embshape ~ EmbShape, IsValidDevice dev) => HasForward (SliceEncoder dev) (QStartStop dev ('[] :: [Nat]) (SliceEncoding dev ('[] :: [Nat]))) (QTensor dev embshape) Source #

HasForward for slice wrappend in QStartStop (unbatched).

Instance details

Defined in RL.Model

Methods

forward :: SliceEncoder dev -> QStartStop dev ('[] :: [Nat]) (SliceEncoding dev ('[] :: [Nat])) -> QTensor dev embshape #

forwardStoch :: SliceEncoder dev -> QStartStop dev ('[] :: [Nat]) (SliceEncoding dev ('[] :: [Nat])) -> IO (QTensor dev embshape) #

(IsValidDevice dev, outShape ~ (EmbSize ': PShape)) => HasForward (StateEncoder dev) (SliceEncoder dev, TransitionEncoder dev, StateEncoding dev) (QTensor dev outShape) Source #

HasForward for the parsing state (doesn't need batching)

Instance details

Defined in RL.Model

Methods

forward :: StateEncoder dev -> (SliceEncoder dev, TransitionEncoder dev, StateEncoding dev) -> QTensor dev outShape #

forwardStoch :: StateEncoder dev -> (SliceEncoder dev, TransitionEncoder dev, StateEncoding dev) -> IO (QTensor dev outShape) #

IsValidDevice dev => Randomizable (SliceSpec dev) (SliceEncoder dev) Source # 
Instance details

Defined in RL.Model

Methods

sample :: SliceSpec dev -> IO (SliceEncoder dev) #

type Rep (SliceEncoder dev) Source # 
Instance details

Defined in RL.Model

type Rep (SliceEncoder dev) = D1 ('MetaData "SliceEncoder" "RL.Model" "protovoices-rl-0.1.0.0-JjFFM1P77sPCI8QyjRIHUO" 'False) (C1 ('MetaCons "SliceEncoder" 'PrefixI 'True) ((S1 ('MetaSel ('Just "_slcL1") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (Conv2d 1 QSliceHidden 1 1 QDType dev)) :*: S1 ('MetaSel ('Just "_slcL2") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (Conv2d QSliceHidden EmbSize FifthSize OctaveSize QDType dev))) :*: (S1 ('MetaSel ('Just "_slcStart") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (ConstEmb dev EmbShape)) :*: S1 ('MetaSel ('Just "_slcStop") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (ConstEmb dev EmbShape)))))
type Parameters (SliceEncoder dev) Source # 
Instance details

Defined in RL.Model

data TransitionSpec (dev :: k) Source #

Constructors

TransitionSpec 

Instances

Instances details
IsValidDevice dev => Randomizable (TransitionSpec dev) (TransitionEncoder dev) Source # 
Instance details

Defined in RL.Model

Methods

sample :: TransitionSpec dev -> IO (TransitionEncoder dev) #

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

Instances

Instances details
NFData (TransitionEncoder dev) Source # 
Instance details

Defined in RL.Model

Methods

rnf :: TransitionEncoder dev -> () #

Generic (TransitionEncoder dev) Source # 
Instance details

Defined in RL.Model

Associated Types

type Rep (TransitionEncoder dev) 
Instance details

Defined in RL.Model

Show (TransitionEncoder dev) Source # 
Instance details

Defined in RL.Model

Parameterized (TransitionEncoder dev) Source # 
Instance details

Defined in RL.Model

Associated Types

type Parameters (TransitionEncoder dev) 
Instance details

Defined in RL.Model

NoThunks (TransitionEncoder dev) Source # 
Instance details

Defined in RL.Model

(IsValidDevice dev, embshape ~ (batchSize ': (EmbSize ': PShape))) => HasForward (TransitionEncoder dev) (TransitionEncoding dev '[batchSize]) (QTensor dev embshape) Source #

HasForward for transitions (batched)

Instance details

Defined in RL.Model

Methods

forward :: TransitionEncoder dev -> TransitionEncoding dev '[batchSize] -> QTensor dev embshape #

forwardStoch :: TransitionEncoder dev -> TransitionEncoding dev '[batchSize] -> IO (QTensor dev embshape) #

(IsValidDevice dev, embshape ~ (EmbSize ': PShape)) => HasForward (TransitionEncoder dev) (TransitionEncoding dev ('[] :: [Nat])) (QTensor dev embshape) Source #

HasForward for transitions (unbatched)

Instance details

Defined in RL.Model

Methods

forward :: TransitionEncoder dev -> TransitionEncoding dev ('[] :: [Nat]) -> QTensor dev embshape #

forwardStoch :: TransitionEncoder dev -> TransitionEncoding dev ('[] :: [Nat]) -> IO (QTensor dev embshape) #

(IsValidDevice dev, outShape ~ (batchSize ': (EmbSize ': PShape)), 1 <= batchSize) => HasForward (ActionEncoder dev) (SliceEncoder dev, TransitionEncoder dev, ActionEncoding dev '[batchSize]) (QTensor dev outShape) Source #

HasForward for actions (batched)

Instance details

Defined in RL.Model

Methods

forward :: ActionEncoder dev -> (SliceEncoder dev, TransitionEncoder dev, ActionEncoding dev '[batchSize]) -> QTensor dev outShape #

forwardStoch :: ActionEncoder dev -> (SliceEncoder dev, TransitionEncoder dev, ActionEncoding dev '[batchSize]) -> IO (QTensor dev outShape) #

(IsValidDevice dev, outShape ~ (EmbSize ': PShape)) => HasForward (StateEncoder dev) (SliceEncoder dev, TransitionEncoder dev, StateEncoding dev) (QTensor dev outShape) Source #

HasForward for the parsing state (doesn't need batching)

Instance details

Defined in RL.Model

Methods

forward :: StateEncoder dev -> (SliceEncoder dev, TransitionEncoder dev, StateEncoding dev) -> QTensor dev outShape #

forwardStoch :: StateEncoder dev -> (SliceEncoder dev, TransitionEncoder dev, StateEncoding dev) -> IO (QTensor dev outShape) #

IsValidDevice dev => Randomizable (TransitionSpec dev) (TransitionEncoder dev) Source # 
Instance details

Defined in RL.Model

Methods

sample :: TransitionSpec dev -> IO (TransitionEncoder dev) #

type Rep (TransitionEncoder dev) Source # 
Instance details

Defined in RL.Model

type Parameters (TransitionEncoder dev) Source # 
Instance details

Defined in RL.Model

data ActionSpec (dev :: k) Source #

Constructors

ActionSpec 

Instances

Instances details
IsValidDevice dev => Randomizable (ActionSpec dev) (ActionEncoder dev) Source # 
Instance details

Defined in RL.Model

Methods

sample :: ActionSpec dev -> IO (ActionEncoder dev) #

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

Instances

Instances details
NFData (ActionEncoder dev) Source # 
Instance details

Defined in RL.Model

Methods

rnf :: ActionEncoder dev -> () #

Generic (ActionEncoder dev) Source # 
Instance details

Defined in RL.Model

Associated Types

type Rep (ActionEncoder dev) 
Instance details

Defined in RL.Model

type Rep (ActionEncoder dev) = D1 ('MetaData "ActionEncoder" "RL.Model" "protovoices-rl-0.1.0.0-JjFFM1P77sPCI8QyjRIHUO" 'False) (C1 ('MetaCons "ActionEncoder" 'PrefixI 'True) (((S1 ('MetaSel ('Just "actTop1sl") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (Conv2d EmbSize QActionHidden FifthSize OctaveSize QDType dev)) :*: S1 ('MetaSel ('Just "actTop1sm") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (Conv2d EmbSize QActionHidden FifthSize OctaveSize QDType dev))) :*: (S1 ('MetaSel ('Just "actTop1sr") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (Conv2d EmbSize QActionHidden FifthSize OctaveSize QDType dev)) :*: S1 ('MetaSel ('Just "actTop1t1") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (Conv2d EmbSize QActionHidden FifthSize OctaveSize QDType dev)))) :*: ((S1 ('MetaSel ('Just "actTop1t2") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (Conv2d EmbSize QActionHidden FifthSize OctaveSize QDType dev)) :*: S1 ('MetaSel ('Just "actTop2") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (Conv2d QActionHidden EmbSize FifthSize OctaveSize QDType dev))) :*: (S1 ('MetaSel ('Just "actSplit") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (ConstEmb dev '[EmbSize - 3])) :*: (S1 ('MetaSel ('Just "actSpread") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (ConstEmb dev '[EmbSize - 3])) :*: S1 ('MetaSel ('Just "actFreeze") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (ConstEmb dev '[EmbSize - 3])))))))

Methods

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

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

Show (ActionEncoder dev) Source # 
Instance details

Defined in RL.Model

Parameterized (ActionEncoder dev) Source # 
Instance details

Defined in RL.Model

Associated Types

type Parameters (ActionEncoder dev) 
Instance details

Defined in RL.Model

NoThunks (ActionEncoder dev) Source # 
Instance details

Defined in RL.Model

(IsValidDevice dev, outShape ~ (batchSize ': (EmbSize ': PShape)), 1 <= batchSize) => HasForward (ActionEncoder dev) (SliceEncoder dev, TransitionEncoder dev, ActionEncoding dev '[batchSize]) (QTensor dev outShape) Source #

HasForward for actions (batched)

Instance details

Defined in RL.Model

Methods

forward :: ActionEncoder dev -> (SliceEncoder dev, TransitionEncoder dev, ActionEncoding dev '[batchSize]) -> QTensor dev outShape #

forwardStoch :: ActionEncoder dev -> (SliceEncoder dev, TransitionEncoder dev, ActionEncoding dev '[batchSize]) -> IO (QTensor dev outShape) #

IsValidDevice dev => Randomizable (ActionSpec dev) (ActionEncoder dev) Source # 
Instance details

Defined in RL.Model

Methods

sample :: ActionSpec dev -> IO (ActionEncoder dev) #

type Rep (ActionEncoder dev) Source # 
Instance details

Defined in RL.Model

type Rep (ActionEncoder dev) = D1 ('MetaData "ActionEncoder" "RL.Model" "protovoices-rl-0.1.0.0-JjFFM1P77sPCI8QyjRIHUO" 'False) (C1 ('MetaCons "ActionEncoder" 'PrefixI 'True) (((S1 ('MetaSel ('Just "actTop1sl") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (Conv2d EmbSize QActionHidden FifthSize OctaveSize QDType dev)) :*: S1 ('MetaSel ('Just "actTop1sm") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (Conv2d EmbSize QActionHidden FifthSize OctaveSize QDType dev))) :*: (S1 ('MetaSel ('Just "actTop1sr") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (Conv2d EmbSize QActionHidden FifthSize OctaveSize QDType dev)) :*: S1 ('MetaSel ('Just "actTop1t1") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (Conv2d EmbSize QActionHidden FifthSize OctaveSize QDType dev)))) :*: ((S1 ('MetaSel ('Just "actTop1t2") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (Conv2d EmbSize QActionHidden FifthSize OctaveSize QDType dev)) :*: S1 ('MetaSel ('Just "actTop2") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (Conv2d QActionHidden EmbSize FifthSize OctaveSize QDType dev))) :*: (S1 ('MetaSel ('Just "actSplit") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (ConstEmb dev '[EmbSize - 3])) :*: (S1 ('MetaSel ('Just "actSpread") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (ConstEmb dev '[EmbSize - 3])) :*: S1 ('MetaSel ('Just "actFreeze") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (ConstEmb dev '[EmbSize - 3])))))))
type Parameters (ActionEncoder dev) Source # 
Instance details

Defined in RL.Model

opTypes :: forall (dev :: (DeviceType, Nat)). KnownDevice dev => QTensor dev '[6, 3] Source #

data StateSpec (dev :: k) Source #

Constructors

StateSpec 

Instances

Instances details
IsValidDevice dev => Randomizable (StateSpec dev) (StateEncoder dev) Source # 
Instance details

Defined in RL.Model

Methods

sample :: StateSpec dev -> IO (StateEncoder dev) #

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

Instances

Instances details
NFData (StateEncoder dev) Source # 
Instance details

Defined in RL.Model

Methods

rnf :: StateEncoder dev -> () #

Generic (StateEncoder dev) Source # 
Instance details

Defined in RL.Model

Methods

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

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

Show (StateEncoder dev) Source # 
Instance details

Defined in RL.Model

Parameterized (StateEncoder dev) Source # 
Instance details

Defined in RL.Model

Associated Types

type Parameters (StateEncoder dev) 
Instance details

Defined in RL.Model

NoThunks (StateEncoder dev) Source # 
Instance details

Defined in RL.Model

(IsValidDevice dev, outShape ~ (EmbSize ': PShape)) => HasForward (StateEncoder dev) (SliceEncoder dev, TransitionEncoder dev, StateEncoding dev) (QTensor dev outShape) Source #

HasForward for the parsing state (doesn't need batching)

Instance details

Defined in RL.Model

Methods

forward :: StateEncoder dev -> (SliceEncoder dev, TransitionEncoder dev, StateEncoding dev) -> QTensor dev outShape #

forwardStoch :: StateEncoder dev -> (SliceEncoder dev, TransitionEncoder dev, StateEncoding dev) -> IO (QTensor dev outShape) #

IsValidDevice dev => Randomizable (StateSpec dev) (StateEncoder dev) Source # 
Instance details

Defined in RL.Model

Methods

sample :: StateSpec dev -> IO (StateEncoder dev) #

type Rep (StateEncoder dev) Source # 
Instance details

Defined in RL.Model

type Parameters (StateEncoder dev) Source # 
Instance details

Defined in RL.Model

data QSpec (dev :: k) Source #

Constructors

QSpec 

Instances

Instances details
IsValidDevice dev => Randomizable (QSpec dev) (QModel dev) Source # 
Instance details

Defined in RL.Model

Methods

sample :: QSpec dev -> IO (QModel dev) #

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

Instances

Instances details
NFData (QModel dev) Source # 
Instance details

Defined in RL.Model

Methods

rnf :: QModel dev -> () #

Generic (QModel dev) Source # 
Instance details

Defined in RL.Model

Associated Types

type Rep (QModel dev) 
Instance details

Defined in RL.Model

Methods

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

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

Show (QModel dev) Source # 
Instance details

Defined in RL.Model

Methods

showsPrec :: Int -> QModel dev -> ShowS #

show :: QModel dev -> String #

showList :: [QModel dev] -> ShowS #

Parameterized (QModel dev) Source # 
Instance details

Defined in RL.Model

Associated Types

type Parameters (QModel dev) 
Instance details

Defined in RL.Model

type Parameters (QModel dev) = GParameters (Rep (QModel dev))
NoThunks (QModel dev) Source # 
Instance details

Defined in RL.Model

(IsValidDevice dev, KnownNat batchSize, 1 <= batchSize, CheckIsSuffixOf '[QOutHidden] '[batchSize, QOutHidden] (QOutHidden == QOutHidden)) => HasForward (QModel dev) (QEncoding dev '[batchSize]) (QTensor dev '[batchSize, 1]) Source #

HasForward for model (batched)

Instance details

Defined in RL.Model

Methods

forward :: QModel dev -> QEncoding dev '[batchSize] -> QTensor dev '[batchSize, 1] #

forwardStoch :: QModel dev -> QEncoding dev '[batchSize] -> IO (QTensor dev '[batchSize, 1]) #

(IsValidDevice dev, CheckIsSuffixOf '[QOutHidden] '[1, QOutHidden] (QOutHidden == QOutHidden)) => HasForward (QModel dev) (QEncoding dev ('[] :: [Nat])) (QTensor dev '[1]) Source #

HasForward for model (unbatched)

Instance details

Defined in RL.Model

Methods

forward :: QModel dev -> QEncoding dev ('[] :: [Nat]) -> QTensor dev '[1] #

forwardStoch :: QModel dev -> QEncoding dev ('[] :: [Nat]) -> IO (QTensor dev '[1]) #

IsValidDevice dev => Randomizable (QSpec dev) (QModel dev) Source # 
Instance details

Defined in RL.Model

Methods

sample :: QSpec dev -> IO (QModel dev) #

type Rep (QModel dev) Source # 
Instance details

Defined in RL.Model

type Parameters (QModel dev) Source # 
Instance details

Defined in RL.Model

type Parameters (QModel dev) = GParameters (Rep (QModel dev))

forwardQModel :: forall (dev :: (DeviceType, Nat)). IsValidDevice dev => QModel dev -> QEncoding dev ('[] :: [Nat]) -> QTensor dev '[1] Source #

forwardQModelBatched :: forall (dev :: (DeviceType, Nat)) (batchSize :: Nat). (IsValidDevice dev, 1 <= batchSize) => QModel dev -> QEncoding dev '[batchSize] -> QTensor dev '[batchSize, 1] Source #

forwardValue :: forall (dev :: (DeviceType, Nat)). IsValidDevice dev => QModel dev -> StateEncoding dev -> QTensor dev '[1] Source #

fakeLoss :: forall (dev :: (DeviceType, Nat)) (ps :: [Type]). (IsValidDevice dev, ps ~ Parameters (QModel dev)) => QModel dev -> QTensor dev ('[] :: [Nat]) Source #

A loss for any model with 0 gradients everywhere. Can be used to ensure that all parameters have a gradient, if not all parameters are used in the real loss.

mkQModel :: forall (dev :: (DeviceType, Nat)). IsValidDevice dev => IO (QModel dev) Source #

loadModel :: forall (dev :: (DeviceType, Nat)). IsValidDevice dev => FilePath -> IO (QModel dev) Source #

saveModel :: forall (dev :: (DeviceType, Nat)). FilePath -> QModel dev -> IO () Source #

modelSize :: forall (dev :: (DeviceType, Nat)). QModel dev -> Int Source #

runQ :: forall (dev :: (DeviceType, Nat)) s a. IsValidDevice dev => (s -> a -> QEncoding dev ('[] :: [Nat])) -> QModel dev -> s -> a -> QType Source #

runQ' :: forall (dev :: (DeviceType, Nat)) s a. IsValidDevice dev => (s -> a -> QEncoding dev ('[] :: [Nat])) -> QModel dev -> s -> a -> QTensor dev '[1] Source #

runBatchedPolicy :: forall (dev :: (DeviceType, Nat)) (batchSize :: Nat). (IsValidDevice dev, KnownNat batchSize) => QModel dev -> QEncoding dev '[batchSize] -> Tensor Source #