commonpower.control.configs.algorithms.MAPPOBaseConfig

class MAPPOBaseConfig(*, algorithm_name: str, seed: int, num_env_steps: int, cuda: bool = False, cuda_deterministic: bool = True, n_training_threads: int = 1, n_rollout_threads: int = 1, n_eval_rollout_threads: int = 1, episode_length: int = 24, share_policy: bool = False, use_centralized_V: bool = True, hidden_size: int = 64, layer_N: int = 1, use_ReLU: bool = True, use_popart: bool = False, use_valuenorm: bool = True, use_feature_normalization: bool = False, use_orthogonal: bool = True, gain: float = 0.01, use_naive_recurrent_policy: bool = False, use_recurrent_policy: bool = False, recurrent_N: int = 1, data_chunk_length: int = 10, lr: float = 0.0005, critic_lr: float = 0.0005, opti_eps: float = 1e-05, weight_decay: float = 0.0, ppo_epoch: int = 15, use_clipped_value_loss: bool = True, clip_param: float = 0.2, num_mini_batch: int = 1, entropy_coef: float = 0.01, value_loss_coef: float = 1.0, use_max_grad_norm: bool = True, max_grad_norm: float = 10.0, use_gae: bool = True, gamma: float = 0.99, gae_lambda: float = 0.95, stacked_frames: int = 1, use_proper_time_limits: bool = False, use_huber_loss: bool = True, use_value_active_masks: bool = False, use_policy_active_masks: bool = False, huber_delta: float = 10.0, use_linear_lr_decay: bool = False, log_interval: int = 1, use_eval: bool = False, eval_interval: int = 25, eval_episodes: int = 32, ifi: float = 0.1, penalty_factor: float = 0.0, log_std_init: float = 0.0)[source]

Bases: BaseModel

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Methods

construct

copy

Returns a copy of the model.

dict

from_orm

json

model_construct

Creates a new instance of the Model class with validated data.

model_copy

Usage docs: https://docs.pydantic.dev/2.10/concepts/serialization/#model_copy

model_dump

Usage docs: https://docs.pydantic.dev/2.10/concepts/serialization/#modelmodel_dump

model_dump_json

Usage docs: https://docs.pydantic.dev/2.10/concepts/serialization/#modelmodel_dump_json

model_json_schema

Generates a JSON schema for a model class.

model_parametrized_name

Compute the class name for parametrizations of generic classes.

model_post_init

Override this method to perform additional initialization after __init__ and model_construct.

model_rebuild

Try to rebuild the pydantic-core schema for the model.

model_validate

Validate a pydantic model instance.

model_validate_json

Usage docs: https://docs.pydantic.dev/2.10/concepts/json/#json-parsing

model_validate_strings

Validate the given object with string data against the Pydantic model.

parse_file

parse_obj

parse_raw

schema

schema_json

update_forward_refs

validate

Attributes

model_computed_fields

model_config

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_extra

Get extra fields set during validation.

model_fields

model_fields_set

Returns the set of fields that have been explicitly set on this model instance.

algorithm_name

seed

num_env_steps

cuda

cuda_deterministic

n_training_threads

n_rollout_threads

n_eval_rollout_threads

episode_length

share_policy

use_centralized_V

hidden_size

layer_N

use_ReLU

use_popart

use_valuenorm

use_feature_normalization

use_orthogonal

gain

use_naive_recurrent_policy

use_recurrent_policy

recurrent_N

data_chunk_length

lr

critic_lr

opti_eps

weight_decay

ppo_epoch

use_clipped_value_loss

clip_param

num_mini_batch

entropy_coef

value_loss_coef

use_max_grad_norm

max_grad_norm

use_gae

gamma

gae_lambda

stacked_frames

use_proper_time_limits

use_huber_loss

use_value_active_masks

use_policy_active_masks

huber_delta

use_linear_lr_decay

log_interval

use_eval

eval_interval

eval_episodes

ifi

penalty_factor

log_std_init

model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].