Safe Haskell | None |
---|---|
Language | Haskell2010 |
General Replay Buffer Types and TypeClasses
Synopsis
- class Functor b => ReplayBuffer b where
- size :: b Tensor -> Int
- push :: Int -> b Tensor -> b Tensor -> b Tensor
- lookUp :: [Int] -> b Tensor -> b Tensor
- sampleIO :: Int -> b Tensor -> IO (b Tensor)
- asTuple :: b Tensor -> (Tensor, Tensor, Tensor, Tensor, Tensor)
- collectExperience :: Agent a => Params -> CircusUrl -> Tracker -> Int -> a -> IO (b Tensor)
- randomBatches :: ReplayBuffer b => Int -> Int -> b Tensor -> IO [Transition]
- data Buffer a = Buffer {}
- empty :: Buffer Tensor
- size' :: Buffer Tensor -> Int
- drop :: Int -> Buffer Tensor -> Buffer Tensor
- push' :: Int -> Buffer Tensor -> Buffer Tensor -> Buffer Tensor
- lookUp' :: [Int] -> Buffer Tensor -> Buffer Tensor
- sampleIO' :: Int -> Buffer Tensor -> IO (Buffer Tensor)
- asTuple' :: Buffer Tensor -> Transition
- collectStep :: Agent a => Params -> CircusUrl -> Tracker -> Int -> Int -> a -> Tensor -> Buffer Tensor -> IO (Buffer Tensor)
- collectExperience' :: Agent a => Params -> CircusUrl -> Tracker -> Int -> a -> IO (Buffer Tensor)
Documentation
class Functor b => ReplayBuffer b where Source #
Replay Buffer Interface
size :: b Tensor -> Int Source #
Return size of current buffer
push :: Int -> b Tensor -> b Tensor -> b Tensor Source #
Push one buffer into another
lookUp :: [Int] -> b Tensor -> b Tensor Source #
Look Up given list if indices
sampleIO :: Int -> b Tensor -> IO (b Tensor) Source #
Take n Random Samples
asTuple :: b Tensor -> (Tensor, Tensor, Tensor, Tensor, Tensor) Source #
Return the Tuple: (s, a, r, s', d) for training
collectExperience :: Agent a => Params -> CircusUrl -> Tracker -> Int -> a -> IO (b Tensor) Source #
Collect Experiences in Buffer
Instances
randomBatches :: ReplayBuffer b => Int -> Int -> b Tensor -> IO [Transition] Source #
Generate a list of uniformly sampled minibatches
Vanilla Replay Buffer
Instances
Functor Buffer Source # | Vanilla ReplayBuffer implements |
Applicative Buffer Source # | This is badly defined and only so it can use |
ReplayBuffer Buffer Source # | Vanilla Replay Buffer implements |
Defined in RPB size :: Buffer Tensor -> Int Source # push :: Int -> Buffer Tensor -> Buffer Tensor -> Buffer Tensor Source # lookUp :: [Int] -> Buffer Tensor -> Buffer Tensor Source # sampleIO :: Int -> Buffer Tensor -> IO (Buffer Tensor) Source # asTuple :: Buffer Tensor -> (Tensor, Tensor, Tensor, Tensor, Tensor) Source # collectExperience :: Agent a => Params -> CircusUrl -> Tracker -> Int -> a -> IO (Buffer Tensor) Source # | |
Eq a => Eq (Buffer a) Source # | |
Show a => Show (Buffer a) Source # | |
drop :: Int -> Buffer Tensor -> Buffer Tensor Source #
Drop number of entries from the beginning of the Buffer
push' :: Int -> Buffer Tensor -> Buffer Tensor -> Buffer Tensor Source #
Push one buffer into another one
asTuple' :: Buffer Tensor -> Transition Source #
Return (State, Action, Reward, Next State, Done) Tuple