MCPcopy Index your code
hub / github.com/alexhernandezgarcia/gflownet

github.com/alexhernandezgarcia/gflownet @mfgfn-v1.0

Chat with this repo
repository ↗ · DeepWiki ↗ · release mfgfn-v1.0 ↗ · + Follow
528 symbols 1,698 edges 58 files 255 documented · 48%

Browse by type

Functions 481 Types & classes 47
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

GFlowNet

This repository implements GFlowNets, generative flow networks for probabilistic modelling, on PyTorch. A design guideline behind this implementation is the separation of the logic of the GFlowNet agent and the environments on which the agent can be trained on. In other words, this implementation should allow its extension with new environments without major or any changes to to the agent. Another design guideline is flexibility and modularity. The configuration is handled via the use of Hydra.

Installation

pip

python -m pip install --upgrade https://github.com/alexhernandezgarcia/gflownet/archive/main.zip

How to train a GFlowNet model

To train a GFlowNet model with the default configuration, simply run

python main.py user.logdir.root=<path/to/log/files/>

Alternatively, you can create a user configuration file in config/user/<username>.yaml specifying a logdir.root and run

python main.py user=<username>

Using Hydra, you can easily specify any variable of the configuration in the command line. For example, to train GFlowNet with the trajectory balance loss, on the continuous torus (ctorus) environment and the corresponding proxy:

python main.py gflownet=trajectorybalance env=ctorus proxy=torus

The above command will overwrite the env and proxy default configuration with the configuration files in config/env/ctorus.yaml and config/proxy/torus.yaml respectively.

Hydra configuration is hierarchical. For instance, a handy variable to change while debugging our code is to avoid logging to wandb. You can do this by setting logger.do.online=False.

Core symbols most depended-on inside this repo

Shape

Method 388
Function 93
Class 47

Languages

Python100%

Modules by API surface

gflownet/envs/base.py49 symbols
gflownet/utils/legacy.py35 symbols
gflownet/gflownet.py29 symbols
gflownet/utils/logger.py26 symbols
gflownet/envs/htorus.py26 symbols
gflownet/envs/sequence.py23 symbols
gflownet/envs/torus.py22 symbols
gflownet/envs/plane.py22 symbols
gflownet/envs/grid.py22 symbols
gflownet/utils/molecule/conformer_base.py19 symbols
tests/gflownet/envs/test_crystals.py18 symbols
playground/botorch/mes_var_deepKernel.py18 symbols

For agents

$ claude mcp add gflownet \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact

Ask about this repo answers extend the page