learner¶
- class xuance.torch.learners.learner.Learner(config: Namespace, policy: torch.nn.Module, callback)[source]¶
Bases:
ABC
- class xuance.torch.learners.learner.LearnerMAS(config: Namespace, model_keys: List[str], agent_keys: List[str], policy: torch.nn.Module, callback)[source]¶
Bases:
Learner- build_training_data(sample: dict | None, use_parameter_sharing: bool | None = False, use_actions_mask: bool | None = False, use_global_state: bool | None = False)[source]¶
Prepare the training data.
- Parameters:
sample (dict) – The raw sampled data.
use_parameter_sharing (bool) – Whether to use parameter sharing for individual agent models.
use_actions_mask (bool) – Whether to use actions mask for unavailable actions.
use_global_state (bool) – Whether to use global state.
- Returns:
The formatted sampled data.
- Return type:
sample_Tensor (dict)