duo_ai.core.config ================== .. py:module:: duo_ai.core.config Classes ------- .. autoapisummary:: duo_ai.core.config.MasterConfig Functions --------- .. autoapisummary:: duo_ai.core.config.configure Module Contents --------------- .. py:class:: MasterConfig Main configuration class for the Duo framework. This class holds all experiment-level configuration, including environment, policy, algorithm, evaluation, and coordination settings. :param name: Name of the experiment. Default is "default". :type name: str, optional :param device: Device index for CUDA. Default is 0. :type device: int, optional :param seed: Random seed for reproducibility. Default is 10. :type seed: int, optional :param env: Environment configuration or name. Default is "procgen". :type env: Any, optional :param policy: Policy configuration or name. Default is "PPOPolicy". :type policy: Any, optional :param algorithm: Algorithm configuration or name. Default is "PPOAlgorithm". :type algorithm: Any, optional :param evaluation: Evaluation configuration. Default is None. :type evaluation: Any, optional :param eval_name: Name for evaluation run. Default is None. :type eval_name: str, optional :param overwrite: Whether to overwrite existing experiment directory. Default is False. :type overwrite: bool, optional :param use_wandb: Whether to use Weights & Biases logging. Default is False. :type use_wandb: bool, optional :param experiment_dir: Path to the experiment directory. Default is "". :type experiment_dir: str, optional :param train_novice: Path to novice training checkpoint. Default is None. :type train_novice: str, optional :param train_expert: Path to expert training checkpoint. Default is None. :type train_expert: str, optional :param test_novice: Path to novice test checkpoint. Default is None. :type test_novice: str, optional :param test_expert: Path to expert test checkpoint. Default is None. :type test_expert: str, optional :param coordination: Coordination configuration. Default is None. :type coordination: Any, optional .. rubric:: Examples >>> config = MasterConfig(name="my_experiment", env="procgen", policy="PPOPolicy") .. py:attribute:: name :type: str :value: 'default' .. py:attribute:: device :type: int :value: 0 .. py:attribute:: seed :type: int :value: 10 .. py:attribute:: env :type: Any :value: 'procgen' .. py:attribute:: policy :type: Any :value: 'PPOPolicy' .. py:attribute:: algorithm :type: Any :value: 'PPOAlgorithm' .. py:attribute:: evaluation :type: Any :value: None .. py:attribute:: eval_mode :type: Optional[int] :value: None .. py:attribute:: eval_name :type: Optional[str] :value: None .. py:attribute:: overwrite :type: bool :value: False .. py:attribute:: use_wandb :type: bool :value: False .. py:attribute:: experiment_dir :type: str :value: '' .. py:attribute:: train_novice :type: Optional[str] :value: None .. py:attribute:: train_expert :type: Optional[str] :value: None .. py:attribute:: test_novice :type: Optional[str] :value: None .. py:attribute:: test_expert :type: Optional[str] :value: None .. py:attribute:: coordination :type: Any :value: None .. py:method:: __post_init__() -> None Post-initialization logic for MasterConfig. Converts string or dictionary fields for env, policy, algorithm, evaluation, and coordination into their respective configuration objects. :raises IndexError: If required keys are missing in configuration dictionaries. :raises ValueError: If configuration fields are not of expected types. .. rubric:: Examples >>> config = MasterConfig(env={"name": "procgen"}) >>> config.__post_init__() .. py:function:: configure(config: MasterConfig) -> None Set up experiment directory, logging, random seeds, and global variables for the experiment. :param config: The experiment configuration object. :type config: MasterConfig :rtype: None :raises FileExistsError: If the experiment directory exists and overwrite is not set. .. rubric:: Examples >>> configure(config)