| Safe Haskell | None |
|---|---|
| Language | GHC2021 |
RL.Encoding
Documentation
class Stackable a where Source #
Methods
stack :: forall (n :: Nat). (KnownNat n, KnownNat (1 + n)) => Vector (1 + n) a -> Stacked a (1 + n) Source #
Instances
| Stackable (ActionEncoding dev batchShape) Source # | |
Defined in RL.Encoding | |
| Stackable (ActionTop dev batchShape) Source # | |
| Stackable (SliceEncodingDense dev batchShape) Source # | |
Defined in RL.Encoding | |
| Stackable (SliceEncodingSparse dev batchShape) Source # | |
Defined in RL.Encoding | |
| Stackable (TransitionEncoding dev batchShape) Source # | |
Defined in RL.Encoding | |
| Stackable a => Stackable (QMaybe dev batchShape a) Source # | |
| Stackable a => Stackable (QStartStop dev batchShape a) Source # | |
Defined in RL.Encoding | |
| Stackable (QBoundedList dev dtype maxLen batchShape innerShape) Source # | |
Defined in RL.Encoding | |
class Batchable a where Source #
Methods
addBatchDim :: a -> Batched a Source #
Instances
| Batchable (ActionEncoding dev shape) Source # | |||||
Defined in RL.Encoding Associated Types
Methods addBatchDim :: ActionEncoding dev shape -> Batched (ActionEncoding dev shape) Source # | |||||
| Batchable (ActionTop dev shape) Source # | |||||
Defined in RL.Encoding Associated Types
| |||||
| Batchable (QEncoding dev shape) Source # | |||||
Defined in RL.Encoding Associated Types
| |||||
| Batchable (SliceEncodingDense dev batchShape) Source # | |||||
Defined in RL.Encoding Associated Types
Methods addBatchDim :: SliceEncodingDense dev batchShape -> Batched (SliceEncodingDense dev batchShape) Source # | |||||
| Batchable (SliceEncodingSparse dev shape) Source # | |||||
Defined in RL.Encoding Associated Types
Methods addBatchDim :: SliceEncodingSparse dev shape -> Batched (SliceEncodingSparse dev shape) Source # | |||||
| Batchable (TransitionEncoding dev shape) Source # | |||||
Defined in RL.Encoding Associated Types
Methods addBatchDim :: TransitionEncoding dev shape -> Batched (TransitionEncoding dev shape) Source # | |||||
| Batchable (Tensor dev dtype shape) Source # | |||||
Defined in RL.Encoding Associated Types
| |||||
| Batchable a => Batchable (QMaybe dev shape a) Source # | |||||
Defined in RL.Encoding Associated Types
| |||||
| Batchable a => Batchable (QStartStop dev shape a) Source # | |||||
Defined in RL.Encoding Associated Types
Methods addBatchDim :: QStartStop dev shape a -> Batched (QStartStop dev shape a) Source # | |||||
| Batchable (QBoundedList dev dtype maxLen batchShape innerShape) Source # | |||||
Defined in RL.Encoding Associated Types
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 #
Instances
| NFData a => NFData (QMaybe dev batchShape a) Source # | |||||
Defined in RL.Encoding | |||||
| Generic (QMaybe dev batchShape a) Source # | |||||
Defined in RL.Encoding Associated Types
| |||||
| Show a => Show (QMaybe dev batchShape a) Source # | |||||
| Batchable a => Batchable (QMaybe dev shape a) Source # | |||||
Defined in RL.Encoding Associated Types
| |||||
| Stackable a => Stackable (QMaybe dev batchShape a) Source # | |||||
| type Rep (QMaybe dev batchShape a) Source # | |||||
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 # | |||||
Defined in RL.Encoding | |||||
| type Stacked (QMaybe dev batchShape a) n Source # | |||||
Defined in RL.Encoding | |||||
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 | |
Instances
| NFData (QBoundedList dev dtype maxLen batchShape innerShape) Source # | |||||
Defined in RL.Encoding Methods rnf :: QBoundedList dev dtype maxLen batchShape innerShape -> () # | |||||
| Generic (QBoundedList dev dtype maxLen batchShape innerShape) Source # | |||||
Defined in RL.Encoding Associated Types
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 # | |||||
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 # | |||||
Defined in RL.Encoding Associated Types
Methods addBatchDim :: QBoundedList dev dtype maxLen batchShape innerShape -> Batched (QBoundedList dev dtype maxLen batchShape innerShape) Source # | |||||
| Stackable (QBoundedList dev dtype maxLen batchShape innerShape) Source # | |||||
Defined in RL.Encoding | |||||
| type Rep (QBoundedList dev dtype maxLen batchShape innerShape) Source # | |||||
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 # | |||||
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 # | |||||
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
| (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). | ||||
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). | ||||
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 # | |||||
Defined in RL.Encoding Methods rnf :: QStartStop dev batchShape a -> () # | |||||
| Generic (QStartStop dev batchShape a) Source # | |||||
Defined in RL.Encoding Associated Types
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 # | |||||
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 # | |||||
Defined in RL.Encoding Associated Types
Methods addBatchDim :: QStartStop dev shape a -> Batched (QStartStop dev shape a) Source # | |||||
| Stackable a => Stackable (QStartStop dev batchShape a) Source # | |||||
Defined in RL.Encoding | |||||
| type Rep (QStartStop dev batchShape a) Source # | |||||
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 # | |||||
Defined in RL.Encoding | |||||
| type Stacked (QStartStop dev batchShape a) n Source # | |||||
Defined in RL.Encoding | |||||
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
| NFData (SliceEncodingSparse dev batchShape) Source # | |||||
Defined in RL.Encoding Methods rnf :: SliceEncodingSparse dev batchShape -> () # | |||||
| Generic (SliceEncodingSparse dev batchShape) Source # | |||||
Defined in RL.Encoding Associated Types
Methods from :: SliceEncodingSparse dev batchShape -> Rep (SliceEncodingSparse dev batchShape) x # to :: Rep (SliceEncodingSparse dev batchShape) x -> SliceEncodingSparse dev batchShape # | |||||
| Show (SliceEncodingSparse dev batchShape) Source # | |||||
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 # | |||||
Defined in RL.Encoding Associated Types
Methods addBatchDim :: SliceEncodingSparse dev shape -> Batched (SliceEncodingSparse dev shape) Source # | |||||
| Stackable (SliceEncodingSparse dev batchShape) Source # | |||||
Defined in RL.Encoding | |||||
| type Rep (SliceEncodingSparse dev batchShape) Source # | |||||
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 # | |||||
Defined in RL.Encoding | |||||
| type Stacked (SliceEncodingSparse dev batchShape) n Source # | |||||
Defined in RL.Encoding | |||||
newtype SliceEncodingDense (dev :: (DeviceType, Nat)) (batchShape :: [Nat]) Source #
Constructors
| SliceEncodingDense | |
Fields
| |
Instances
| (IsValidDevice dev, embshape ~ '[batchSize, EmbSize, FifthSize, OctaveSize]) => HasForward (SliceEncoder dev) (SliceEncoding dev '[batchSize]) (QTensor dev embshape) Source # | HasFoward for slice (batched) | ||||
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) | ||||
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). | ||||
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). | ||||
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 # | |||||
Defined in RL.Encoding Methods rnf :: SliceEncodingDense dev batchShape -> () # | |||||
| Generic (SliceEncodingDense dev batchShape) Source # | |||||
Defined in RL.Encoding Associated Types
Methods from :: SliceEncodingDense dev batchShape -> Rep (SliceEncodingDense dev batchShape) x # to :: Rep (SliceEncodingDense dev batchShape) x -> SliceEncodingDense dev batchShape # | |||||
| Show (SliceEncodingDense dev batchShape) Source # | |||||
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 # | |||||
Defined in RL.Encoding Associated Types
Methods addBatchDim :: SliceEncodingDense dev batchShape -> Batched (SliceEncodingDense dev batchShape) Source # | |||||
| Stackable (SliceEncodingDense dev batchShape) Source # | |||||
Defined in RL.Encoding | |||||
| type Rep (SliceEncodingDense dev batchShape) Source # | |||||
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 # | |||||
Defined in RL.Encoding | |||||
| type Stacked (SliceEncodingDense dev batchShape) n Source # | |||||
Defined in RL.Encoding | |||||
type SliceEncoding = SliceEncodingDense Source #
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 #
pitch2index :: SPitch -> [Int] Source #
pitchesMultiHot :: forall (dev :: (DeviceType, Nat)). KnownDevice dev => HashSet SPitch -> QTensor dev PShape 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
edgesMultiHot :: forall (dev :: (DeviceType, Nat)). KnownDevice dev => HashSet (InnerEdge SPitch) -> QTensor dev EShape' Source #
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
| NFData (ActionTop dev batchShape) Source # | |||||
Defined in RL.Encoding | |||||
| Generic (ActionTop dev batchShape) Source # | |||||
Defined in RL.Encoding Associated Types
| |||||
| Show (ActionTop dev batchShape) Source # | |||||
| Batchable (ActionTop dev shape) Source # | |||||
Defined in RL.Encoding Associated Types
| |||||
| Stackable (ActionTop dev batchShape) Source # | |||||
| type Rep (ActionTop dev batchShape) Source # | |||||
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 # | |||||
Defined in RL.Encoding | |||||
| type Stacked (ActionTop dev batchShape) n Source # | |||||
Defined in RL.Encoding | |||||
data ActionEncoding (dev :: (DeviceType, Nat)) (batchShape :: [Nat]) Source #
Constructors
| ActionEncoding | |
Fields
| |
Instances
| (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) | ||||
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 # | |||||
Defined in RL.Encoding Methods rnf :: ActionEncoding dev batchShape -> () # | |||||
| Generic (ActionEncoding dev batchShape) Source # | |||||
Defined in RL.Encoding Associated Types
Methods from :: ActionEncoding dev batchShape -> Rep (ActionEncoding dev batchShape) x # to :: Rep (ActionEncoding dev batchShape) x -> ActionEncoding dev batchShape # | |||||
| Show (ActionEncoding dev batchShape) Source # | |||||
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 # | |||||
Defined in RL.Encoding Associated Types
Methods addBatchDim :: ActionEncoding dev shape -> Batched (ActionEncoding dev shape) Source # | |||||
| Stackable (ActionEncoding dev batchShape) Source # | |||||
Defined in RL.Encoding | |||||
| type Rep (ActionEncoding dev batchShape) Source # | |||||
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 # | |||||
Defined in RL.Encoding | |||||
| type Stacked (ActionEncoding dev batchShape) n Source # | |||||
Defined in RL.Encoding | |||||
encodePVAction :: forall (dev :: (DeviceType, Nat)). KnownDevice dev => PVAction -> ActionEncoding dev ('[] :: [Nat]) Source #
data StateEncoding (dev :: (DeviceType, Nat)) Source #
Constructors
| StateEncoding | |
Fields
| |
Instances
| NFData (StateEncoding dev) Source # | |||||
Defined in RL.Encoding Methods rnf :: StateEncoding dev -> () # | |||||
| Generic (StateEncoding dev) Source # | |||||
Defined in RL.Encoding Associated Types
Methods from :: StateEncoding dev -> Rep (StateEncoding dev) x # to :: Rep (StateEncoding dev) x -> StateEncoding dev # | |||||
| Show (StateEncoding dev) Source # | |||||
Defined in RL.Encoding Methods showsPrec :: Int -> StateEncoding dev -> ShowS # show :: StateEncoding dev -> String # showList :: [StateEncoding dev] -> ShowS # | |||||
| (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) | ||||
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 # | |||||
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]))))))) | |||||
getFrozen :: forall (dev :: (DeviceType, Nat)) t. (Foldable t, KnownDevice dev) => Path (Maybe (t (Edge SPitch))) (Notes SPitch) -> (TransitionEncoding dev '[FakeSize], QStartStop dev '[FakeSize] (SliceEncoding dev '[FakeSize])) Source #
getOpen :: forall (dev :: (DeviceType, Nat)). KnownDevice dev => Path (Edges SPitch) (Notes SPitch) -> (TransitionEncoding dev '[FakeSize], QStartStop dev '[FakeSize] (SliceEncoding dev '[FakeSize])) Source #
encodePVState :: forall (dev :: (DeviceType, Nat)). KnownDevice dev => PVState -> StateEncoding dev Source #
data QEncoding (dev :: (DeviceType, Nat)) (batchShape :: [Nat]) Source #
Constructors
| QEncoding | |
Fields
| |
Instances
| (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) | ||||
| (IsValidDevice dev, CheckIsSuffixOf '[QOutHidden] '[1, QOutHidden] (QOutHidden == QOutHidden)) => HasForward (QModel dev) (QEncoding dev ('[] :: [Nat])) (QTensor dev '[1]) Source # | HasForward for model (unbatched) | ||||
| NFData (QEncoding dev batchShape) Source # | |||||
Defined in RL.Encoding | |||||
| Generic (QEncoding dev batchShape) Source # | |||||
Defined in RL.Encoding Associated Types
| |||||
| Show (QEncoding dev batchShape) Source # | |||||
| Batchable (QEncoding dev shape) Source # | |||||
Defined in RL.Encoding Associated Types
| |||||
| type Rep (QEncoding dev batchShape) Source # | |||||
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 # | |||||
Defined in RL.Encoding | |||||
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 #