Skip to content

Commit 2a0c38b

Browse files
authored
Add configs for CodeCraft allied_wealth task (#216)
1 parent 5a3c2de commit 2a0c38b

File tree

4 files changed

+116
-3
lines changed

4 files changed

+116
-3
lines changed
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
// https://wandb.ai/entity-neural-network/enn-ppo/reports/Allied-Wealth-baselines--VmlldzoxNzgyOTk1
2+
ExperimentConfig(
3+
version: 0,
4+
env: (
5+
id: "CodeCraft",
6+
),
7+
rollout: (
8+
num_envs: 256,
9+
steps: 64,
10+
),
11+
optim: (
12+
max_grad_norm: 10,
13+
update_epochs: 3,
14+
lr: 0.00044,
15+
bs: 1024,
16+
anneal_lr: false,
17+
),
18+
ppo: (
19+
anneal_entropy: true,
20+
gamma: 0.9890351625500452,
21+
ent_coef: 1e-05,
22+
vf_coef: 3.7,
23+
),
24+
net: (
25+
d_model: 256,
26+
n_layer: 1,
27+
n_head: 2,
28+
relpos_encoding: (
29+
extent: [3, 2],
30+
position_features: ["x", "y"],
31+
radial: true,
32+
distance: true,
33+
rotation_vec_features: ["orientation_x", "orientation_y"],
34+
interpolate: true,
35+
scale: 1000.0,
36+
),
37+
),
38+
total_timesteps: 2000000,
39+
)
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
// https://wandb.ai/entity-neural-network/enn-ppo/reports/Allied-Wealth-baselines--VmlldzoxNzgyOTk1
2+
ExperimentConfig(
3+
version: 0,
4+
env: (
5+
id: "CodeCraft",
6+
),
7+
rollout: (
8+
num_envs: 256,
9+
steps: 64,
10+
),
11+
optim: (
12+
max_grad_norm: 10,
13+
update_epochs: 3,
14+
lr: 0.00044,
15+
bs: 1024,
16+
anneal_lr: false,
17+
),
18+
ppo: (
19+
anneal_entropy: true,
20+
gamma: 0.9890351625500452,
21+
ent_coef: 1e-05,
22+
vf_coef: 3.7,
23+
),
24+
net: (
25+
d_model: 256,
26+
n_layer: 1,
27+
n_head: 2,
28+
relpos_encoding: (
29+
extent: [8],
30+
position_features: ["x", "y"],
31+
key_relpos_projection: true,
32+
value_relpos_projection: true,
33+
rotation_vec_features: ["orientation_x", "orientation_y"],
34+
radial: true,
35+
),
36+
),
37+
total_timesteps: 2000000,
38+
)
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
// https://wandb.ai/entity-neural-network/enn-ppo/reports/Allied-Wealth-baselines--VmlldzoxNzgyOTk1
2+
ExperimentConfig(
3+
version: 0,
4+
env: (
5+
id: "CodeCraft",
6+
),
7+
rollout: (
8+
num_envs: 256,
9+
steps: 64,
10+
),
11+
optim: (
12+
max_grad_norm: 10,
13+
update_epochs: 3,
14+
lr: 0.00044,
15+
bs: 1024,
16+
anneal_lr: false,
17+
),
18+
ppo: (
19+
anneal_entropy: true,
20+
gamma: 0.9890351625500452,
21+
ent_coef: 1e-05,
22+
vf_coef: 3.7,
23+
),
24+
net: (
25+
translation: (
26+
reference_entity: "ally",
27+
position_features: ["x", "y"],
28+
rotation_vec_features: ["orientation_x", "orientation_y"],
29+
add_dist_feature: true,
30+
),
31+
d_model: 256,
32+
n_layer: 1,
33+
n_head: 2,
34+
),
35+
total_timesteps: 2000000,
36+
)

rogue_net/rogue_net/translate_positions.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ def transform_obs_space(self, obs_space: ObsSpace) -> ObsSpace:
122122
if self.add_dist_feature:
123123
obs_space = deepcopy(obs_space)
124124
for entity_name in self.feature_indices.keys():
125-
obs_space.entities[entity_name].features.append(
126-
"TranslatePositions.distance"
127-
)
125+
features = list(obs_space.entities[entity_name].features)
126+
features.append("TranslatePositions.distance")
127+
obs_space.entities[entity_name].features = features
128128
return obs_space

0 commit comments

Comments
 (0)