Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Branin and Hartmann proxies #297

Merged
merged 21 commits into from
Mar 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
31b662f
create box dirs for grid or cube proxies and move corners into it
alexhernandezgarcia Jun 1, 2023
9cc95bb
wip: branin and hartmann oracles
alexhernandezgarcia Jun 1, 2023
e2bea38
adapt path of corners proxy
alexhernandezgarcia Jun 1, 2023
eb766d5
branin and hartmann config!
alexhernandezgarcia Jun 1, 2023
2111b80
add botorch to setup
alexhernandezgarcia Jun 1, 2023
22b7f34
remove higher_is_better variable as well as proxy_factor. outputs of …
alexhernandezgarcia Jun 2, 2023
e970d1b
hernanga
alexhernandezgarcia Jun 2, 2023
1f44cb9
branin done and working fine in principle
alexhernandezgarcia Jun 2, 2023
02b9d74
imports order
alexhernandezgarcia Jun 2, 2023
8b737e2
docstring
alexhernandezgarcia Jun 6, 2023
359394b
Merge branch 'batch-v2' into branin_hartmann
alexhernandezgarcia Jul 26, 2023
31eeb0b
Add types and improve docstring
alexhernandezgarcia Mar 4, 2024
bd9d2be
Fix missing import
alexhernandezgarcia Mar 4, 2024
8f7bc17
Resolve main merge conflicts
alexhernandezgarcia Mar 4, 2024
329241b
black and isort
alexhernandezgarcia Mar 4, 2024
16467e5
Eliminate legacy variable func
alexhernandezgarcia Mar 4, 2024
25ece5d
corners -> box/corners
alexhernandezgarcia Mar 4, 2024
a83fc92
Add botorch to base dependencies because it is used by Branin and Har…
alexhernandezgarcia Mar 4, 2024
a7a1777
Add min property to Branin and Hartmann proxies and extend docstring
alexhernandezgarcia Mar 4, 2024
173f99f
Experiment config files for Branin and Hartmann
alexhernandezgarcia Mar 4, 2024
01a12e3
Remove plotting method of Branin proxy
alexhernandezgarcia Mar 13, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion config/env/ccube.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ _target_: gflownet.envs.cube.ContinuousCube

id: ccube
continuous: True
func: corners
# Dimensions of hypercube
n_dim: 2
# Constant to restrict interval of test sets
Expand Down
1 change: 0 additions & 1 deletion config/env/ctorus.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ defaults:
_target_: gflownet.envs.ctorus.ContinuousTorus

id: ctorus
func: sincos
# Dimensions of hypertorus
n_dim: 2
policy_encoding_dim_per_angle: null
Expand Down
1 change: 0 additions & 1 deletion config/env/grid.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ defaults:
_target_: gflownet.envs.grid.Grid

id: grid
func: corners
# Dimensions of hypergrid
n_dim: 2
# Number of cells per dimension
Expand Down
1 change: 0 additions & 1 deletion config/env/htorus.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ _target_: gflownet.envs.htorus.HybridTorus

id: ctorus
continuous: True
func: sincos
# Dimensions of hypertorus
n_dim: 2
policy_encoding_dim_per_angle: null
Expand Down
1 change: 0 additions & 1 deletion config/env/torus.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ defaults:
_target_: gflownet.envs.torus.Torus

id: torus
func: sincos
# Dimensions of hypertorus
n_dim: 2
# Number of angles per dimension
Expand Down
75 changes: 75 additions & 0 deletions config/experiments/ccube/branin.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
# @package _global_
# A configuration that works well with the Branin proxy.
# wandb: https://wandb.ai/alexhg/Branin/runs/xlxfdc6k

defaults:
- override /env: ccube
- override /gflownet: trajectorybalance
- override /proxy: box/branin
- override /logger: wandb
- override /user: alex

# Environment
env:
n_dim: 2
n_comp: 5
beta_params_min: 0.1
beta_params_max: 100.0
min_incr: 0.1
fixed_distr_params:
beta_weights: 1.0
beta_alpha: 10.0
beta_beta: 10.0
bernoulli_eos_prob: 0.1
bernoulli_bts_prob: 0.1
random_distr_params:
beta_weights: 1.0
beta_alpha: 10.0
beta_beta: 10.0
bernoulli_eos_prob: 0.1
bernoulli_bts_prob: 0.1
reward_func: identity

# GFlowNet hyperparameters
gflownet:
random_action_prob: 0.1
optimizer:
batch_size:
forward: 100
lr: 0.0001
z_dim: 16
lr_z_mult: 100
n_train_steps: 10000

# Policy
policy:
forward:
type: mlp
n_hid: 128
n_layers: 2
checkpoint: forward
backward:
shared_weights: True
checkpoint: backward

# WandB
logger:
do:
online: true
lightweight: True
project_name: "branin"
tags:
- gflownet
- continuous
- ccube
- branin
test:
period: 500
n: 1000
checkpoints:
period: 500

# Hydra
hydra:
run:
dir: ${user.logdir.root}/ccube/branin/${now:%Y-%m-%d_%H-%M-%S}
2 changes: 1 addition & 1 deletion config/experiments/ccube/corners.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
defaults:
- override /env: ccube
- override /gflownet: trajectorybalance
- override /proxy: corners
- override /proxy: box/corners
- override /logger: wandb
- override /user: alex

Expand Down
78 changes: 78 additions & 0 deletions config/experiments/ccube/hartmann.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
# @package _global_
# A configuration that works well with the Hartmann proxy.
# wandb: https://wandb.ai/alexhg/Hartmann/runs/9l4ry4gm

