View Source Rein.Agent behaviour (rein v0.0.1)
The behaviour that should be implemented by a Rein
agent module.
Summary
Callbacks
Initializes the agent state with the given agent-specific options.
Can be used to record the observation in an experience replay buffer.
Resets any values that aren't fixed for the agent state.
Selects the action to be taken.
Types
@type rl_state() :: Rein.t()
@type t() :: Nx.Container.t()
An arbitrary Nx.Container
that holds metadata for the agent
Callbacks
Initializes the agent state with the given agent-specific options.
Also calls reset/2
in the end.
Link to this callback
record_observation(rl_state, action, reward, is_terminal, next_rl_state)
View Source@callback record_observation( rl_state(), action :: Nx.t(), reward :: Nx.t(), is_terminal :: Nx.t(), next_rl_state :: rl_state() ) :: rl_state()
Can be used to record the observation in an experience replay buffer.
If this is not desired, just make this function return the first argument unchanged.
Resets any values that aren't fixed for the agent state.
Selects the action to be taken.