Skip to content

Commit

Permalink
Merge branch 'main' into 313-update-readme-components
Browse files Browse the repository at this point in the history
  • Loading branch information
engmubarak48 committed Jun 11, 2024
2 parents 92bf362 + d741e08 commit d107305
Show file tree
Hide file tree
Showing 128 changed files with 11,609 additions and 7,758 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ This repository has been used in at least the following research articles:

Bibtex Format

```txt
```text
@misc{hernandez-garcia2024,
author = {Hernandez-Garcia, Alex and Saxena, Nikita and Volokhova, Alexandra and Koziarski, Michał and Sharma, Divya and Viviano, Joseph D and Carrier, Pierre Luc and Schmidt, Victor},
title = {gflownet},
Expand Down
2 changes: 0 additions & 2 deletions config/env/alaninedipeptide.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,3 @@ buffer:
test:
type: grid
n: 1000
output_csv: alaninedipeptide_test.csv
output_pkl: alaninedipeptide_test.pkl
3 changes: 0 additions & 3 deletions 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 Expand Up @@ -35,5 +34,3 @@ buffer:
test:
type: grid
n: 900
output_csv: ccube_test.csv
output_pkl: ccube_test.pkl
27 changes: 0 additions & 27 deletions config/env/crystals/ccrystal.yaml

This file was deleted.

43 changes: 0 additions & 43 deletions config/env/crystals/clattice_parameters.yaml

This file was deleted.

2 changes: 0 additions & 2 deletions config/env/crystals/composition.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,5 @@ buffer:
data_path: null
train:
type: all
output_csv: composition_train.csv
test:
type: all
output_csv: composition_test.csv
24 changes: 11 additions & 13 deletions config/env/crystals/crystal.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,27 +3,25 @@ defaults:

_target_: gflownet.envs.crystals.crystal.Crystal

# Composition parameters
# Composition config
id: crystal
composition_kwargs:
elements: 89
max_atoms: 20
max_atom_i: 16
# Lattice parameters config
lattice_parameters_kwargs:
min_length: 1.0
max_length: 5.0
min_angle: 30.0
max_length: 350.0
min_angle: 50.0
max_angle: 150.0
grid_size: 10
# Space group config
space_group_kwargs:
space_groups_subset: null
# Stoichiometry <-> space group check
do_stoichiometry_sg_check: False
do_composition_to_sg_constraints: True
self.do_sg_to_lp_constraints: True

# Buffer
buffer:
data_path: null
train:
type: all
output_csv: crystal_train.csv
test:
type: all
output_csv: crystal_test.csv
train: null
test: null
35 changes: 24 additions & 11 deletions config/env/crystals/lattice_parameters.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,24 +5,37 @@ _target_: gflownet.envs.crystals.lattice_parameters.LatticeParameters

id: lattice_parameters

# Lattice system
lattice_system: triclinic
# Allowed ranges of size and angles
min_length: 1.0
max_length: 350.0
min_angle: 50.0
max_angle: 150.0
grid_size: 10
max_increment: 1

# Policy
min_incr: 0.1
n_comp: 2
epsilon: 1e-6
beta_params_min: 0.1
beta_params_max: 100.0
fixed_distribution:
beta_weights: 1.0
beta_alpha: 10.0
beta_beta: 10.0
bernoulli_bts_prob: 0.1
bernoulli_eos_prob: 0.1
random_distribution:
beta_weights: 1.0
beta_alpha: 10.0
beta_beta: 10.0
bernoulli_bts_prob: 0.1
bernoulli_eos_prob: 0.1

# Buffer
buffer:
data_path: null
train:
type: random
n: 2000
output_csv: lattice_parameters_train.csv
output_pkl: lattice_parameters_train.pkl
train: null
test:
type: random
n: 2000
output_csv: lattice_parameters_test.csv
output_pkl: lattice_parameters_test.pkl
type: grid
n: 900
4 changes: 0 additions & 4 deletions config/env/crystals/spacegroup.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,5 @@ buffer:
data_path: null
train:
type: all
output_csv: spacegroup_train.csv
output_pkl: spacegroup_train.pkl
test:
type: all
output_csv: spacegroup_test.csv
output_pkl: spacegroup_test.pkl
3 changes: 0 additions & 3 deletions 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 All @@ -27,5 +26,3 @@ buffer:
test:
type: grid
n: 1000
output_csv: ctorus_test.csv
output_pkl: ctorus_test.pkl
3 changes: 0 additions & 3 deletions 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 All @@ -22,5 +21,3 @@ buffer:
train: null
test:
type: all
output_csv: grid_test.csv
output_pkl: grid_test.pkl
3 changes: 0 additions & 3 deletions 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 All @@ -27,5 +26,3 @@ buffer:
test:
type: grid
n: 1000
output_csv: htorus_test.csv
output_pkl: htorus_test.pkl
2 changes: 0 additions & 2 deletions config/env/scrabble.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,3 @@ buffer:
test:
type: uniform
n: 10
output_csv: scrabble_test.csv
output_pkl: scrabble_test.pkl
3 changes: 0 additions & 3 deletions config/env/tetris.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,3 @@ buffer:
test:
type: random
n: 10
output_csv: tetris_test.csv
output_pkl: tetris_test.pkl

4 changes: 0 additions & 4 deletions 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 All @@ -20,8 +19,5 @@ buffer:
data_path: null
train:
type: all
output_csv: torus_train.csv
test:
type: all
output_csv: torus_test.csv
output_pkl: torus_test.pkl
2 changes: 0 additions & 2 deletions config/env/tree.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,5 +35,3 @@ buffer:
test:
type: random
n: 1000
output_csv: tree_test.csv
output_pkl: tree_test.pkl
26 changes: 26 additions & 0 deletions config/evaluator/base.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
_target_: gflownet.evaluator.base.BaseEvaluator

# config formerly from logger.test
first_it: True
period: 100
n: 100
kde:
bandwidth: 0.1
kernel: gaussian
n_top_k: 5000
top_k: 100
top_k_period: -1
# Number of backward trajectories to estimate the log likelihood of each test data point
n_trajs_logprobs: 10
logprobs_batch_size: 100
logprobs_bootstrap_size: 10000
# Maximum number of test data points to compute log likelihood probs.
max_data_logprobs: 1e5
# Number of points to obtain a grid to estimate the reward density
n_grid: 40000
train_log_period: 1
checkpoints_period: 1000
# List of metrics as per gflownet/eval/evaluator.py:METRICS_NAMES
# Set to null for all of them
# Values must be comma separated like `metrics: "l1, kl, js"` (spaces are optional)
metrics: all
76 changes: 76 additions & 0 deletions config/experiments/ccube/branin.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
# @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

# 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

# Evaluator
evaluator:
first_it: False
period: 500
n: 1000
checkpoints_period: 500

# WandB
logger:
do:
online: true
lightweight: True
project_name: "branin"
tags:
- gflownet
- continuous
- ccube
- branin

# Hydra
hydra:
run:
dir: ${user.logdir.root}/ccube/branin/${now:%Y-%m-%d_%H-%M-%S_%f}
Loading

0 comments on commit d107305

Please sign in to comment.