defaults:
- override /env: ccube
- override /gflownet: trajectorybalance
- override /proxy: box/hartmann
- override /logger: wandb
- override /user: alex

# Environment
env:
n_dim: 6
n_comp: 5
beta_params_min: 0.1
beta_params_max: 100.0
min_incr: 0.1
fixed_distr_params:
beta_weights: 1.0
beta_alpha: 10.0
beta_beta: 10.0
bernoulli_eos_prob: 0.1
bernoulli_bts_prob: 0.1
random_distr_params:
beta_weights: 1.0
beta_alpha: 10.0
beta_beta: 10.0
bernoulli_eos_prob: 0.1
bernoulli_bts_prob: 0.1
reward_func: identity

# GFlowNet hyperparameters
gflownet:
random_action_prob: 0.1
optimizer:
batch_size:
forward: 100
lr: 0.0001
z_dim: 16
lr_z_mult: 100
n_train_steps: 10000

# Policy
policy:
forward:
type: mlp
n_hid: 256
n_layers: 3
checkpoint: forward
backward:
shared_weights: False
type: mlp
n_hid: 256
n_layers: 3
checkpoint: backward

# WandB
logger:
do:
online: true
lightweight: True
project_name: "hartmann"
tags:
- gflownet
- continuous
- ccube
- hartmann
test:
period: 500
n: 1000
checkpoints:
period: 500

# Hydra
hydra:
run:
dir: ${user.logdir.root}/ccube/hartmann/${now:%Y-%m-%d_%H-%M-%S}
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ shared:
output_csv: ccube_test.csv
output_pkl: ccube_test.pkl
# Proxy
proxy: corners
proxy: box/corners
# GFlowNet config
gflownet:
__value__: trajectorybalance
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ shared:
output_csv: ccube_test.csv
output_pkl: ccube_test.pkl
# Proxy
proxy: corners
proxy: box/corners
# GFlowNet config
gflownet:
__value__: trajectorybalance
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ shared:
output_csv: ccube_test.csv
output_pkl: ccube_test.pkl
# Proxy
proxy: corners
proxy: box/corners
# GFlowNet config
gflownet:
__value__: trajectorybalance
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ shared:
output_csv: ccube_test.csv
output_pkl: ccube_test.pkl
# Proxy
proxy: corners
proxy: box/corners
# GFlowNet config
gflownet:
__value__: trajectorybalance
Expand Down
2 changes: 1 addition & 1 deletion config/experiments/clatticeparams/clatticeparams_owl.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
defaults:
- override /env: crystals/clattice_parameters
- override /gflownet: trajectorybalance
- override /proxy: corners
- override /proxy: box/corners
- override /logger: wandb
- override /user: alex

Expand Down
70 changes: 70 additions & 0 deletions config/experiments/grid/branin.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
# @package _global_
# 100x100 grid with a configuration that works well with the Branin proxy.
# wandb: https://wandb.ai/alexhg/Branin/runs/0ujb3hwl

defaults:
- override /env: grid
- override /gflownet: trajectorybalance
- override /proxy: box/branin
- override /logger: wandb
- override /user: alex

# Environment
env:
n_dim: 2
length: 100
max_increment: 1
max_dim_per_action: 1
reward_func: identity
# Buffer
buffer:
train: null
test:
type: uniform
n: 1000
seed: 0
output_csv: grid_test.csv
output_pkl: grid_test.pkl

# GFlowNet hyperparameters
gflownet:
random_action_prob: 0.01
optimizer:
batch_size:
forward: 100
lr: 0.0001
z_dim: 16
lr_z_mult: 100
n_train_steps: 10000

# Policy
policy:
forward:
type: mlp
n_hid: 128
n_layers: 2
checkpoint: forward
backward:
shared_weights: True
checkpoint: backward

# WandB
logger:
do:
online: true
lightweight: True
project_name: "branin"
tags:
- gflownet
- grid
- branin
test:
period: 500
n: 1000
checkpoints:
period: 500

# Hydra
hydra:
run:
dir: ${user.logdir.root}/grid/branin/${now:%Y-%m-%d_%H-%M-%S}
73 changes: 73 additions & 0 deletions config/experiments/grid/hartmann.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
# @package _global_
# 10^6 grid with a configuration that works well with the Hartmann proxy.
# wandb: https://wandb.ai/alexhg/Hartmann/runs/1l1y5xwb

defaults:
- override /env: grid
- override /gflownet: trajectorybalance
- override /proxy: box/hartmann
- override /logger: wandb
- override /user: alex

# Environment
env:
n_dim: 6
length: 10
max_increment: 1
max_dim_per_action: 1
reward_func: identity
# Buffer
buffer:
train: null
test:
type: uniform
n: 1000
seed: 0
output_csv: grid_test.csv
output_pkl: grid_test.pkl

# GFlowNet hyperparameters
gflownet:
random_action_prob: 0.01
optimizer:
batch_size:
forward: 100
lr: 0.0001
z_dim: 16
lr_z_mult: 100
n_train_steps: 10000

# Policy
policy:
forward:
type: mlp
n_hid: 256
n_layers: 3
checkpoint: forward
backward:
shared_weights: False
type: mlp
n_hid: 256
n_layers: 3
checkpoint: backward

# WandB
logger:
do:
online: true
lightweight: True
project_name: "hartmann"
tags:
- gflownet
- grid
- hartmann
test:
period: 500
n: 1000
checkpoints:
period: 500

# Hydra
hydra:
run:
dir: ${user.logdir.root}/grid/hartmann/${now:%Y-%m-%d_%H-%M-%S}
Loading
Loading