{"id":13752135,"url":"https://github.com/recursionpharma/gflownet","last_synced_at":"2026-02-06T17:14:52.893Z","repository":{"id":37952027,"uuid":"463280432","full_name":"recursionpharma/gflownet","owner":"recursionpharma","description":"GFlowNet library specialized for graph \u0026 molecular data","archived":false,"fork":false,"pushed_at":"2025-06-06T03:17:00.000Z","size":21493,"stargazers_count":244,"open_issues_count":23,"forks_count":51,"subscribers_count":46,"default_branch":"trunk","last_synced_at":"2025-06-06T04:24:41.282Z","etag":null,"topics":["deep-learning","gflownet","graph-neural-network","pytorch"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/recursionpharma.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"docs/contributing.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":"CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2022-02-24T19:45:20.000Z","updated_at":"2025-05-29T15:28:56.000Z","dependencies_parsed_at":"2023-10-01T03:01:02.115Z","dependency_job_id":"ae4f3030-e19c-4007-b907-cbaacfa6622b","html_url":"https://github.com/recursionpharma/gflownet","commit_stats":null,"previous_names":[],"tags_count":39,"template":false,"template_full_name":null,"purl":"pkg:github/recursionpharma/gflownet","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/recursionpharma%2Fgflownet","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/recursionpharma%2Fgflownet/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/recursionpharma%2Fgflownet/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/recursionpharma%2Fgflownet/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/recursionpharma","download_url":"https://codeload.github.com/recursionpharma/gflownet/tar.gz/refs/heads/trunk","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/recursionpharma%2Fgflownet/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29169403,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-06T16:33:35.550Z","status":"ssl_error","status_checked_at":"2026-02-06T16:33:30.716Z","response_time":59,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["deep-learning","gflownet","graph-neural-network","pytorch"],"created_at":"2024-08-03T09:01:00.060Z","updated_at":"2026-02-06T17:14:52.871Z","avatar_url":"https://github.com/recursionpharma.png","language":"Python","funding_links":[],"categories":["Ranked by starred repositories"],"sub_categories":[],"readme":"\n\n[![Build-and-Test](https://github.com/recursionpharma/gflownet/actions/workflows/build-and-test.yaml/badge.svg)](https://github.com/recursionpharma/gflownet/actions/workflows/build-and-test.yaml)\n[![Code Quality](https://github.com/recursionpharma/gflownet/actions/workflows/code-quality.yaml/badge.svg)](https://github.com/recursionpharma/gflownet/actions/workflows/code-quality.yaml)\n[![Python versions](https://img.shields.io/badge/Python-3.9%2B-blue)](https://www.python.org/downloads/)\n[![license: MIT](https://img.shields.io/badge/License-MIT-purple.svg)](LICENSE)\n\n# gflownet\n\nGFlowNet-related training and environment code on graphs.\n\n**Primer**\n\nGFlowNet [[1]](https://yoshuabengio.org/2022/03/05/generative-flow-networks/), [[2]](https://www.gflownet.org/), [[3]](https://github.com/zdhNarsil/Awesome-GFlowNets), short for Generative Flow Network, is a novel generative modeling framework, particularly suited for discrete, combinatorial objects. Here in particular it is implemented for graph generation.\n\nThe idea behind GFN is to estimate flows in a (graph-theoretic) directed acyclic network*. The network represents all possible ways of constructing objects, and so knowing the flow gives us a policy which we can follow to sequentially construct objects. Such a sequence of partially constructed objects is a _trajectory_. *Perhaps confusingly, the _network_ in GFN refers to the state space, not a neural network architecture.\n\nThe main focus of this library (although it can do other things) is to construct graphs (e.g. graphs of atoms), which are constructed node by node. To make policy predictions, we use a graph neural network. This GNN outputs per-node logits (e.g. add an atom to this atom, or add a bond between these two atoms), as well as per-graph logits (e.g. stop/\"done constructing this object\").\n\nThis library supports a variety of GFN algorithms (as well as some baselines), and supports training on a mix of existing data (offline) and self-generated data (online), the latter being obtained by querying the model sequentially to obtain trajectories.\n\n\n## Installation\n\n### PIP\n\nThis package is installable as a PIP package, but since it depends on some torch-geometric package wheels, the `--find-links` arguments must be specified as well:\n\n```bash\npip install -e . --find-links https://data.pyg.org/whl/torch-2.1.2+cu121.html\n```\nOr for CPU use:\n\n```bash\npip install -e . --find-links https://data.pyg.org/whl/torch-2.1.2+cpu.html\n```\n\nTo install or [depend on](https://matiascodesal.com/blog/how-use-git-repository-pip-dependency/) a specific tag, for example here `v0.0.10`, use the following scheme:\n```bash\npip install git+https://github.com/recursionpharma/gflownet.git@v0.0.10 --find-links ...\n```\n\nIf package dependencies seem not to work, you may need to install the exact frozen versions listed `requirements/`, i.e. `pip install -r requirements/main-3.10.txt`.\n\n## Getting started\n\nA good place to get started immediately is with the [sEH fragment-based MOO task](src/gflownet/tasks/seh_frag_moo.py). The file `seh_frag_moo.py` is runnable as-is (although you may want to change the default configuration in `main()`).\n\nFor a gentler introduction to the library, see [Getting Started](docs/getting_started.md). For a more in-depth look at the library, see [Implementation Notes](docs/implementation_notes.md).\n\n## Repo overview\n\n- [algo](src/gflownet/algo), contains GFlowNet algorithms implementations ([Trajectory Balance](https://arxiv.org/abs/2201.13259), [SubTB](https://arxiv.org/abs/2209.12782), [Flow Matching](https://arxiv.org/abs/2106.04399)), as well as some baselines. These implement how to sample trajectories from a model and compute the loss from trajectories.\n- [data](src/gflownet/data), contains dataset definitions, data loading and data sampling utilities.\n- [envs](src/gflownet/envs), contains environment classes; the base environment is agnostic to what kind of graph is being made, and context classes specify mappings from graphs to objects (e.g. molecules) and torch geometric Data.\n- [examples](docs/examples), contains simple example implementations of GFlowNet.\n- [models](src/gflownet/models), contains model definitions.\n- [tasks](src/gflownet/tasks), contains training code.\n    -  [qm9](src/gflownet/tasks/qm9/qm9.py), temperature-conditional molecule sampler based on QM9's HOMO-LUMO gap data as a reward.\n    -  [seh_frag](src/gflownet/tasks/seh_frag.py), reproducing Bengio et al. 2021, fragment-based molecule design targeting the sEH protein\n    -  [seh_frag_moo](src/gflownet/tasks/seh_frag_moo.py), same as the above, but with multi-objective optimization (incl. QED, SA, and molecule weight objectives).\n- [utils](src/gflownet/utils), contains utilities (multiprocessing, metrics, conditioning).\n- [`trainer.py`](src/gflownet/trainer.py), defines a general harness for training GFlowNet models.\n- [`online_trainer.py`](src/gflownet/online_trainer.py), defines a typical online-GFN training loop.\n\nSee [implementation notes](docs/implementation_notes.md) for more.\n\n\n## Developing \u0026 Contributing\n\nExternal contributions are welcome.\n\nTo install the developers dependencies\n```\npip install -e '.[dev]' --find-links https://data.pyg.org/whl/torch-2.1.2+cu121.html\n```\n\nWe use `tox` to run tests and linting, and `pre-commit` to run checks before committing.\nTo ensure that these checks pass, simply run `tox -e style` and `tox run` to run linters and tests, respectively.\n\nFor more information, see [Contributing](docs/contributing.md).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frecursionpharma%2Fgflownet","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frecursionpharma%2Fgflownet","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frecursionpharma%2Fgflownet/lists"}