memory

class rl.memory.Batch(state0, action, reward, state1, terminal1)
action

Alias for field number 1

reward

Alias for field number 2

state0

Alias for field number 0

state1

Alias for field number 3

terminal1

Alias for field number 4

class rl.memory.Experience(state0, action, reward, state1, terminal1)
action

Alias for field number 1

reward

Alias for field number 2

state0

Alias for field number 0

state1

Alias for field number 3

terminal1

Alias for field number 4

class rl.memory.Memory(env)[source]

Abstract memory class

append(experience)[source]

Add the experience to the memory

sample(batch_size)[source]

Get a sample from the memory

Parameters:batch_size (int) – size of the batch
Returns:A Batch object
class rl.memory.SimpleMemory(env, limit)[source]

A simple memory directly storing experiences in a circular buffer

Data is stored directly as an array of Experience

dump()[source]

Get the memory content as a single array

classmethod from_file(env, limit, file_path)[source]

Create a memory from a pickle file

get_idxs(idxs, batch_size)[source]

Get a non-contiguous series of indexes

save(file)[source]

Dump the memory into a pickle file