Skip to content

Commit

Permalink
workable sampling config
Browse files Browse the repository at this point in the history
  • Loading branch information
thatguy11325 committed Oct 30, 2024
1 parent c3f314a commit adc7919
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 21 deletions.
40 changes: 29 additions & 11 deletions pokemonred_puffer/sweep.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import typer
from carbs import (
CARBS,
LogitSpace,
Param,
ParamDictType,
ParamType,
Expand Down Expand Up @@ -98,17 +99,34 @@ def launch_sweep(
params = sweep_config_to_params(base_config, sweep_config)
for param in params:
print(f"Checking param: {param}")
assert (
param.space.min
< param.search_center - param.space.scale
< param.search_center + param.space.scale
< param.space.max
), (
f"{param.space.min} "
f"< {param.search_center} - {param.space.scale} "
f"< {param.search_center} + {param.space.scale} "
f"< {param.space.max}"
)
if isinstance(param.space, LogitSpace):
assert (
0.0
<= param.space.min
< param.search_center - param.space.scale
< param.search_center + param.space.scale
< param.space.max
<= 1.0
), (
"0.0 "
f"<= {param.space.min} "
f"< {param.search_center} - {param.space.scale} "
f"< {param.search_center} + {param.space.scale} "
f"< {param.space.max} "
f"<= 1.0"
)
else:
assert (
param.space.min
< param.search_center - param.space.scale
< param.search_center + param.space.scale
< param.space.max
), (
f"{param.space.min} "
f"< {param.search_center} - {param.space.scale} "
f"< {param.search_center} + {param.space.scale} "
f"< {param.space.max}"
)

config = CARBSParams(
better_direction_sign=1,
Expand Down
20 changes: 10 additions & 10 deletions sweep-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,28 +4,28 @@ env:
min: 10240
max: 81920
is_integer: True
scale: 10000
scale: 2500

train:
total_timesteps:
carbs.utils.LogSpace:
min: 500_000_000
max: 10_000_000_000
is_integer: True
scale: 100_000_000
scale: 10_000_000
learning_rate:
carbs.utils.LogSpace:
min: 1.0e-5
max: 1.0e-3
scale: 1.0e-4
gamma:
carbs.utils.LogitSpace:
min: .5
min: .75
max: 1.0
scale: .0005
gae_lambda:
carbs.utils.LogitSpace:
min: .5
min: .75
max: 1.0
scale: .01
ent_coef:
Expand All @@ -51,22 +51,22 @@ rewards:
carbs.utils.LogSpace:
min: 1.0e-3
max: 10.0
scale: 2.0
scale: 1.0
caught_pokemon:
carbs.utils.LogSpace:
min: 1.0e-3
max: 10.0
scale: 2.0
scale: 1.0
moves_obtained:
carbs.utils.LogSpace:
min: 1.0e-3
max: 10.0
scale: 2.0
scale: 1.0
hm_count:
carbs.utils.LogSpace:
min: 1.0e-3
max: 15.0
scale: 2.0
scale: 1.0
level:
carbs.utils.LogSpace:
min: 1.0e-5
Expand All @@ -91,12 +91,12 @@ rewards:
carbs.utils.LogSpace:
min: 1.0e-3
max: 10.0
scale: 2.0
scale: 1.0
required_item:
carbs.utils.LogSpace:
min: 1.0e-3
max: 10.0
scale: 2.0
scale: 1.0
useful_item:
carbs.utils.LogSpace:
min: 1.0e-3
Expand Down

0 comments on commit adc7919

Please sign in to comment.