Copyright | (c) Sentenai 2017 |
---|---|
License | BSD3 |
Maintainer | sam@sentenai.com |
Stability | experimental |
Portability | non-portable |
Safe Haskell | None |
Language | Haskell2010 |
typeclass for a discrete action space, as well as helper functions
- class (Bounded a, Enum a) => DiscreteActionSpace a where
- oneHot :: forall a. (KnownNat (Size a), DiscreteActionSpace a) => a -> R (Size a)
- oneHot' :: forall a. DiscreteActionSpace a => a -> Vector Double
- allActions :: DiscreteActionSpace a => [a]
- randomChoice :: forall m a. (MonadIO m, MonadMWCRandom m, DiscreteActionSpace a) => m a
Documentation
class (Bounded a, Enum a) => DiscreteActionSpace a where Source #
Mostly tags around an Enum, but includes information about the size of an action space and is used in helper functions.
oneHot :: forall a. (KnownNat (Size a), DiscreteActionSpace a) => a -> R (Size a) Source #
one-hot encode a bounded enumerable. Doesn't care if minBound is or 0
oneHot' :: forall a. DiscreteActionSpace a => a -> Vector Double Source #
one-hot encode a bounded enumerable
allActions :: DiscreteActionSpace a => [a] Source #
helper function to get all actions in a discrete action space
randomChoice :: forall m a. (MonadIO m, MonadMWCRandom m, DiscreteActionSpace a) => m a Source #
make a uniform-random selection of an Action in a discrete action space