protovoices-rl-0.1.0.0
Safe HaskellNone
LanguageGHC2021

RL.Encoding

Documentation

class Stackable a where Source #

Associated Types

type Stacked a (n :: Nat) Source #

Methods

stack :: forall (n :: Nat). (KnownNat n, KnownNat (1 + n)) => Vector (1 + n) a -> Stacked a (1 + n) Source #

Instances

Instances details
Stackable (ActionEncoding dev batchShape) Source # 
Instance details

Defined in RL.Encoding

Methods

stack :: forall (n :: Nat). (KnownNat n, KnownNat (1 + n)) => Vector (1 + n) (ActionEncoding dev batchShape) -> Stacked (ActionEncoding dev batchShape) (1 + n) Source #

Stackable (ActionTop dev batchShape) Source # 
Instance details

Defined in RL.Encoding

Methods

stack :: forall (n :: Nat). (KnownNat n, KnownNat (1 + n)) => Vector (1 + n) (ActionTop dev batchShape) -> Stacked (ActionTop dev batchShape) (1 + n) Source #

Stackable (SliceEncodingDense dev batchShape) Source # 
Instance details

Defined in RL.Encoding

Methods

stack :: forall (n :: Nat). (KnownNat n, KnownNat (1 + n)) => Vector (1 + n) (SliceEncodingDense dev batchShape) -> Stacked (SliceEncodingDense dev batchShape) (1 + n) Source #

Stackable (SliceEncodingSparse dev batchShape) Source # 
Instance details

Defined in RL.Encoding

Methods

stack :: forall (n :: Nat). (KnownNat n, KnownNat (1 + n)) => Vector (1 + n) (SliceEncodingSparse dev batchShape) -> Stacked (SliceEncodingSparse dev batchShape) (1 + n) Source #

Stackable (TransitionEncoding dev batchShape) Source # 
Instance details

Defined in RL.Encoding

Methods

stack :: forall (n :: Nat). (KnownNat n, KnownNat (1 + n)) => Vector (1 + n) (TransitionEncoding dev batchShape) -> Stacked (TransitionEncoding dev batchShape) (1 + n) Source #

Stackable a => Stackable (QMaybe dev batchShape a) Source # 
Instance details

Defined in RL.Encoding

Methods

stack :: forall (n :: Nat). (KnownNat n, KnownNat (1 + n)) => Vector (1 + n) (QMaybe dev batchShape a) -> Stacked (QMaybe dev batchShape a) (1 + n) Source #

Stackable a => Stackable (QStartStop dev batchShape a) Source # 
Instance details

Defined in RL.Encoding

Methods

stack :: forall (n :: Nat). (KnownNat n, KnownNat (1 + n)) => Vector (1 + n) (QStartStop dev batchShape a) -> Stacked (QStartStop dev batchShape a) (1 + n) Source #

Stackable (QBoundedList dev dtype maxLen batchShape innerShape) Source # 
Instance details

Defined in RL.Encoding

Methods

stack :: forall (n :: Nat). (KnownNat n, KnownNat (1 + n)) => Vector (1 + n) (QBoundedList dev dtype maxLen batchShape innerShape) -> Stacked (QBoundedList dev dtype maxLen batchShape innerShape) (1 + n) Source #

class Batchable a where Source #

Associated Types

type Batched a Source #

Methods

addBatchDim :: a -> Batched a Source #

Instances

Instances details
Batchable (ActionEncoding dev shape) Source # 
Instance details

Defined in RL.Encoding

Associated Types

type Batched (ActionEncoding dev shape) 
Instance details

Defined in RL.Encoding

