diff --git a/configs/deep_cfr/deep_cfr_selfplay_full_depth_slot_playability_unbounded.yaml b/configs/deep_cfr/deep_cfr_selfplay_full_depth_slot_playability_unbounded.yaml new file mode 100644 index 0000000..941bec1 --- /dev/null +++ b/configs/deep_cfr/deep_cfr_selfplay_full_depth_slot_playability_unbounded.yaml @@ -0,0 +1,94 @@ +run: + experiment_name: lost_cities_deep_cfr_selfplay_full_depth_slot_playability_unbounded + iterations: null + seed: 79 + max_iterations: null + max_hours: null + device: cuda + use_amp: false + +rules: + n_colors: 5 + n_ranks: 9 + min_rank: 2 + n_handshakes: 3 + hand_size: 8 + expedition_penalty: -20 + bonus_threshold: 8 + bonus_amount: 20 + +encoding: + derived_playability: true + slot_aware_playability: true + +network: + hidden_size: 256 + num_layers: 3 + activation: relu + +traversal: + traversals_per_player: 70 + strategy_sample_interval: 1 + store_strategy_on_opponent_nodes: false + store_strategy_on_traverser_nodes: true + max_depth: null + max_nodes_per_traversal: 1000 + opponent_policy: self_play_league + cutoff_value_mode: score_diff + cutoff_rollouts: 0 + cutoff_rollout_policy: random + cutoff_rollout_max_steps: 300 + progress_every_traversals: 10 + num_workers: 8 + traversal_worker_chunk_size: 8 + regret_matching_epsilon: 0.0001 + outcome_sampling_epsilon: 0.2 + outcome_sampling_value_clip: 500 + outcome_unsampled_regret: zero + endpoint_depth_bucket_width: 100 + endpoint_depth_bucket_max: 1000 + +self_play: + current_weight: 0.5 + recent_weight: 0.3 + older_weight: 0.2 + anchor_weight: 0.0 + recent_window: 5 + max_snapshots: 20 + snapshot_every: 1 + +optimization: + advantage_batch_size: 1024 + strategy_batch_size: 1024 + advantage_updates_per_iteration: 256 + strategy_updates_per_iteration: 256 + learning_rate: 0.00003 + weight_decay: 0.0001 + grad_clip: 1.0 + +memory: + advantage_capacity: 2000000 + strategy_capacity: 2000000 + +evaluation: + eval_every: 5 + games: 100 + batch_size: 64 + device: trainer + num_workers: 4 + max_steps: 1000 + on_max_steps: score_diff + opponents: + - random + - passive_discard + - safe_heuristic + - safe_heuristic_loose + - safe_heuristic_strict + - noisy_safe + +checkpoint: + directory: runs/deep_cfr/deep_cfr_selfplay_full_depth_slot_playability_unbounded + save_every_iteration: false + save_iteration_interval: 100 + save_latest_only: false + progress_interval_seconds: 20.0 diff --git a/src/coolrl_lost_cities/games/classic/deep_cfr/config.py b/src/coolrl_lost_cities/games/classic/deep_cfr/config.py index 1e17c58..dbd8e37 100644 --- a/src/coolrl_lost_cities/games/classic/deep_cfr/config.py +++ b/src/coolrl_lost_cities/games/classic/deep_cfr/config.py @@ -18,7 +18,7 @@ class StrictModel(BaseModel): class RunConfig(StrictModel): experiment_name: str = "deep_cfr" - iterations: int = 1 + iterations: int | None = 1 max_iterations: int | None = None max_hours: float | None = None seed: int = 1 diff --git a/src/coolrl_lost_cities/games/classic/deep_cfr/trainer.py b/src/coolrl_lost_cities/games/classic/deep_cfr/trainer.py index 4808498..a07710c 100644 --- a/src/coolrl_lost_cities/games/classic/deep_cfr/trainer.py +++ b/src/coolrl_lost_cities/games/classic/deep_cfr/trainer.py @@ -534,6 +534,8 @@ class DeepCFRTrainer: return max(self.iteration, int(self.config.run.max_iterations)) if self.config.run.max_hours is not None: return 2**31 - 1 + if self.config.run.iterations is None: + return 2**31 - 1 return self.iteration + self.config.run.iterations def _time_limit_reached(self, run_started: float) -> bool: