malib package
Subpackages
- malib.agent package
- Submodules
- malib.agent.agent_interface module
AgentInterfaceAgentInterface.add_policies()AgentInterface.connect()AgentInterface.deviceAgentInterface.get_algorithm()AgentInterface.get_algorthms()AgentInterface.get_interface_state()AgentInterface.governed_agentsAgentInterface.multiagent_post_process()AgentInterface.pull()AgentInterface.push()AgentInterface.reset()AgentInterface.sync_remote_parameters()AgentInterface.train()
- malib.agent.async_agent module
- malib.agent.indepdent_agent module
- malib.agent.manager module
- malib.agent.team_agent module
- malib.backend package
- malib.common package
- Submodules
- malib.common.distributions module
BernoulliDistributionBernoulliDistribution.actions_from_params()BernoulliDistribution.entropy()BernoulliDistribution.log_prob()BernoulliDistribution.log_prob_from_params()BernoulliDistribution.mode()BernoulliDistribution.proba_distribution()BernoulliDistribution.proba_distribution_net()BernoulliDistribution.sample()
CategoricalDistributionCategoricalDistribution.actions_from_params()CategoricalDistribution.entropy()CategoricalDistribution.log_prob()CategoricalDistribution.log_prob_from_params()CategoricalDistribution.mode()CategoricalDistribution.prob()CategoricalDistribution.proba_distribution()CategoricalDistribution.proba_distribution_net()CategoricalDistribution.sample()
DiagGaussianDistributionDiagGaussianDistribution.actions_from_params()DiagGaussianDistribution.entropy()DiagGaussianDistribution.log_prob()DiagGaussianDistribution.log_prob_from_params()DiagGaussianDistribution.mode()DiagGaussianDistribution.prob()DiagGaussianDistribution.proba_distribution()DiagGaussianDistribution.proba_distribution_net()DiagGaussianDistribution.sample()
DistributionMaskedCategoricalMultiCategoricalDistributionMultiCategoricalDistribution.actions_from_params()MultiCategoricalDistribution.entropy()MultiCategoricalDistribution.log_prob()MultiCategoricalDistribution.log_prob_from_params()MultiCategoricalDistribution.mode()MultiCategoricalDistribution.proba_distribution()MultiCategoricalDistribution.proba_distribution_net()MultiCategoricalDistribution.sample()
SquashedDiagGaussianDistributionStateDependentNoiseDistributionStateDependentNoiseDistribution.actions_from_params()StateDependentNoiseDistribution.entropy()StateDependentNoiseDistribution.get_noise()StateDependentNoiseDistribution.get_std()StateDependentNoiseDistribution.log_prob()StateDependentNoiseDistribution.log_prob_from_params()StateDependentNoiseDistribution.mode()StateDependentNoiseDistribution.proba_distribution()StateDependentNoiseDistribution.proba_distribution_net()StateDependentNoiseDistribution.sample()StateDependentNoiseDistribution.sample_weights()
TanhBijectorkl_divergence()make_proba_distribution()sum_independent_dims()
- malib.common.manager module
- malib.common.payoff_manager module
- malib.common.strategy_spec module
- malib.models package
- malib.remote package
- malib.rl package
- malib.rollout package
- malib.scenarios package
- malib.utils package
- Submodules
- malib.utils.data module
- malib.utils.episode module
EpisodeEpisode.ACC_REWARDEpisode.ACTIONEpisode.ACTION_DISTEpisode.ACTION_LOGITSEpisode.ACTION_MASKEpisode.ADVANTAGEEpisode.CUR_OBSEpisode.CUR_STATEEpisode.DONEEpisode.INFOEpisode.LAST_REWARDEpisode.NEXT_ACTION_MASKEpisode.NEXT_OBSEpisode.NEXT_STATEEpisode.PRE_DONEEpisode.PRE_REWARDEpisode.REWARDEpisode.RNN_STATEEpisode.STATE_ACTION_VALUEEpisode.STATE_VALUEEpisode.STATE_VALUE_TARGETEpisode.record()Episode.to_numpy()
NewEpisodeDictNewEpisodeList
- malib.utils.exploitability module
- malib.utils.general module
BufferDictdeep_update()flatten_dict()frozen_data()iter_dicts_recursively()iter_many_dicts_recursively()iterate_recursively()merge_dicts()tensor_cast()unflatten_dict()unflatten_list_dict()unflattened_lookup()update_configs()update_dataset_config()update_evaluation_config()update_global_evaluator_config()update_parameter_server_config()update_rollout_configs()update_training_config()
- malib.utils.logging module
- malib.utils.monitor module
- malib.utils.notations module
- malib.utils.preprocessor module
- malib.utils.replay_buffer module
- malib.utils.schedules module
- malib.utils.statistic module
- malib.utils.stopping_conditions module
- malib.utils.tasks_register module
- malib.utils.tianshou_batch module
- malib.utils.timing module
- malib.utils.typing module
Submodules
malib.registration module
- class malib.registration.Registry[source]
Bases:
objectGlobal registry of algorithms, models, preprocessors and environments
Examples
>>> # register custom model >>> Registry.register_custom_model("MyCustomModel", model_class) >>> # register custom policy >>> Registry.register_custom_policy("MyCustomPolicy", policy_class) >>> # register custom environment >>> Registry.register_custom_env("MyCustomEnvironment", environment_class) >>> # register custom algorithm >>> Registry.register_custom_algorithm( ... name="MyCustomAlgo", ... policy="registered_policy_name_or_cls", ... trainer="registered_trainer_name_or_cls", ... loss="registered_loss_name_or_cls") >>>
- static register_custom_algorithm(name: str, policy: Union[type, str], trainer: Union[type, str], loss: Optional[Union[type, str]] = None) None[source]
Register a custom algorithm by name.
- Parameters:
name – str, Name to register the algorithm under.
policy – Union[type, str], Python class or registered name of policy.
trainer – Union[type, str], Python class or registered name of trainer.
loss – Union[type, str], Python class or registered name of loss function.
- Returns:
- static register_custom_env(name: str, env_class: type) None[source]
Register a custom environment by name.
- Parameters:
name – str, Name to register the environment under.
env_class – type, Python class of the environment.