type Batched (ActionEncoding dev shape) = ActionEncoding dev (1 ': shape)

Methods

addBatchDim :: ActionEncoding dev shape -> Batched (ActionEncoding dev shape) Source #

Batchable (ActionTop dev shape) Source # 
Instance details

Defined in RL.Encoding

Associated Types

type Batched (ActionTop dev shape) 
Instance details

Defined in RL.Encoding

type Batched (ActionTop dev shape) = ActionTop dev (1 ': shape)

Methods

addBatchDim :: ActionTop dev shape -> Batched (ActionTop dev shape) Source #

Batchable (QEncoding dev shape) Source # 
Instance details

Defined in RL.Encoding

Associated Types

type Batched (QEncoding dev shape) 
Instance details

Defined in RL.Encoding

type Batched (QEncoding dev shape) = QEncoding dev (1 ': shape)

Methods

addBatchDim :: QEncoding dev shape -> Batched (QEncoding dev shape) Source #

Batchable (SliceEncodingDense dev batchShape) Source # 
Instance details

Defined in RL.Encoding

Associated Types

type Batched (SliceEncodingDense dev batchShape) 
Instance details

Defined in RL.Encoding

type Batched (SliceEncodingDense dev batchShape) = SliceEncodingDense dev (1 ': batchShape)

Methods

addBatchDim :: SliceEncodingDense dev batchShape -> Batched (SliceEncodingDense dev batchShape) Source #

Batchable (SliceEncodingSparse dev shape) Source # 
Instance details

Defined in RL.Encoding

Associated Types

type Batched (SliceEncodingSparse dev shape) 
Instance details

Defined in RL.Encoding

type Batched (SliceEncodingSparse dev shape) = SliceEncodingSparse dev (1 ': shape)
Batchable (TransitionEncoding dev shape) Source # 
Instance details

Defined in RL.Encoding

Associated Types

type Batched (TransitionEncoding dev shape) 
Instance details

Defined in RL.Encoding

type Batched (TransitionEncoding dev shape) = TransitionEncoding dev (1 ': shape)
Batchable (Tensor dev dtype shape) Source # 
Instance details

Defined in RL.Encoding

Associated Types

type Batched (Tensor dev dtype shape) 
Instance details

Defined in RL.Encoding

type Batched (Tensor dev dtype shape) = Tensor dev dtype (1 ': shape)

Methods

addBatchDim :: Tensor dev dtype shape -> Batched (Tensor dev dtype shape) Source #

Batchable a => Batchable (QMaybe dev shape a) Source # 
Instance details

Defined in RL.Encoding

Associated Types

type Batched (QMaybe dev shape a) 
Instance details

Defined in RL.Encoding

type Batched (QMaybe dev shape a) = QMaybe dev (1 ': shape) (Batched a)

Methods

addBatchDim :: QMaybe dev shape a -> Batched (QMaybe dev shape a) Source #

Batchable a => Batchable (QStartStop dev shape a) Source # 
Instance details

Defined in RL.Encoding

Associated Types

type Batched (QStartStop dev shape a) 
Instance details

Defined in RL.Encoding

type Batched (QStartStop dev shape a) = QStartStop dev (1 ': shape) (Batched a)

Methods

addBatchDim :: QStartStop dev shape a -> Batched (QStartStop dev shape a) Source #

Batchable (QBoundedList dev dtype maxLen batchShape innerShape) Source # 
Instance details

Defined in RL.Encoding

Associated Types

type Batched (QBoundedList dev dtype maxLen batchShape innerShape) 
Instance details

Defined in RL.Encoding

type Batched (QBoundedList dev dtype maxLen batchShape innerShape) = QBoundedList dev dtype maxLen (1 ': batchShape) innerShape

Methods

addBatchDim :: QBoundedList dev dtype maxLen batchShape innerShape -> Batched (QBoundedList dev dtype maxLen batchShape innerShape) Source #

data QMaybe (dev :: (DeviceType, Nat)) (batchShape :: [Nat]) a Source #

Constructors

QMaybe 

Fields

Instances

Instances details
NFData a => NFData (QMaybe dev batchShape a) Source # 
Instance details

Defined in RL.Encoding

Methods

rnf :: QMaybe dev batchShape a -> () #

Generic (QMaybe dev batchShape a) Source # 
Instance details

Defined in RL.Encoding

Associated Types

type Rep (QMaybe dev batchShape a) 
Instance details

Defined in RL.Encoding

type Rep (QMaybe dev batchShape a) = D1 ('MetaData "QMaybe" "RL.Encoding" "protovoices-rl-0.1.0.0-JjFFM1P77sPCI8QyjRIHUO" 'False) (C1 ('MetaCons "QMaybe" 'PrefixI 'True) (S1 ('MetaSel ('Just "qmMask") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (QTensor dev batchShape)) :*: S1 ('MetaSel ('Just "qmContent") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 a)))

Methods

from :: QMaybe dev batchShape a -> Rep (QMaybe dev batchShape a) x #

to :: Rep (QMaybe dev batchShape a) x -> QMaybe dev batchShape a #

Show a => Show (QMaybe dev batchShape a) Source # 
Instance details

Defined in RL.Encoding

Methods

showsPrec :: Int -> QMaybe dev batchShape a -> ShowS #

show :: QMaybe dev batchShape a -> String #

showList :: [QMaybe dev batchShape a] -> ShowS #

Batchable a => Batchable (QMaybe dev shape a) Source # 
Instance details

Defined in RL.Encoding

Associated Types

type Batched (QMaybe dev shape a) 
Instance details

Defined in RL.Encoding

type Batched (QMaybe dev shape a) = QMaybe dev (1 ': shape) (Batched a)

Methods

addBatchDim :: QMaybe dev shape a -> Batched (QMaybe dev shape a) Source #

Stackable a => Stackable (QMaybe dev batchShape a) Source # 
Instance details

Defined in RL.Encoding

Methods

stack :: forall (n :: Nat). (KnownNat n, KnownNat (1 + n)) => Vector (1 + n) (QMaybe dev batchShape a) -> Stacked (QMaybe dev batchShape a) (1 + n) Source #

type Rep (QMaybe dev batchShape a) Source # 
Instance details

Defined in RL.Encoding

type Rep (QMaybe dev batchShape a) = D1 ('MetaData "QMaybe" "RL.Encoding" "protovoices-rl-0.1.0.0-JjFFM1P77sPCI8QyjRIHUO" 'False) (C1 ('MetaCons "QMaybe" 'PrefixI 'True) (S1 ('MetaSel ('Just "qmMask") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (QTensor dev batchShape)) :*: S1 ('MetaSel ('Just "qmContent") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 a)))
type Batched (QMaybe dev shape a) Source # 
Instance details

Defined in RL.Encoding

type Batched (QMaybe dev shape a) = QMaybe dev (1 ': shape) (Batched a)
type Stacked (QMaybe dev batchShape a) n Source # 
Instance details

Defined in RL.Encoding

type Stacked (QMaybe dev batchShape a) n = QMaybe dev (n ': batchShape) (Stacked a n)

qNothing :: forall (batchShape :: [Nat]) (dev :: (DeviceType, Nat)) a. TensorOptions batchShape QDType dev => a -> QMaybe dev batchShape a Source #

qJust :: forall (batchShape :: [Nat]) (dev :: (DeviceType, Nat)) a. TensorOptions batchShape QDType dev => a -> QMaybe dev batchShape a Source #

data QBoundedList (dev :: (DeviceType, Nat)) (dtype :: DType) (maxLen :: Nat) (batchShape :: [Nat]) (innerShape :: [Nat]) Source #

Constructors

QBoundedList 

Fields

Instances

Instances details
NFData (QBoundedList dev dtype maxLen batchShape innerShape) Source # 
Instance details

Defined in RL.Encoding

Methods

rnf :: QBoundedList dev dtype maxLen batchShape innerShape -> () #

Generic (QBoundedList dev dtype maxLen batchShape innerShape) Source # 
Instance details

Defined in RL.Encoding

Associated Types

type Rep (QBoundedList dev dtype maxLen batchShape innerShape) 
Instance details

Defined in RL.Encoding

type Rep (QBoundedList dev dtype maxLen batchShape innerShape) = D1 ('MetaData "QBoundedList" "RL.Encoding" "protovoices-rl-0.1.0.0-JjFFM1P77sPCI8QyjRIHUO" 'False) (C1 ('MetaCons "QBoundedList" 'PrefixI 'True) (S1 ('MetaSel ('Just "qlMask") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (QTensor dev (batchShape ++ '[maxLen]))) :*: S1 ('MetaSel ('Just "qlContent") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Tensor dev dtype ((batchShape ++ '[maxLen]) ++ innerShape)))))

Methods

from :: QBoundedList dev dtype maxLen batchShape innerShape -> Rep (QBoundedList dev dtype maxLen batchShape innerShape) x #

to :: Rep (QBoundedList dev dtype maxLen batchShape innerShape) x -> QBoundedList dev dtype maxLen batchShape innerShape #

Show (QBoundedList dev dtype maxLen batchShape innerShape) Source # 
Instance details

Defined in RL.Encoding

Methods

showsPrec :: Int -> QBoundedList dev dtype maxLen batchShape innerShape -> ShowS #

show :: QBoundedList dev dtype maxLen batchShape innerShape -> String #

showList :: [QBoundedList dev dtype maxLen batchShape innerShape] -> ShowS #

Batchable (QBoundedList dev dtype maxLen batchShape innerShape) Source # 
Instance details

Defined in RL.Encoding

Associated Types

type Batched (QBoundedList dev dtype maxLen batchShape innerShape) 
Instance details

Defined in RL.Encoding

type Batched (QBoundedList dev dtype maxLen batchShape innerShape) = QBoundedList dev dtype maxLen (1 ': batchShape) innerShape

Methods

addBatchDim :: QBoundedList dev dtype maxLen batchShape innerShape -> Batched (QBoundedList dev dtype maxLen batchShape innerShape) Source #

Stackable (QBoundedList dev dtype maxLen batchShape innerShape) Source # 
Instance details

Defined in RL.Encoding

Methods

stack :: forall (n :: Nat). (KnownNat n, KnownNat (1 + n)) => Vector (1 + n) (QBoundedList dev dtype maxLen batchShape innerShape) -> Stacked (QBoundedList dev dtype maxLen batchShape innerShape) (1 + n) Source #

type Rep (QBoundedList dev dtype maxLen batchShape innerShape) Source # 
Instance details

Defined in RL.Encoding

type Rep (QBoundedList dev dtype maxLen batchShape innerShape) = D1 ('MetaData "QBoundedList" "RL.Encoding" "protovoices-rl-0.1.0.0-JjFFM1P77sPCI8QyjRIHUO" 'False) (C1 ('MetaCons "QBoundedList" 'PrefixI 'True) (S1 ('MetaSel ('Just "qlMask") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (QTensor dev (batchShape ++ '[maxLen]))) :*: S1 ('MetaSel ('Just "qlContent") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Tensor dev dtype ((batchShape ++ '[maxLen]) ++ innerShape)))))
type Batched (QBoundedList dev dtype maxLen batchShape innerShape) Source # 
Instance details

Defined in RL.Encoding

type Batched (QBoundedList dev dtype maxLen batchShape innerShape) = QBoundedList dev dtype maxLen (1 ': batchShape) innerShape
type Stacked (QBoundedList dev dtype maxLen batchShape innerShape) n Source # 
Instance details

Defined in RL.Encoding

type Stacked (QBoundedList dev dtype maxLen batchShape innerShape) n = QBoundedList dev dtype maxLen (n ': batchShape) innerShape

qBoundedList :: forall (dev :: (DeviceType, Nat)) (dtype :: DType) (maxLen :: Nat) (innerShape :: [Nat]). (KnownNat maxLen, KnownDevice dev, KnownShape innerShape, TensorOptions innerShape QDType dev, TensorOptions innerShape dtype dev) => [Tensor dev dtype innerShape] -> QBoundedList dev dtype maxLen ('[] :: [Nat]) innerShape Source #

data QStartStop (dev :: (DeviceType, Nat)) (batchShape :: [Nat]) a Source #

Constructors

QStartStop 

Fields

Instances

Instances details
(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) #

NFData a => NFData (QStartStop dev batchShape a) Source # 
Instance details

Defined in RL.Encoding

Methods

rnf :: QStartStop dev batchShape a -> () #

Generic (QStartStop dev batchShape a) Source # 
Instance details

Defined in RL.Encoding

Associated Types

type Rep (QStartStop dev batchShape a) 
Instance details

Defined in RL.Encoding

type Rep (QStartStop dev batchShape a) = D1 ('MetaData "QStartStop" "RL.Encoding" "protovoices-rl-0.1.0.0-JjFFM1P77sPCI8QyjRIHUO" 'False) (C1 ('MetaCons "QStartStop" 'PrefixI 'True) (S1 ('MetaSel ('Just "qssTag") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Tensor dev 'Int64 batchShape)) :*: S1 ('MetaSel ('Just "qssContent") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 a)))

Methods

from :: QStartStop dev batchShape a -> Rep (QStartStop dev batchShape a) x #

to :: Rep (QStartStop dev batchShape a) x -> QStartStop dev batchShape a #

Show a => Show (QStartStop dev batchShape a) Source # 
Instance details

Defined in RL.Encoding

Methods

showsPrec :: Int -> QStartStop dev batchShape a -> ShowS #

show :: QStartStop dev batchShape a -> String #

showList :: [QStartStop dev batchShape a] -> ShowS #

Batchable a => Batchable (QStartStop dev shape a) Source # 
Instance details

Defined in RL.Encoding

Associated Types

type Batched (QStartStop dev shape a) 
Instance details

Defined in RL.Encoding

type Batched (QStartStop dev shape a) = QStartStop dev (1 ': shape) (Batched a)

Methods

addBatchDim :: QStartStop dev shape a -> Batched (QStartStop dev shape a) Source #

Stackable a => Stackable (QStartStop dev batchShape a) Source # 
Instance details

Defined in RL.Encoding

Methods

stack :: forall (n :: Nat). (KnownNat n, KnownNat (1 + n)) => Vector (1 + n) (QStartStop dev batchShape a) -> Stacked (QStartStop dev batchShape a) (1 + n) Source #

type Rep (QStartStop dev batchShape a) Source # 
Instance details

Defined in RL.Encoding

type Rep (QStartStop dev batchShape a) = D1 ('MetaData "QStartStop" "RL.Encoding" "protovoices-rl-0.1.0.0-JjFFM1P77sPCI8QyjRIHUO" 'False) (C1 ('MetaCons "QStartStop" 'PrefixI 'True) (S1 ('MetaSel ('Just "qssTag") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Tensor dev 'Int64 batchShape)) :*: S1 ('MetaSel ('Just "qssContent") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 a)))
type Batched (QStartStop dev shape a) Source # 
Instance details

Defined in RL.Encoding

type Batched (QStartStop dev shape a) = QStartStop dev (1 ': shape) (Batched a)
type Stacked (QStartStop dev batchShape a) n Source # 
Instance details

Defined in RL.Encoding

type Stacked (QStartStop dev batchShape a) n = QStartStop dev (n ': batchShape) (Stacked a n)

qInner :: forall (batchShape :: [Nat]) (dev :: (DeviceType, Nat)) a. TensorOptions batchShape 'Int64 dev => a -> QStartStop dev batchShape a Source #

qStart :: forall (batchShape :: [Nat]) (dev :: (DeviceType, Nat)) a. TensorOptions batchShape 'Int64 dev => a -> QStartStop dev batchShape a Source #

qStop :: forall (batchShape :: [Nat]) (dev :: (DeviceType, Nat)) a. TensorOptions batchShape 'Int64 dev => a -> QStartStop dev batchShape a Source #

qStartStop :: forall (batchShape :: [Nat]) (dev :: (DeviceType, Nat)) a b. TensorOptions batchShape 'Int64 dev => (a -> b) -> b -> StartStop a -> QStartStop dev batchShape b Source #

newtype SliceEncodingSparse (dev :: (DeviceType, Nat)) (batchShape :: [Nat]) Source #

Constructors

SliceEncodingSparse 

Fields

Instances

Instances details
NFData (SliceEncodingSparse dev batchShape) Source # 
Instance details

Defined in RL.Encoding

Methods

rnf :: SliceEncodingSparse dev batchShape -> () #

Generic (SliceEncodingSparse dev batchShape) Source # 
Instance details

Defined in RL.Encoding

Associated Types

type Rep (SliceEncodingSparse dev batchShape) 
Instance details

Defined in RL.Encoding

type Rep (SliceEncodingSparse dev batchShape) = D1 ('MetaData "SliceEncodingSparse" "RL.Encoding" "protovoices-rl-0.1.0.0-JjFFM1P77sPCI8QyjRIHUO" 'True) (C1 ('MetaCons "SliceEncodingSparse" 'PrefixI 'True) (S1 ('MetaSel ('Just "getSliceEncodingSparse") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (QBoundedList dev 'Int64 MaxPitches batchShape '[2]))))

Methods

from :: SliceEncodingSparse dev batchShape -> Rep (SliceEncodingSparse dev batchShape) x #

to :: Rep (SliceEncodingSparse dev batchShape) x -> SliceEncodingSparse dev batchShape #

Show (SliceEncodingSparse dev batchShape) Source # 
Instance details

Defined in RL.Encoding

Methods

showsPrec :: Int -> SliceEncodingSparse dev batchShape -> ShowS #

show :: SliceEncodingSparse dev batchShape -> String #

showList :: [SliceEncodingSparse dev batchShape] -> ShowS #

Batchable (SliceEncodingSparse dev shape) Source # 
Instance details

Defined in RL.Encoding

Associated Types

type Batched (SliceEncodingSparse dev shape) 
Instance details

Defined in RL.Encoding

type Batched (SliceEncodingSparse dev shape) = SliceEncodingSparse dev (1 ': shape)
Stackable (SliceEncodingSparse dev batchShape) Source # 
Instance details

Defined in RL.Encoding

Methods

stack :: forall (n :: Nat). (KnownNat n, KnownNat (1 + n)) => Vector (1 + n) (SliceEncodingSparse dev batchShape) -> Stacked (SliceEncodingSparse dev batchShape) (1 + n) Source #

type Rep (SliceEncodingSparse dev batchShape) Source # 
Instance details

Defined in RL.Encoding

type Rep (SliceEncodingSparse dev batchShape) = D1 ('MetaData "SliceEncodingSparse" "RL.Encoding" "protovoices-rl-0.1.0.0-JjFFM1P77sPCI8QyjRIHUO" 'True) (C1 ('MetaCons "SliceEncodingSparse" 'PrefixI 'True) (S1 ('MetaSel ('Just "getSliceEncodingSparse") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (QBoundedList dev 'Int64 MaxPitches batchShape '[2]))))
type Batched (SliceEncodingSparse dev shape) Source # 
Instance details

Defined in RL.Encoding

type Batched (SliceEncodingSparse dev shape) = SliceEncodingSparse dev (1 ': shape)
type Stacked (SliceEncodingSparse dev batchShape) n Source # 
Instance details

Defined in RL.Encoding

type Stacked (SliceEncodingSparse dev batchShape) n = SliceEncodingSparse dev (n ': batchShape)

newtype SliceEncodingDense (dev :: (DeviceType, Nat)) (batchShape :: [Nat]) Source #

Constructors

SliceEncodingDense 

Fields

Instances

Instances details
(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, 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) #

NFData (SliceEncodingDense dev batchShape) Source # 
Instance details

Defined in RL.Encoding

Methods

rnf :: SliceEncodingDense dev batchShape -> () #

Generic (SliceEncodingDense dev batchShape) Source # 
Instance details

Defined in RL.Encoding

Associated Types

type Rep (SliceEncodingDense dev batchShape) 
Instance details

Defined in RL.Encoding

type Rep (SliceEncodingDense dev batchShape) = D1 ('MetaData "SliceEncodingDense" "RL.Encoding" "protovoices-rl-0.1.0.0-JjFFM1P77sPCI8QyjRIHUO" 'True) (C1 ('MetaCons "SliceEncodingDense" 'PrefixI 'True) (S1 ('MetaSel ('Just "getSliceEncodingDense") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (QTensor dev (batchShape ++ PShape)))))

Methods

from :: SliceEncodingDense dev batchShape -> Rep (SliceEncodingDense dev batchShape) x #

to :: Rep (SliceEncodingDense dev batchShape) x -> SliceEncodingDense dev batchShape #

Show (SliceEncodingDense dev batchShape) Source # 
Instance details

Defined in RL.Encoding

Methods

showsPrec :: Int -> SliceEncodingDense dev batchShape -> ShowS #

show :: SliceEncodingDense dev batchShape -> String #

showList :: [SliceEncodingDense dev batchShape] -> ShowS #

Batchable (SliceEncodingDense dev batchShape) Source # 
Instance details

Defined in RL.Encoding

Associated Types

type Batched (SliceEncodingDense dev batchShape) 
Instance details

Defined in RL.Encoding

type Batched (SliceEncodingDense dev batchShape) = SliceEncodingDense dev (1 ': batchShape)

Methods

addBatchDim :: SliceEncodingDense dev batchShape -> Batched (SliceEncodingDense dev batchShape) Source #

Stackable (SliceEncodingDense dev batchShape) Source # 
Instance details

Defined in RL.Encoding

Methods

stack :: forall (n :: Nat). (KnownNat n, KnownNat (1 + n)) => Vector (1 + n) (SliceEncodingDense dev batchShape) -> Stacked (SliceEncodingDense dev batchShape) (1 + n) Source #

type Rep (SliceEncodingDense dev batchShape) Source # 
Instance details

Defined in RL.Encoding

type Rep (SliceEncodingDense dev batchShape) = D1 ('MetaData "SliceEncodingDense" "RL.Encoding" "protovoices-rl-0.1.0.0-JjFFM1P77sPCI8QyjRIHUO" 'True) (C1 ('MetaCons "SliceEncodingDense" 'PrefixI 'True) (S1 ('MetaSel ('Just "getSliceEncodingDense") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (QTensor dev (batchShape ++ PShape)))))
type Batched (SliceEncodingDense dev batchShape) Source # 
Instance details

Defined in RL.Encoding

type Batched (SliceEncodingDense dev batchShape) = SliceEncodingDense dev (1 ': batchShape)
type Stacked (SliceEncodingDense dev batchShape) n Source # 
Instance details

Defined in RL.Encoding

type Stacked (SliceEncodingDense dev batchShape) n = SliceEncodingDense dev (n ': batchShape)

getSlice :: forall (dev :: (DeviceType, Nat)) (batchShape :: [Nat]). SliceEncoding dev batchShape -> QTensor dev (batchShape ++ PShape) Source #

encodePitches :: forall (dev :: (DeviceType, Nat)). KnownDevice dev => [SPitch] -> SliceEncoding dev ('[] :: [Nat]) Source #

pitchesOneHotSum :: forall (dev :: (DeviceType, Nat)). KnownDevice dev => [SPitch] -> SliceEncodingDense dev ('[] :: [Nat]) Source #

pitchesOneHots :: forall (dev :: (DeviceType, Nat)). KnownDevice dev => [SPitch] -> QBoundedList dev QDType MaxPitches ('[] :: [Nat]) (1 ': PShape) Source #

pitchesTokens :: forall (dev :: (DeviceType, Nat)). KnownDevice dev => [SPitch] -> QBoundedList dev QDType MaxPitches ('[] :: [Nat]) '[PSize] Source #

pitchesIndices :: forall (dev :: (DeviceType, Nat)). KnownDevice dev => [SPitch] -> SliceEncodingSparse dev ('[] :: [Nat]) Source #

encodeSlice :: forall (dev :: (DeviceType, Nat)). KnownDevice dev => Notes SPitch -> SliceEncoding dev ('[] :: [Nat]) Source #

emptySlice :: forall (dev :: (DeviceType, Nat)). KnownDevice dev => SliceEncoding dev ('[] :: [Nat]) Source #

data TransitionEncoding (dev :: (DeviceType, Nat)) (batchShape :: [Nat]) Source #

Constructors

TransitionEncoding 

Fields

Instances

Instances details
(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) #

NFData (TransitionEncoding dev batchShape) Source # 
Instance details

Defined in RL.Encoding

Methods

rnf :: TransitionEncoding dev batchShape -> () #

Generic (TransitionEncoding dev batchShape) Source # 
Instance details

Defined in RL.Encoding

Associated Types

type Rep (TransitionEncoding dev batchShape) 
Instance details

Defined in RL.Encoding

type Rep (TransitionEncoding dev batchShape) = D1 ('MetaData "TransitionEncoding" "RL.Encoding" "protovoices-rl-0.1.0.0-JjFFM1P77sPCI8QyjRIHUO" 'False) (C1 ('MetaCons "TransitionEncoding" 'PrefixI 'True) ((S1 ('MetaSel ('Just "trencPassing") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (QBoundedList dev QDType MaxEdges batchShape (2 ': PShape))) :*: S1 ('MetaSel ('Just "trencInner") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (QBoundedList dev QDType MaxEdges batchShape (2 ': PShape)))) :*: (S1 ('MetaSel ('Just "trencLeft") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (SliceEncoding dev batchShape)) :*: (S1 ('MetaSel ('Just "trencRight") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (SliceEncoding dev batchShape)) :*: S1 ('MetaSel ('Just "trencRoot") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (QTensor dev batchShape))))))

Methods

from :: TransitionEncoding dev batchShape -> Rep (TransitionEncoding dev batchShape) x #

to :: Rep (TransitionEncoding dev batchShape) x -> TransitionEncoding dev batchShape #

Show (TransitionEncoding dev batchShape) Source # 
Instance details

Defined in RL.Encoding

Methods

showsPrec :: Int -> TransitionEncoding dev batchShape -> ShowS #

show :: TransitionEncoding dev batchShape -> String #

showList :: [TransitionEncoding dev batchShape] -> ShowS #

Batchable (TransitionEncoding dev shape) Source # 
Instance details

Defined in RL.Encoding

Associated Types

type Batched (TransitionEncoding dev shape) 
Instance details

Defined in RL.Encoding

type Batched (TransitionEncoding dev shape) = TransitionEncoding dev (1 ': shape)
Stackable (TransitionEncoding dev batchShape) Source # 
Instance details

Defined in RL.Encoding

Methods

stack :: forall (n :: Nat). (KnownNat n, KnownNat (1 + n)) => Vector (1 + n) (TransitionEncoding dev batchShape) -> Stacked (TransitionEncoding dev batchShape) (1 + n) Source #

type Rep (TransitionEncoding dev batchShape) Source # 
Instance details

Defined in RL.Encoding

type Rep (TransitionEncoding dev batchShape) = D1 ('MetaData "TransitionEncoding" "RL.Encoding" "protovoices-rl-0.1.0.0-JjFFM1P77sPCI8QyjRIHUO" 'False) (C1 ('MetaCons "TransitionEncoding" 'PrefixI 'True) ((S1 ('MetaSel ('Just "trencPassing") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (QBoundedList dev QDType MaxEdges batchShape (2 ': PShape))) :*: S1 ('MetaSel ('Just "trencInner") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (QBoundedList dev QDType MaxEdges batchShape (2 ': PShape)))) :*: (S1 ('MetaSel ('Just "trencLeft") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (SliceEncoding dev batchShape)) :*: (S1 ('MetaSel ('Just "trencRight") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (SliceEncoding dev batchShape)) :*: S1 ('MetaSel ('Just "trencRoot") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (QTensor dev batchShape))))))
type Batched (TransitionEncoding dev shape) Source # 
Instance details

Defined in RL.Encoding

type Batched (TransitionEncoding dev shape) = TransitionEncoding dev (1 ': shape)
type Stacked (TransitionEncoding dev batchShape) n Source # 
Instance details

Defined in RL.Encoding

type Stacked (TransitionEncoding dev batchShape) n = TransitionEncoding dev (n ': batchShape)

edgesOneHots :: forall (dev :: (DeviceType, Nat)). KnownDevice dev => [InnerEdge SPitch] -> QBoundedList dev QDType MaxEdges ('[] :: [Nat]) (2 ': PShape) Source #

edgesTokens :: forall (dev :: (DeviceType, Nat)). KnownDevice dev => [InnerEdge SPitch] -> QBoundedList dev QDType MaxEdges ('[] :: [Nat]) '[ESize] Source #

encodeTransition :: forall (dev :: (DeviceType, Nat)). KnownDevice dev => Edges SPitch -> TransitionEncoding dev ('[] :: [Nat]) Source #

emptyTransition :: forall (dev :: (DeviceType, Nat)). KnownDevice dev => TransitionEncoding dev ('[] :: [Nat]) Source #

data ActionTop (dev :: (DeviceType, Nat)) (batchShape :: [Nat]) Source #

Constructors

ActionTop 

Fields

Instances

Instances details
NFData (ActionTop dev batchShape) Source # 
Instance details

Defined in RL.Encoding

Methods

rnf :: ActionTop dev batchShape -> () #

Generic (ActionTop dev batchShape) Source # 
Instance details

Defined in RL.Encoding

Associated Types

type Rep (ActionTop dev batchShape) 
Instance details

Defined in RL.Encoding

type Rep (ActionTop dev batchShape) = D1 ('MetaData "ActionTop" "RL.Encoding" "protovoices-rl-0.1.0.0-JjFFM1P77sPCI8QyjRIHUO" 'False) (C1 ('MetaCons "ActionTop" 'PrefixI 'True) ((S1 ('MetaSel ('Just "atopSl") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (QStartStop dev batchShape (SliceEncoding dev batchShape))) :*: S1 ('MetaSel ('Just "atopT1") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (TransitionEncoding dev batchShape))) :*: (S1 ('MetaSel ('Just "atopSm") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (QMaybe dev batchShape (SliceEncoding dev batchShape))) :*: (S1 ('MetaSel ('Just "atopT2") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (QMaybe dev batchShape (TransitionEncoding dev batchShape))) :*: S1 ('MetaSel ('Just "atopSr") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (QStartStop dev batchShape (SliceEncoding dev batchShape)))))))

Methods

from :: ActionTop dev batchShape -> Rep (ActionTop dev batchShape) x #

to :: Rep (ActionTop dev batchShape) x -> ActionTop dev batchShape #

Show (ActionTop dev batchShape) Source # 
Instance details

Defined in RL.Encoding

Methods

showsPrec :: Int -> ActionTop dev batchShape -> ShowS #

show :: ActionTop dev batchShape -> String #

showList :: [ActionTop dev batchShape] -> ShowS #

Batchable (ActionTop dev shape) Source # 
Instance details

Defined in RL.Encoding

Associated Types

type Batched (ActionTop dev shape) 
Instance details

Defined in RL.Encoding

type Batched (ActionTop dev shape) = ActionTop dev (1 ': shape)

Methods

addBatchDim :: ActionTop dev shape -> Batched (ActionTop dev shape) Source #

Stackable (ActionTop dev batchShape) Source # 
Instance details

Defined in RL.Encoding

Methods

stack :: forall (n :: Nat). (KnownNat n, KnownNat (1 + n)) => Vector (1 + n) (ActionTop dev batchShape) -> Stacked (ActionTop dev batchShape) (1 + n) Source #

type Rep (ActionTop dev batchShape) Source # 
Instance details

Defined in RL.Encoding

type Rep (ActionTop dev batchShape) = D1 ('MetaData "ActionTop" "RL.Encoding" "protovoices-rl-0.1.0.0-JjFFM1P77sPCI8QyjRIHUO" 'False) (C1 ('MetaCons "ActionTop" 'PrefixI 'True) ((S1 ('MetaSel ('Just "atopSl") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (QStartStop dev batchShape (SliceEncoding dev batchShape))) :*: S1 ('MetaSel ('Just "atopT1") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (TransitionEncoding dev batchShape))) :*: (S1 ('MetaSel ('Just "atopSm") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (QMaybe dev batchShape (SliceEncoding dev batchShape))) :*: (S1 ('MetaSel ('Just "atopT2") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (QMaybe dev batchShape (TransitionEncoding dev batchShape))) :*: S1 ('MetaSel ('Just "atopSr") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (QStartStop dev batchShape (SliceEncoding dev batchShape)))))))
type Batched (ActionTop dev shape) Source # 
Instance details

Defined in RL.Encoding

type Batched (ActionTop dev shape) = ActionTop dev (1 ': shape)
type Stacked (ActionTop dev batchShape) n Source # 
Instance details

Defined in RL.Encoding

type Stacked (ActionTop dev batchShape) n = ActionTop dev (n ': batchShape)

data ActionEncoding (dev :: (DeviceType, Nat)) (batchShape :: [Nat]) Source #

Constructors

ActionEncoding 

Fields

Instances

Instances details
(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) #

NFData (ActionEncoding dev batchShape) Source # 
Instance details

Defined in RL.Encoding

Methods

rnf :: ActionEncoding dev batchShape -> () #

Generic (ActionEncoding dev batchShape) Source # 
Instance details

Defined in RL.Encoding

Associated Types

type Rep (ActionEncoding dev batchShape) 
Instance details

Defined in RL.Encoding

type Rep (ActionEncoding dev batchShape) = D1 ('MetaData "ActionEncoding" "RL.Encoding" "protovoices-rl-0.1.0.0-JjFFM1P77sPCI8QyjRIHUO" 'False) (C1 ('MetaCons "ActionEncoding" 'PrefixI 'True) (S1 ('MetaSel ('Just "actionEncodingTop") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (ActionTop dev batchShape)) :*: S1 ('MetaSel ('Just "actionEncodingOp") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (Tensor dev 'Int64 batchShape))))

Methods

from :: ActionEncoding dev batchShape -> Rep (ActionEncoding dev batchShape) x #

to :: Rep (ActionEncoding dev batchShape) x -> ActionEncoding dev batchShape #

Show (ActionEncoding dev batchShape) Source # 
Instance details

Defined in RL.Encoding

Methods

showsPrec :: Int -> ActionEncoding dev batchShape -> ShowS #

show :: ActionEncoding dev batchShape -> String #

showList :: [ActionEncoding dev batchShape] -> ShowS #

Batchable (ActionEncoding dev shape) Source # 
Instance details

Defined in RL.Encoding

Associated Types

type Batched (ActionEncoding dev shape) 
Instance details

Defined in RL.Encoding

type Batched (ActionEncoding dev shape) = ActionEncoding dev (1 ': shape)

Methods

addBatchDim :: ActionEncoding dev shape -> Batched (ActionEncoding dev shape) Source #

Stackable (ActionEncoding dev batchShape) Source # 
Instance details

Defined in RL.Encoding

Methods

stack :: forall (n :: Nat). (KnownNat n, KnownNat (1 + n)) => Vector (1 + n) (ActionEncoding dev batchShape) -> Stacked (ActionEncoding dev batchShape) (1 + n) Source #

type Rep (ActionEncoding dev batchShape) Source # 
Instance details

Defined in RL.Encoding

type Rep (ActionEncoding dev batchShape) = D1 ('MetaData "ActionEncoding" "RL.Encoding" "protovoices-rl-0.1.0.0-JjFFM1P77sPCI8QyjRIHUO" 'False) (C1 ('MetaCons "ActionEncoding" 'PrefixI 'True) (S1 ('MetaSel ('Just "actionEncodingTop") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (ActionTop dev batchShape)) :*: S1 ('MetaSel ('Just "actionEncodingOp") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (Tensor dev 'Int64 batchShape))))
type Batched (ActionEncoding dev shape) Source # 
Instance details

Defined in RL.Encoding

type Batched (ActionEncoding dev shape) = ActionEncoding dev (1 ': shape)
type Stacked (ActionEncoding dev batchShape) n Source # 
Instance details

Defined in RL.Encoding

type Stacked (ActionEncoding dev batchShape) n = ActionEncoding dev (n ': batchShape)

encodePVAction :: forall (dev :: (DeviceType, Nat)). KnownDevice dev => PVAction -> ActionEncoding dev ('[] :: [Nat]) Source #

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

Constructors

StateEncoding 

Fields

Instances

Instances details
NFData (StateEncoding dev) Source # 
Instance details

Defined in RL.Encoding

Methods

rnf :: StateEncoding dev -> () #

Generic (StateEncoding dev) Source # 
Instance details

Defined in RL.Encoding

Associated Types

type Rep (StateEncoding dev) 
Instance details

Defined in RL.Encoding

type Rep (StateEncoding dev) = D1 ('MetaData "StateEncoding" "RL.Encoding" "protovoices-rl-0.1.0.0-JjFFM1P77sPCI8QyjRIHUO" 'False) (C1 ('MetaCons "StateEncoding" 'PrefixI 'True) (S1 ('MetaSel ('Just "stateEncodingMid") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (QStartStop dev ('[] :: [Nat]) (SliceEncoding dev ('[] :: [Nat])))) :*: (S1 ('MetaSel ('Just "stateEncodingFrozen") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (QMaybe dev ('[] :: [Nat]) (TransitionEncoding dev '[FakeSize], QStartStop dev '[FakeSize] (SliceEncoding dev '[FakeSize])))) :*: S1 ('MetaSel ('Just "stateEncodingOpen") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (QMaybe dev ('[] :: [Nat]) (TransitionEncoding dev '[FakeSize], QStartStop dev '[FakeSize] (SliceEncoding dev '[FakeSize])))))))

Methods

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

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

Show (StateEncoding dev) Source # 
Instance details

Defined in RL.Encoding

(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) #

type Rep (StateEncoding dev) Source # 
Instance details

Defined in RL.Encoding

type Rep (StateEncoding dev) = D1 ('MetaData "StateEncoding" "RL.Encoding" "protovoices-rl-0.1.0.0-JjFFM1P77sPCI8QyjRIHUO" 'False) (C1 ('MetaCons "StateEncoding" 'PrefixI 'True) (S1 ('MetaSel ('Just "stateEncodingMid") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (QStartStop dev ('[] :: [Nat]) (SliceEncoding dev ('[] :: [Nat])))) :*: (S1 ('MetaSel ('Just "stateEncodingFrozen") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (QMaybe dev ('[] :: [Nat]) (TransitionEncoding dev '[FakeSize], QStartStop dev '[FakeSize] (SliceEncoding dev '[FakeSize])))) :*: S1 ('MetaSel ('Just "stateEncodingOpen") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (QMaybe dev ('[] :: [Nat]) (TransitionEncoding dev '[FakeSize], QStartStop dev '[FakeSize] (SliceEncoding dev '[FakeSize])))))))

encodePVState :: forall (dev :: (DeviceType, Nat)). KnownDevice dev => PVState -> StateEncoding dev Source #

data QEncoding (dev :: (DeviceType, Nat)) (batchShape :: [Nat]) Source #

Constructors

QEncoding 

Fields

Instances

Instances details
(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]) #

NFData (QEncoding dev batchShape) Source # 
Instance details

Defined in RL.Encoding

Methods

rnf :: QEncoding dev batchShape -> () #

Generic (QEncoding dev batchShape) Source # 
Instance details

Defined in RL.Encoding

Associated Types

type Rep (QEncoding dev batchShape) 
Instance details

Defined in RL.Encoding

type Rep (QEncoding dev batchShape) = D1 ('MetaData "QEncoding" "RL.Encoding" "protovoices-rl-0.1.0.0-JjFFM1P77sPCI8QyjRIHUO" 'False) (C1 ('MetaCons "QEncoding" 'PrefixI 'True) (S1 ('MetaSel ('Just "qActionEncoding") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (ActionEncoding dev batchShape)) :*: S1 ('MetaSel ('Just "qStateEncoding") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (StateEncoding dev))))

Methods

from :: QEncoding dev batchShape -> Rep (QEncoding dev batchShape) x #

to :: Rep (QEncoding dev batchShape) x -> QEncoding dev batchShape #

Show (QEncoding dev batchShape) Source # 
Instance details

Defined in RL.Encoding

Methods

showsPrec :: Int -> QEncoding dev batchShape -> ShowS #

show :: QEncoding dev batchShape -> String #

showList :: [QEncoding dev batchShape] -> ShowS #

Batchable (QEncoding dev shape) Source # 
Instance details

Defined in RL.Encoding

Associated Types

type Batched (QEncoding dev shape) 
Instance details

Defined in RL.Encoding

type Batched (QEncoding dev shape) = QEncoding dev (1 ': shape)

Methods

addBatchDim :: QEncoding dev shape -> Batched (QEncoding dev shape) Source #

type Rep (QEncoding dev batchShape) Source # 
Instance details

Defined in RL.Encoding

type Rep (QEncoding dev batchShape) = D1 ('MetaData "QEncoding" "RL.Encoding" "protovoices-rl-0.1.0.0-JjFFM1P77sPCI8QyjRIHUO" 'False) (C1 ('MetaCons "QEncoding" 'PrefixI 'True) (S1 ('MetaSel ('Just "qActionEncoding") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (ActionEncoding dev batchShape)) :*: S1 ('MetaSel ('Just "qStateEncoding") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (StateEncoding dev))))
type Batched (QEncoding dev shape) Source # 
Instance details

Defined in RL.Encoding

type Batched (QEncoding dev shape) = QEncoding dev (1 ': shape)

encodeStep :: forall (dev :: (DeviceType, Nat)). KnownDevice dev => PVState -> PVAction -> QEncoding dev ('[] :: [Nat]) Source #

withBatchedEncoding :: forall (dev :: (DeviceType, Nat)) r. KnownDevice dev => PVState -> NonEmpty PVAction -> (forall (n :: Nat). KnownNat n => QEncoding dev '[n] -> r) -> r Source #