MCPcopy Create free account

hub / github.com/EMI-Group/evorl / functions

Functions1,203 in github.com/EMI-Group/evorl

↓ 384 callersMethodreplace
(self, **d)
evorl/types.py:131
↓ 74 callersMethodwrite
Write data to the recorder.
evorl/recorders/recorder.py:15
↓ 68 callersMethodto_local_dict
Convert the dataclass to native python structures recursively. The data in the metric object will be converted to local data types: list, tup
evorl/metrics.py:51
↓ 63 callersFunctioncreate_env
Unified env creator. Args: env_cfg: The environment configuration. **kwargs: Additional keyword arguments for the environment cre
evorl/envs/__init__.py:11
↓ 59 callersMethodsample
(self, key: chex.PRNGKey)
evorl/envs/space.py:46
↓ 38 callersMethodinit
( self, obs_space: Space, action_space: Space, key: chex.PRNGKey )
evorl/algorithms/ec/ec_agent.py:49
↓ 36 callersFunctionpytree_field
Define a pytree field in our dataclass. Args: static: Setting to False will mark the field as static for pytree, where changing data in t
evorl/types.py:155
↓ 35 callersMethodall_reduce
(self, dp_axis_name: str | None = None)
evorl/metrics.py:37
↓ 35 callersMethodreshape
(self, shape: Sequence[int])
evorl/types.py:61
↓ 35 callersMethodupdate
(self, e=None, **f)
evorl/types.py:117
↓ 34 callersFunctionpsum
(x, axis_name: str | None = None)
evorl/distributed/comm.py:17
↓ 33 callersFunctiontree_get
Get the elements of each array in the pytree.
evorl/utils/jax_utils.py:117
↓ 31 callersMethodconcatenate
(self, *others: chex.ArrayTree, axis: int = 0)
evorl/types.py:70
↓ 28 callersFunctionagent_gradient_update
( loss_fn: Callable[..., float], optimizer: optax.GradientTransformation, dp_axis_name: str | None
evorl/distributed/gradients.py:69
↓ 27 callersFunctionrollout
Collect trajectories with length of `rollout_length`. This method is a general rollout method used for collecting trajectories from a vectorized
evorl/rollout.py:91
↓ 24 callersFunctionget_1d_array_statistics
Get raw value and statistics of a 1D array. Helper function for logging in WandB. Args: data: 1D numpy array. If data has multiple d
evorl/recorders/wandb_recorder.py:55
↓ 24 callersMethodsave
(self, step, items, **kwargs)
evorl/utils/orbax_utils.py:132
↓ 24 callersFunctionsoft_target_update
Perform soft update on target network. Args: target_params: Target network parameters. source_params: Source network parameters.
evorl/utils/rl_toolkits.py:168
↓ 24 callersFunctiontree_stop_gradient
Pytree version of `jax.lax.stop_gradient`.
evorl/utils/jax_utils.py:102
↓ 21 callersMethodadd
( self, buffer_state: ReplayBufferState, xs: chex.ArrayTree, mask: chex.Array
evorl/replay_buffers/replay_buffer.py:122
↓ 21 callersFunctionadd_prefix
Add prefix to the keys of a dictionary.
evorl/recorders/wandb_recorder.py:50
↓ 21 callersFunctionget_tanh_norm_dist
Get a tanh transformed normal distribution.
evorl/distribution.py:15
↓ 20 callersFunctionflatten_rollout_trajectory
Flatten the trajectory from [T, B, ...] to [T*B, ...].
evorl/utils/rl_toolkits.py:186
↓ 18 callersFunctionscan_and_mean
Scan with mean aggregation. Usage: same like `jax.lax.scan`, but the scan results will be averaged.
evorl/utils/jax_utils.py:157
↓ 17 callersFunctionget_categorical_dist
Get a categorical distribution.
evorl/distribution.py:10
↓ 17 callersMethodinit
( self, obs_space: Space, action_space: Space, key: chex.PRNGKey )
tests/utils.py:107
↓ 15 callersFunctionclean_trajectory
Clean the trajectory to make it suitable for the replay buffer.
evorl/algorithms/offpolicy_utils.py:262
↓ 15 callersMethodinit
( self, obs_space: Space, action_space: Space, key: chex.PRNGKey )
evorl/algorithms/contrib/td3_v3.py:66
↓ 13 callersMethodlog_prob
(self, event)
evorl/distribution.py:84
↓ 13 callersFunctionmake_policy_network
Creates a policy network.
evorl/networks/linear.py:148
↓ 13 callersFunctionrng_split
Unified Version of `jax.random.split` for both single key and batched keys.
evorl/utils/jax_utils.py:239
↓ 13 callersFunctionskip_replay_buffer_state
Utility function to remove replay_buffer_state from state. Usually used when saving the off-policy workflow state to disk.
evorl/algorithms/offpolicy_utils.py:254
↓ 12 callersFunctioncemrl_replace_td3_actor_params
( agent_state: AgentState, pop_actor_params: TD3NetworkParams )
evorl/algorithms/erl/cemrl_td3/cemrl_td3_workflow.py:112
↓ 11 callersMethodentropy
(self, seed=None)
evorl/distribution.py:101
↓ 11 callersMethodevaluate
(self, state: State)
evorl/algorithms/contrib/pop_td3.py:424
↓ 11 callersFunctionshmap_vmap
Vmap on different gpu.
evorl/distributed/sharding.py:14
↓ 10 callersFunctioncompute_discount_return
Compute discount return from the episodic trajectory. Args: rewards: Rewards collected from an episodic trajectory. dones: Dones
evorl/utils/rl_toolkits.py:29
↓ 10 callersFunctionmetric_field
Define a metric field in `MetricBase`. Args: reduce_fn: A function to reduce the metric value across different devices. For example, `jax
evorl/metrics.py:13
↓ 10 callersFunctiontree_set
Set part of each array in the pytree. A Pytree version of `src[idx_or_slice]=target`. Args: src: The source pytree. target:
evorl/utils/jax_utils.py:122
↓ 9 callersFunctioncreate_wrapped_brax_env
Create wrapped Brax environment for training. Args: env_name: Environment name. episode_length: Max episode length. paral
evorl/envs/brax.py:106
↓ 9 callersFunctionmake_deterministic_ec_agent
( action_space: Space, actor_hidden_layer_sizes: tuple[int] = (256, 256), use_bias: bool = True,
evorl/algorithms/ec/ec_agent.py:199
↓ 9 callersMethodreset
Reset the environment to initial state.
evorl/envs/env.py:49
↓ 8 callersMethod_has_wrapper
(self, env, cls)
tests/test_mjx_env.py:202
↓ 8 callersMethodask
Generate new candidate solutions.
evorl/algorithms/meta/pbt_openes/param_openes.py:57
↓ 8 callersFunctionhas_wrapper
(env, wrapper_cls)
tests/test_brax_env.py:17
↓ 8 callersFunctioninit_fn
(key)
tests/test_ec_operator.py:12
↓ 8 callersFunctioninit_obs_preprocessor
(agent_state, config, key, dp_axis_name=None)
evorl/algorithms/ec/obs_utils.py:31
↓ 8 callersFunctionmake_mlp_td3_agent
( action_space: Space, norm_layer_type: str = "none", critic_hidden_layer_sizes: tuple[int] = (256
evorl/algorithms/contrib/td3_v3.py:131
↓ 8 callersMethodreset
(self, key)
tests/utils.py:26
↓ 8 callersFunctionscan_and_last
Scan and return last iteration results. Usage: same like `jax.lax.scan`, but return the last scan iteration results.
evorl/utils/jax_utils.py:166
↓ 8 callersMethodto_tree
Convert the flatten params to the original params. Args: x: The flatten params. Returns: The original params
evorl/utils/ec_utils.py:46
↓ 8 callersFunctionweight_sum
Weighted sum. Args: x: (n, ...) w: (n,)
evorl/ec/optimizers/utils.py:24
↓ 7 callersFunction_test
(rewards, dones, max_length)
tests/test_evaluator.py:152
↓ 7 callersMethodbuild_from_config
Build the workflow instance from the config. This is the public API to call for instantiating a new workflow object from config. Normally, it
evorl/workflows/workflow.py:61
↓ 7 callersFunctioncreate_wrapped_mujoco_playground_env
Create wrapped Brax environment for training. Args: env_name: Environment name. episode_length: Max episode length. paral
evorl/envs/mujoco_playground.py:139
↓ 7 callersFunctionerl_replace_td3_actor_params
( agent_state: AgentState, pop_actor_params: TD3NetworkParams )
evorl/algorithms/erl/erl_td3/erl_td3_workflow.py:221
↓ 7 callersFunctionlog_uniform_init
Random sample from log space. Suitable for hyperparameters that need explore different magnitudes in positive range. eg: [1e-3, 100].
evorl/algorithms/meta/pbt_utils.py:51
↓ 7 callersMethodmode
(self)
evorl/distribution.py:98
↓ 7 callersMethodreset
Reset the vmapped env. Args: key: support batched keys [B,2] or single key [2]
evorl/envs/wrappers/training_wrapper.py:146
↓ 7 callersFunctionrng_split_like_tree
Split the key according to the structure of the target pytree.
evorl/utils/jax_utils.py:255
↓ 7 callersFunctionsplit_key_to_devices
Split the key to each device.
evorl/distributed/comm.py:46
↓ 7 callersMethodstep
(self, state, action)
tests/utils.py:37
↓ 6 callersMethod_multi_steps
(self, state)
evorl/algorithms/contrib/pop_ppo.py:53
↓ 6 callersMethodactor_loss
( self, agent_state: AgentState, sample_batch: SampleBatch, key: chex.PRNGKey )
evorl/algorithms/td7.py:396
↓ 6 callersFunctioncreate_mujoco_playground_env
Create Brax environment. Args: env_name: Environment name. kwargs: Arguments passing into Brax. If you want to use jax backend, s
evorl/envs/mujoco_playground.py:123
↓ 6 callersFunctiongradient_update
Wrapper of the loss function that apply gradient updates. Args: loss_fn: The loss function. (params, ...) -> loss optimizer: The
evorl/distributed/gradients.py:25
↓ 6 callersMethodinit
( self, obs_space: Space, action_space: Space, key: chex.PRNGKey )
evorl/agent.py:129
↓ 6 callersMethodinit
( self, obs_space: Space, action_space: Space, key: chex.PRNGKey )
evorl/algorithms/sac.py:67
↓ 6 callersFunctionright_shift_with_padding
Shift the array to the right with padding.
evorl/utils/jax_utils.py:300
↓ 6 callersFunctionsort_dict
(d: dict)
evorl/envs/utils.py:1
↓ 6 callersMethodtell
( self, state: ECState, fitnesses: chex.Array )
evorl/algorithms/meta/pbt_openes/param_openes.py:85
↓ 5 callersMethod_ec_rollout
(self, agent_state, replay_buffer_state, key)
evorl/algorithms/erl/erl_td3/erl_td3_workflow.py:140
↓ 5 callersFunctioncompute_gae
Calculates the Generalized Advantage Estimation (GAE). Args: rewards: A float32 tensor of shape [T, B] containing rewards generated by
evorl/utils/rl_toolkits.py:66
↓ 5 callersMethodcritic_loss
( self, agent_state: AgentState, sample_batch: SampleBatch, key: chex.PRNGKey )
evorl/algorithms/meta/pbt_sac/param_sac.py:51
↓ 5 callersFunctionmake_mlp
Creates an MLP network.
evorl/networks/linear.py:77
↓ 5 callersFunctionmake_q_network
Creates a Q network: (obs, action) -> value.
evorl/networks/linear.py:210
↓ 5 callersMethodstep
Take a step in the environment.
evorl/envs/env.py:54
↓ 5 callersMethodtree_unflatten
(cls, aux_data, children)
evorl/types.py:141
↓ 5 callersFunctiontree_zeros_like
Pytree version of `jnp.zeros_like`.
evorl/utils/jax_utils.py:87
↓ 4 callersMethod__init__
Initialize the env wrapper. Args: env: the original env num_envs: number of envs to vectorize vmap_step:
evorl/envs/wrappers/training_wrapper.py:134
↓ 4 callersMethod__init__
(self, env: Env, num_envs: int = 1, vmap_step: bool = False)
evorl/envs/wrappers/ma_training_wrapper.py:75
↓ 4 callersMethod__init__
(self, **kwargs)
evorl/envs/jaxmarl_envs/mabrax.py:124
↓ 4 callersMethod__setattr__
(self, name, value)
evorl/types.py:110
↓ 4 callersFunction_real_discount_return
(rewards, discount)
tests/test_toolkits.py:31
↓ 4 callersMethod_rl_rollout
(self, agent_state, replay_buffer_state, key)
evorl/algorithms/erl/erl_td3/erl_eda.py:195
↓ 4 callersFunction_to_jax
(pytree)
evorl/envs/gymnasium.py:20
↓ 4 callersFunctionaverage_episode_discount_return
Estimate the average episode return from a segmented trajectory. This method does not require the trajectory data from a complete episode.
evorl/utils/rl_toolkits.py:196
↓ 4 callersFunctionavg_l1_norm
Average L1 Norm used in TD7.
evorl/algorithms/td7.py:47
↓ 4 callersMethodclose
Close the workflow's components.
evorl/workflows/workflow.py:91
↓ 4 callersFunctioncompute_episode_length
Compute the length of the episode. Args: dones: Dones collected from an episodic trajectory. Returns: Length of the episode.
evorl/utils/rl_toolkits.py:13
↓ 4 callersMethodevaluate
Evaluate the agent based on its state. Args: agent_state: The state of the agent. key: The PRNG key. num_
evorl/evaluators/evaluator.py:40
↓ 4 callersFunctionflatten_pop_rollout_episode
Flatten the trajectory from [#pop, T, B, ...] to [T, #pop*B, ...].
evorl/utils/rl_toolkits.py:191
↓ 4 callersMethodinit
( self, obs_space: Space, action_space: Space, key: chex.PRNGKey )
evorl/agent.py:83
↓ 4 callersMethodinit
Initialize the state of the . This is the public API to call for instance state initialization.
evorl/workflows/workflow.py:75
↓ 4 callersMethodinit
( self, obs_space: Space, action_space: Space, key: chex.PRNGKey )
evorl/algorithms/td7.py:181
↓ 4 callersFunctionis_jitted
Detect if a function is wrapped by jit or pmap.
evorl/utils/jax_utils.py:264
↓ 4 callersFunctionmake_v_network
Creates a V network: (obs) -> value.
evorl/networks/linear.py:181
↓ 4 callersMethodpop
(self, k, d=None)
evorl/types.py:123
↓ 4 callersMethodto_vector
Convert the original params to flatten params. see `jax.flatten_util.ravel_pytree` Args: x: The original params.
evorl/utils/ec_utils.py:26
↓ 3 callersFunction_assert_obs_batched
Assert obs has correct batch dimensions.
tests/test_mjx_env.py:36
next →1–100 of 1,203, ranked by callers