Skip to content

Commit

Permalink
Merge pull request #7 from boettiger-lab/Niki
Browse files Browse the repository at this point in the history
Niki
  • Loading branch information
nicolalove committed Jun 7, 2024
2 parents b394d00 + bf9d6dd commit 62f9f9e
Show file tree
Hide file tree
Showing 5 changed files with 1,407 additions and 75 deletions.
19 changes: 12 additions & 7 deletions hyperpars/ppo-caribou.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,18 @@ algo_config:

# env
env_id: "CaribouScipy"
config: {}
config: {"r_b":.25 } #this is what is passed into the creation of the environment, could pass diff param values here to change the defaults (instead of messing with the params defined in caribou_ode.py)
n_envs: 12

# io
repo: "cboettig/rl-ecology"
save_path: "../saved_agents"

tensorboard: "/home/rstudio/logs"
#total_timesteps: 50000
total_timesteps: 5000000
use_sde: True
repo: "boettiger-lab/rl4eco"
save_path: "./saved_agents"
id: "3"
#rppo - ppo that has memory (should be better than PPO but hard to train lol)
#td3 - giving some weird errors
#tqc is actually better if we can give it enough time to run
# misc
# id: ""
additional_imports: ["torch"]
additional_imports: ["torch"]
1,326 changes: 1,326 additions & 0 deletions notebooks/4-15-Meeting-Notebook.ipynb

Large diffs are not rendered by default.

16 changes: 14 additions & 2 deletions notebooks/compare-solutions.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,22 @@
"cells": [
{
"cell_type": "code",
"execution_count": 3,
"execution_count": 1,
"id": "cff325f3-71d3-469c-aec5-e340219ce0e4",
"metadata": {},
"outputs": [],
"outputs": [
{
"ename": "ModuleNotFoundError",
"evalue": "No module named 'rl4eco'",
"output_type": "error",
"traceback": [
"\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
"\u001b[0;31mModuleNotFoundError\u001b[0m Traceback (most recent call last)",
"Cell \u001b[0;32mIn[1], line 8\u001b[0m\n\u001b[1;32m 6\u001b[0m \u001b[38;5;28;01mimport\u001b[39;00m \u001b[38;5;21;01mnumpy\u001b[39;00m \u001b[38;5;28;01mas\u001b[39;00m \u001b[38;5;21;01mnp\u001b[39;00m\n\u001b[1;32m 7\u001b[0m \u001b[38;5;28;01mfrom\u001b[39;00m \u001b[38;5;21;01mplotnine\u001b[39;00m \u001b[38;5;28;01mimport\u001b[39;00m geom_point, ggplot, aes, geom_density, geom_bar\n\u001b[0;32m----> 8\u001b[0m \u001b[38;5;28;01mfrom\u001b[39;00m \u001b[38;5;21;01mrl4eco\u001b[39;00m\u001b[38;5;21;01m.\u001b[39;00m\u001b[38;5;21;01mutils\u001b[39;00m \u001b[38;5;28;01mimport\u001b[39;00m load_hf_agent\n\u001b[1;32m 9\u001b[0m \u001b[38;5;28;01mfrom\u001b[39;00m \u001b[38;5;21;01mrl4caribou\u001b[39;00m \u001b[38;5;28;01mimport\u001b[39;00m Caribou\n",
"\u001b[0;31mModuleNotFoundError\u001b[0m: No module named 'rl4eco'"
]
}
],
"source": [
"import ibis\n",
"from ibis import _\n",
Expand Down
77 changes: 33 additions & 44 deletions notebooks/policy-evaluation.ipynb

Large diffs are not rendered by default.

44 changes: 22 additions & 22 deletions src/rl4caribou/envs/caribou_ode.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,35 +49,35 @@ def ode_func(y, t, effort, p):
##
## Param vals taken from https://doi.org/10.1016/j.ecolmodel.2019.108891
##
am = {"current": 15.32, "full_rest": 11.00}
ab = {"current": 51.45, "full_rest": 26.39}
#am = {"current": 15.32, "full_rest": 11.00}
#ab = {"current": 51.45, "full_rest": 26.39}

parameters = {
"r_m": np.float32(0.39),
"r_b": np.float32(0.30),
#parameters = {
# "r_m": np.float32(0.39),
# "r_b": np.float32(0.30),
#
"alpha_mm": np.float32(1),
"alpha_bb": np.float32(1),
"alpha_bm": np.float32(1),
"alpha_mb": np.float32(1),
# "alpha_mm": np.float32(1),
# "alpha_bb": np.float32(1),
# "alpha_bm": np.float32(1),
# "alpha_mb": np.float32(1),
#
"a_M": am["current"],
"a_B": ab["current"],
# "a_M": am["current"],
# "a_B": ab["current"],
#
"K_m": np.float32(1.1),
"K_b": np.float32(0.40),
# "K_m": np.float32(1.1),
# "K_b": np.float32(0.40),
#
"h_M": np.float32(0.112),
"h_B": np.float32(0.112),
# "h_M": np.float32(0.112),
# "h_B": np.float32(0.112),
#
"x": np.float32(2),
"u": np.float32(1),
"d": np.float32(1),
# "x": np.float32(2),
# "u": np.float32(1),
# "d": np.float32(1),
#
"sigma_M": np.float32(0.05),
"sigma_B": np.float32(0.05),
"sigma_W": np.float32(0.05),
}
# "sigma_M": np.float32(0.05),
# "sigma_B": np.float32(0.05),
# "sigma_W": np.float32(0.05),
#}
#
# computed using scipy's fsolve (coordinates where d Pops / dt = 0)
singularities = [
Expand Down

0 comments on commit 62f9f9e

Please sign in to comment.