-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* training metaenvs (such as time-series envs) from yaml files * trial and error searching through param space * greenCrabEnv, greenCrabSimplifiedEnv, timeSeriesEnv * GreenCrabSimplifiedEnv * benchmark agents * utils subdirectory
- Loading branch information
Showing
22 changed files
with
303 additions
and
205 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 13 additions & 0 deletions
13
hyperpars/systematic-benchmarks/TQC-Nmem_1/6-tqc_nmem-1_bmk.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# stable-baselines3 configuration | ||
|
||
algo: "TQC" | ||
env_id: "GreenCrab-v2" | ||
n_envs: 12 | ||
tensorboard: "/home/rstudio/logs" | ||
total_timesteps: 1000000 | ||
config: {r: 0.7, imm: 500, problem_scale: 2000, action_reward_scale: 0.5, env_stoch: 0.1} | ||
use_sde: True | ||
id: "bmk-6" | ||
repo: "cboettig/rl-ecology" | ||
save_path: "/home/rstudio/saved_agents" | ||
progress_bar: False |
13 changes: 13 additions & 0 deletions
13
hyperpars/systematic-benchmarks/TQC-Nmem_1/7-tqc_nmem-1_bmk.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# stable-baselines3 configuration | ||
|
||
algo: "TQC" | ||
env_id: "GreenCrab-v2" | ||
n_envs: 12 | ||
tensorboard: "/home/rstudio/logs" | ||
total_timesteps: 1000000 | ||
config: {r: 0.9, imm: 500, problem_scale: 2000, action_reward_scale: 0.5, env_stoch: 0.1} | ||
use_sde: True | ||
id: "bmk-7" | ||
repo: "cboettig/rl-ecology" | ||
save_path: "/home/rstudio/saved_agents" | ||
progress_bar: False |
13 changes: 13 additions & 0 deletions
13
hyperpars/systematic-benchmarks/TQC-Nmem_1/8-tqc_nmem-1_bmk.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# stable-baselines3 configuration | ||
|
||
algo: "TQC" | ||
env_id: "GreenCrab-v2" | ||
n_envs: 12 | ||
tensorboard: "/home/rstudio/logs" | ||
total_timesteps: 1000000 | ||
config: {r: 1.1, imm: 500, problem_scale: 2000, action_reward_scale: 0.5, env_stoch: 0.1} | ||
use_sde: True | ||
id: "bmk-8" | ||
repo: "cboettig/rl-ecology" | ||
save_path: "/home/rstudio/saved_agents" | ||
progress_bar: False |
13 changes: 13 additions & 0 deletions
13
hyperpars/systematic-benchmarks/TQC-Nmem_1/9-tqc_nmem-1_bmk.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# stable-baselines3 configuration | ||
|
||
algo: "TQC" | ||
env_id: "GreenCrab-v2" | ||
n_envs: 12 | ||
tensorboard: "/home/rstudio/logs" | ||
total_timesteps: 1000000 | ||
config: {r: 1.5, imm: 500, problem_scale: 2000, action_reward_scale: 0.5, env_stoch: 0.1} | ||
use_sde: True | ||
id: "bmk-9" | ||
repo: "cboettig/rl-ecology" | ||
save_path: "/home/rstudio/saved_agents" | ||
progress_bar: False |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,19 @@ | ||
from rl4greencrab.invasive_ipm import invasive_IPM, invasive_IPM_v2 | ||
from rl4greencrab.ts_model import ts_env_v1, ts_env_v2 | ||
from rl4greencrab.util import sb3_train, sb3_train_v2, sb3_train_metaenv | ||
from rl4greencrab.envs.green_crab_ipm import greenCrabEnv, greenCrabSimplifiedEnv | ||
from rl4greencrab.envs.time_series import timeSeriesEnv | ||
from rl4greencrab.agents.const_action import constAction | ||
from rl4greencrab.agents.const_escapement import constEsc | ||
# from envs.util import sb3_train, sb3_train_v2, sb3_train_metaenv | ||
|
||
from gymnasium.envs.registration import register | ||
register(id="GreenCrab-v1", entry_point="rl4greencrab.invasive_ipm:invasive_IPM") | ||
register(id="GreenCrab-v2", entry_point="rl4greencrab.invasive_ipm:invasive_IPM_v2") | ||
register(id="TimeSeries-v1", entry_point="rl4greencrab.ts_model:ts_env_v1") | ||
register(id="TimeSeries-v2", entry_point="rl4greencrab.ts_model:ts_env_v2") | ||
register( | ||
id="GreenCrab", | ||
entry_point="rl4greencrab.green_crab_ipm:greenCrabEnv", | ||
) | ||
register( | ||
id="GreenCrabSimpl", | ||
entry_point="rl4greencrab.green_crab_ipm:greenCrabSimplifiedEnv" | ||
) | ||
register( | ||
id="TimeSeries", | ||
entry_point="rl4greencrab.time_series:TimeSeriesEnv", | ||
) |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
class constAction: | ||
def __init__(self, mortality=0, env = None, **kwargs): | ||
self.mortality = mortality | ||
self.action = 2 * self.mortality - 1 | ||
self.env = env | ||
|
||
def predict(self, observation): | ||
return self.action | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
class constEsc: | ||
def __init__(self, escapement, env = None): | ||
self.escapement = escapement | ||
self.env = env | ||
self.bound = 1 | ||
if self.env is not None: | ||
self.bound = self.env.bound | ||
|
||
def predict(self, observation): | ||
obs_nat_units = self.bound * self.to_01(observation) | ||
if obs_nat_units <= self.escapement or obs_nat_units <= 0: | ||
return -1 | ||
mortality = (obs_nat_units - self.escapement) / self.escapement | ||
return self.to_pm1(mortality) | ||
|
||
def to_01(self, val): | ||
return (val + 1 ) / 2 | ||
|
||
def to_pm1(self, val): | ||
return 2 * val - 1 | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.