# {py:mod}`evorl.algorithms.ec.ec_agent` ```{py:module} evorl.algorithms.ec.ec_agent ``` ```{autodoc2-docstring} evorl.algorithms.ec.ec_agent :parser: autodoc2_docstrings_parser :allowtitles: ``` ## Module Contents ### Classes ````{list-table} :class: autosummary longtable :align: left * - {py:obj}`DeterministicECAgent ` - ```{autodoc2-docstring} evorl.algorithms.ec.ec_agent.DeterministicECAgent :parser: autodoc2_docstrings_parser :summary: ``` * - {py:obj}`ECNetworkParams ` - ```{autodoc2-docstring} evorl.algorithms.ec.ec_agent.ECNetworkParams :parser: autodoc2_docstrings_parser :summary: ``` * - {py:obj}`StochasticECAgent ` - ```{autodoc2-docstring} evorl.algorithms.ec.ec_agent.StochasticECAgent :parser: autodoc2_docstrings_parser :summary: ``` ```` ### Functions ````{list-table} :class: autosummary longtable :align: left * - {py:obj}`make_deterministic_ec_agent ` - ```{autodoc2-docstring} evorl.algorithms.ec.ec_agent.make_deterministic_ec_agent :parser: autodoc2_docstrings_parser :summary: ``` * - {py:obj}`make_stochastic_ec_agent ` - ```{autodoc2-docstring} evorl.algorithms.ec.ec_agent.make_stochastic_ec_agent :parser: autodoc2_docstrings_parser :summary: ``` ```` ### API `````{py:class} DeterministicECAgent :canonical: evorl.algorithms.ec.ec_agent.DeterministicECAgent Bases: {py:obj}`evorl.agent.Agent` ```{autodoc2-docstring} evorl.algorithms.ec.ec_agent.DeterministicECAgent :parser: autodoc2_docstrings_parser ``` ````{py:method} compute_actions(agent_state: evorl.agent.AgentState, sample_batch: evorl.sample_batch.SampleBatch, key: chex.PRNGKey) -> tuple[evorl.types.Action, evorl.types.PolicyExtraInfo] :canonical: evorl.algorithms.ec.ec_agent.DeterministicECAgent.compute_actions ```` ````{py:method} evaluate_actions(agent_state: evorl.agent.AgentState, sample_batch: evorl.sample_batch.SampleBatch, key: chex.PRNGKey) -> tuple[evorl.types.Action, evorl.types.PolicyExtraInfo] :canonical: evorl.algorithms.ec.ec_agent.DeterministicECAgent.evaluate_actions ```` ````{py:method} init(obs_space: evorl.envs.Space, action_space: evorl.envs.Space, key: chex.PRNGKey) -> evorl.agent.AgentState :canonical: evorl.algorithms.ec.ec_agent.DeterministicECAgent.init ```{autodoc2-docstring} evorl.algorithms.ec.ec_agent.DeterministicECAgent.init :parser: autodoc2_docstrings_parser ``` ```` ````{py:property} normalize_obs :canonical: evorl.algorithms.ec.ec_agent.DeterministicECAgent.normalize_obs ```{autodoc2-docstring} evorl.algorithms.ec.ec_agent.DeterministicECAgent.normalize_obs :parser: autodoc2_docstrings_parser ``` ```` ````{py:attribute} obs_preprocessor :canonical: evorl.algorithms.ec.ec_agent.DeterministicECAgent.obs_preprocessor :type: typing.Any :value: > 'pytree_field(...)' ```{autodoc2-docstring} evorl.algorithms.ec.ec_agent.DeterministicECAgent.obs_preprocessor :parser: autodoc2_docstrings_parser ``` ```` ````{py:attribute} policy_network :canonical: evorl.algorithms.ec.ec_agent.DeterministicECAgent.policy_network :type: flax.linen.Module :value: > None ```{autodoc2-docstring} evorl.algorithms.ec.ec_agent.DeterministicECAgent.policy_network :parser: autodoc2_docstrings_parser ``` ```` ````` `````{py:class} ECNetworkParams :canonical: evorl.algorithms.ec.ec_agent.ECNetworkParams Bases: {py:obj}`evorl.types.PyTreeData` ```{autodoc2-docstring} evorl.algorithms.ec.ec_agent.ECNetworkParams :parser: autodoc2_docstrings_parser ``` ````{py:attribute} policy_params :canonical: evorl.algorithms.ec.ec_agent.ECNetworkParams.policy_params :type: evorl.types.Params :value: > None ```{autodoc2-docstring} evorl.algorithms.ec.ec_agent.ECNetworkParams.policy_params :parser: autodoc2_docstrings_parser ``` ```` ````` `````{py:class} StochasticECAgent :canonical: evorl.algorithms.ec.ec_agent.StochasticECAgent Bases: {py:obj}`evorl.agent.Agent` ```{autodoc2-docstring} evorl.algorithms.ec.ec_agent.StochasticECAgent :parser: autodoc2_docstrings_parser ``` ````{py:method} compute_actions(agent_state: evorl.agent.AgentState, sample_batch: evorl.sample_batch.SampleBatch, key: chex.PRNGKey) -> tuple[evorl.types.Action, evorl.types.PolicyExtraInfo] :canonical: evorl.algorithms.ec.ec_agent.StochasticECAgent.compute_actions ```` ````{py:attribute} continuous_action :canonical: evorl.algorithms.ec.ec_agent.StochasticECAgent.continuous_action :type: bool :value: > None ```{autodoc2-docstring} evorl.algorithms.ec.ec_agent.StochasticECAgent.continuous_action :parser: autodoc2_docstrings_parser ``` ```` ````{py:method} evaluate_actions(agent_state: evorl.agent.AgentState, sample_batch: evorl.sample_batch.SampleBatch, key: chex.PRNGKey) -> tuple[evorl.types.Action, evorl.types.PolicyExtraInfo] :canonical: evorl.algorithms.ec.ec_agent.StochasticECAgent.evaluate_actions ```` ````{py:method} init(obs_space: evorl.envs.Space, action_space: evorl.envs.Space, key: chex.PRNGKey) -> evorl.agent.AgentState :canonical: evorl.algorithms.ec.ec_agent.StochasticECAgent.init ```{autodoc2-docstring} evorl.algorithms.ec.ec_agent.StochasticECAgent.init :parser: autodoc2_docstrings_parser ``` ```` ````{py:property} normalize_obs :canonical: evorl.algorithms.ec.ec_agent.StochasticECAgent.normalize_obs ```{autodoc2-docstring} evorl.algorithms.ec.ec_agent.StochasticECAgent.normalize_obs :parser: autodoc2_docstrings_parser ``` ```` ````{py:attribute} obs_preprocessor :canonical: evorl.algorithms.ec.ec_agent.StochasticECAgent.obs_preprocessor :type: typing.Any :value: > 'pytree_field(...)' ```{autodoc2-docstring} evorl.algorithms.ec.ec_agent.StochasticECAgent.obs_preprocessor :parser: autodoc2_docstrings_parser ``` ```` ````{py:attribute} policy_network :canonical: evorl.algorithms.ec.ec_agent.StochasticECAgent.policy_network :type: flax.linen.Module :value: > None ```{autodoc2-docstring} evorl.algorithms.ec.ec_agent.StochasticECAgent.policy_network :parser: autodoc2_docstrings_parser ``` ```` ````` ````{py:function} 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 = '') :canonical: evorl.algorithms.ec.ec_agent.make_deterministic_ec_agent ```{autodoc2-docstring} evorl.algorithms.ec.ec_agent.make_deterministic_ec_agent :parser: autodoc2_docstrings_parser ``` ```` ````{py:function} 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 = '') :canonical: evorl.algorithms.ec.ec_agent.make_stochastic_ec_agent ```{autodoc2-docstring} evorl.algorithms.ec.ec_agent.make_stochastic_ec_agent :parser: autodoc2_docstrings_parser ``` ````