-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathcoingame_maa2c_mdp_sctde.yml
More file actions
116 lines (105 loc) · 3.35 KB
/
Copy pathcoingame_maa2c_mdp_sctde.yml
File metadata and controls
116 lines (105 loc) · 3.35 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
experiment:
roots:
root_dir: &root_dir '../experiment_output/coingame_maa2c_mdp_sctde'
session_dir: &session_dir !join [*root_dir, '/', '{datetime_session:%Y%m%dT%H%M%S}']
checkpoint_root: !join [*root_dir, '/', 'checkpoints']
# Filenames to use for saving results at the end of training.
save:
metrics_file: &metrics_file !join [*session_dir, '/', 'metrics-{round}.json']
model_files:
- name: &actor_name "actor-classical-shared"
filepath: &actor_file !join [*session_dir, '/', 'actor-{round}.weights.h5']
save_weights_only: &actor_weight_only_flag True
- name: &critic_name "critic-classical-joint"
filepath: &critic_file !join [*session_dir, '/', 'critic-{round}.weights.h5']
save_weights_only: &critic_weight_only_flag True
# Training parameters.
train:
n_episodes: 3000
callbacks:
- func: eqmarl.AlgorithmResultCheckpoint
params:
filepath: *metrics_file
save_freq: 100
verbose: True
- func: eqmarl.AlgorithmModelCheckpoint
params:
model_name: *actor_name
filepath: *actor_file
save_weights_only: *actor_weight_only_flag
save_freq: 100
verbose: True
- func: eqmarl.AlgorithmModelCheckpoint
params:
model_name: *critic_name
filepath: *critic_file
save_weights_only: *critic_weight_only_flag
save_freq: 100
verbose: True
# Plotting parameters.
plot:
plotargs:
plot_data: mean
# error_method: minmax
error_method: std
figsize: [10,8]
mosaic: [[undiscounted_reward, coins_collected], [own_coins_collected, own_coin_rate]]
axes:
undiscounted_reward:
title: Score
xlabel: epoch
ylabel: value
coins_collected:
title: Coins Collected
xlabel: epoch
ylabel: value
own_coins_collected:
title: Own Coins Collected
xlabel: epoch
ylabel: value
own_coin_rate:
title: Own Coin Rate
xlabel: epoch
ylabel: value
# The algorithm to run.
# The keys within the `init_params` key are used with direct substitution in the class initializer.
# This includes the following definitions:
# - Environment
# - Models
# - Optimizers
algorithm:
init_func: eqmarl.algorithms.MAA2C
init_params:
gamma: 0.99
alpha: 0.001
episode_metrics_callback: eqmarl.environments.coin_game.episode_metrics_callback
env:
func: eqmarl.environments.coin_game.vector_coin_game_make
params:
domain_name: CoinGame-2
gamma: 0.99
time_limit: 50
model_actor:
init_func: eqmarl.models.generate_model_CoinGame2_actor_classical_shared_mdp
init_params:
n_actions: 4
units:
- 12
name: *actor_name
build_shape: [null, 36]
optimizer_actor:
func: tensorflow.keras.optimizers.Adam
params:
learning_rate: 1.0e-3
model_critic:
init_func: eqmarl.models.generate_model_CoinGame2_critic_classical_joint_mdp
init_params:
n_agents: 2
units:
- 12
name: *critic_name
build_shape: [null, 2, 36]
optimizer_critic:
func: tensorflow.keras.optimizers.Adam
params:
learning_rate: 1.0e-3