reinforce-0.0.0.1: Reinforcement learning in Haskell

Copyright(c) Sentenai 2017
LicenseBSD3
Maintainersam@sentenai.com
Stabilityexperimental
Portabilitynon-portable
Safe HaskellNone
LanguageHaskell2010

Reinforce.Spaces.Action

Description

typeclass for a discrete action space, as well as helper functions

Synopsis

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.

Associated Types

type Size a :: Nat Source #

Methods

toAction :: Int -> a Source #

fromAction :: a -> Int Source #

Instances

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