evorl.algorithms.ec.ec_agent

Module Contents

Classes

DeterministicECAgent

Deterministic Agent for continuous action space in [-1, 1].

ECNetworkParams

Contains training state for the learner.

StochasticECAgent

Stochastic Agent.

Functions

API

class evorl.algorithms.ec.ec_agent.DeterministicECAgent[source]

Bases: evorl.agent.Agent

Deterministic Agent for continuous action space in [-1, 1].

compute_actions(agent_state: evorl.agent.AgentState, sample_batch: evorl.sample_batch.SampleBatch, key: chex.PRNGKey) tuple[evorl.types.Action, evorl.types.PolicyExtraInfo][source]
evaluate_actions(agent_state: evorl.agent.AgentState, sample_batch: evorl.sample_batch.SampleBatch, key: chex.PRNGKey) tuple[evorl.types.Action, evorl.types.PolicyExtraInfo][source]
init(obs_space: evorl.envs.Space, action_space: evorl.envs.Space, key: chex.PRNGKey) evorl.agent.AgentState[source]
property normalize_obs
obs_preprocessor: Any

‘pytree_field(…)’

policy_network: flax.linen.Module

None

class evorl.algorithms.ec.ec_agent.ECNetworkParams[source]

Bases: evorl.types.PyTreeData

Contains training state for the learner.

policy_params: evorl.types.Params

None

class evorl.algorithms.ec.ec_agent.StochasticECAgent[source]

Bases: evorl.agent.Agent

Stochastic Agent.

Support continuous action space in [-1, 1] via TanhNormal distribution or discrete action space via Softmax distribution.

compute_actions(agent_state: evorl.agent.AgentState, sample_batch: evorl.sample_batch.SampleBatch, key: chex.PRNGKey) tuple[evorl.types.Action, evorl.types.PolicyExtraInfo][source]
continuous_action: bool

None

evaluate_actions(agent_state: evorl.agent.AgentState, sample_batch: evorl.sample_batch.SampleBatch, key: chex.PRNGKey) tuple[evorl.types.Action, evorl.types.PolicyExtraInfo][source]
init(obs_space: evorl.envs.Space, action_space: evorl.envs.Space, key: chex.PRNGKey) evorl.agent.AgentState[source]
property normalize_obs
obs_preprocessor: Any

‘pytree_field(…)’

policy_network: flax.linen.Module

None

evorl.algorithms.ec.ec_agent.make_deterministic_ec_agent(action_space: evorl.envs.Space, actor_hidden_layer_sizes: tuple[int] = (256, 256), use_bias: bool = True, norm_layer_type: str = 'none', normalize_obs: bool = False, policy_obs_key: str = '')[source]
evorl.algorithms.ec.ec_agent.make_stochastic_ec_agent(action_space: evorl.envs.Space, actor_hidden_layer_sizes: tuple[int] = (256, 256), use_bias: bool = True, norm_layer_type: str = 'none', normalize_obs: bool = False, policy_obs_key: str = '')[source]