{"id":20240078,"url":"https://github.com/plainerman/variational-doob","last_synced_at":"2026-03-02T09:32:36.363Z","repository":{"id":260335599,"uuid":"788632722","full_name":"plainerman/Variational-Doob","owner":"plainerman","description":"Lagrangian formulation of Doob's h-transform allowing for efficient rare event sampling","archived":false,"fork":false,"pushed_at":"2025-03-26T09:47:51.000Z","size":19297,"stargazers_count":49,"open_issues_count":1,"forks_count":5,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-10T20:16:36.418Z","etag":null,"topics":["machine-learning","neural-networks","transition-paths","variational-method"],"latest_commit_sha":null,"homepage":"","language":"Jupyter Notebook","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/plainerman.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2024-04-18T19:39:14.000Z","updated_at":"2025-04-03T04:58:21.000Z","dependencies_parsed_at":"2025-04-10T20:01:59.572Z","dependency_job_id":null,"html_url":"https://github.com/plainerman/Variational-Doob","commit_stats":null,"previous_names":["plainerman/variational-doob"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/plainerman/Variational-Doob","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/plainerman%2FVariational-Doob","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/plainerman%2FVariational-Doob/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/plainerman%2FVariational-Doob/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/plainerman%2FVariational-Doob/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/plainerman","download_url":"https://codeload.github.com/plainerman/Variational-Doob/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/plainerman%2FVariational-Doob/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29997213,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-02T01:47:34.672Z","status":"online","status_checked_at":"2026-03-02T02:00:07.342Z","response_time":60,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["machine-learning","neural-networks","transition-paths","variational-method"],"created_at":"2024-11-14T08:43:01.712Z","updated_at":"2026-03-02T09:32:36.334Z","avatar_url":"https://github.com/plainerman.png","language":"Jupyter Notebook","readme":"\u003ch1 align=\"center\"\u003eDoob’s Lagrangian: A Sample-Efficient Variational Approach to Transition Path Sampling\u003c/h1\u003e\n\u003cp align=\"center\"\u003e\n\u003ca href=\"https://arxiv.org/abs/2410.07974\"\u003e\u003cimg src=\"https://img.shields.io/badge/arXiv-b31b1b?style=for-the-badge\u0026logo=arxiv\" alt=\"arXiv\"/\u003e\u003c/a\u003e\n\u003c!-- \u003ca href=\"https://github.com/plainerman/variational-doob\"\u003e\u003cimg src=\"https://img.shields.io/badge/python-3670A0?style=for-the-badge\u0026logo=python\u0026logoColor=ffdd54\" alt=\"Python\"/\u003e\u003c/a\u003e --\u003e\n\u003ca href=\"https://colab.research.google.com/drive/1FcmEbec06cH4yk0t8vOIt8r1Gm-VjQZ0?usp=sharing\"\u003e\u003cimg src=\"https://img.shields.io/badge/Colab-e37e3d.svg?style=for-the-badge\u0026logo=googlecolab\u0026logoColor=white\" alt=\"Jupyter\"/\u003e\u003c/a\u003e\n\u003ca href=\"https://github.com/jax-ml/jax\"\u003e\u003cimg src=\"https://img.shields.io/badge/library-JAX-5f0964?style=for-the-badge\" alt=\"Jax\"/\u003e\u003c/a\u003e\n\u003c/p\u003e\n\u003cp align=\"center\"\u003e\nA novel variational approach to transition path sampling (TPS) based on the Doob’s h-transform. Our method can be used to sample transition paths between two meta-stable states of molecular systems.\n\u003c/p\u003e\n\u003cp align=\"center\"\u003e\n\u003cimg src=\"visualizations/aldp.gif\" alt=\"Visualization of alanine dipeptide transitioning between two meta-stable states\"/\u003e\n\u003c/p\u003e\n\u003cp align=\"center\"\u003e\n\u003ci\u003eA transition path of alanine dipeptide sampled using our method.\u003c/i\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n\u003cimg src=\"visualizations/training-optimized.gif\" alt=\"\"/\u003e\n\u003c/p\u003e\n\u003cp align=\"center\"\u003e\n\u003ci\u003eVisualization of the optimization process using our algorithm for 2D potential.\u003c/i\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n\u003cimg src=\"visualizations/simulation-optimized.gif\" alt=\"\"/\u003e\n\u003c/p\u003e\n\u003cp align=\"center\"\u003e\n\u003ci\u003eRunning the deterministic and stochastic simulations using our algorithm for 2D potential.\u003c/i\u003e\n\u003c/p\u003e\n\n# FAQ\n## I am getting NaN values when running experiments on alanine dipeptide!\nThis is an issue on certain devices, and, so far, we haven't figured out the underlying reason. However, we have found out that:\n\n1. Changing your floats to 64-bit precision prevents this problem from happening (at least on our machines), albeit at ~2x slower performance. To change to float64, simply search for all instances of `jnp.float32` (as can be seen [here](https://github.com/search?q=repo%3Aplainerman%2FVariational-Doob%20jnp.float32\u0026type=code)) and change it to `jnp.float64`.\n\n2. First-order systems usually do not exhibit this behavior. So you can also change your `ode` in the config (e.g., [here](https://github.com/plainerman/Variational-Doob/blob/b3836998080569af5deaaa5bd1ef6ad0993e0bd9/configs/aldp_diagonal_single_gaussian.yaml#L7)) to `first_order` and see if this resolves the issue.  In our tests, first-order ODE was sufficient for most setups. \n\n# Getting started\n\nThe best way to understand our method is to look at [the google colab notebook](https://colab.research.google.com/drive/1FcmEbec06cH4yk0t8vOIt8r1Gm-VjQZ0?usp=sharing) which contains the necessary code for 2D potentials in one place. \nHowever, this notebook is very limited in scope and only contains the most basic examples. In the following, we will show the interfaces to run more complex examples. You can also look at the setups in the `configs/` folder.\n\n\n# Setup\n\nYou can use the `environment.yml` file to setup this project. However, it only works on CPU.\n```bash\nconda env create -f environment.yml\n```\n\nWe also provide a requirements.txt, and a pyproject.toml. So if you are using [pixi](https://github.com/prefix-dev/pixi) you can instead run\n\n```bash\npixi install --frozen\n```\n\nto install the dependencies and setup a virtual environment. Either activate the environment with `pixi shell` or use the provided `pixi run` command to run the scripts.\n\n# Running the code\n\n## Baselines\nYou can either use the TPS shooting baselines [provided by us](https://github.com/plainerman/variational-doob/releases/tag/camera-ready), or re-create them by running\n\n```bash\npython tps_baseline_mueller.py\nPYTHONPATH='.' python eval/evaluate_mueller.py\n```\n\nto generate and evaluate transitions for the Müller-Brown toy-potential or use\n\n```bash\npython tps_baseline.py --mechanism two-way-shooting --num_paths 1000 --states phi-psi\n# num_steps compiles multiple MD steps into a single one. This makes sampling faster but increases startup time. Only really worth it for long running simulations\npython tps_baseline.py --mechanism two-way-shooting --num_paths 100 --fixed_length 1000 --states phi-psi --num_steps 50\npython tps_baseline.py --mechanism two-way-shooting --num_paths 1000 --states rmsd\nPYTHONPATH='.' python eval/evaluate_tps.py\n```\n\nfor ALDP respectively. \n\n**Note:** In both cases, you might want to change the paths that you want to generate and evaluate in the baseline or evaluation scripts.\n\n## Our Method\nTo sample trajectories with our method, we provide ready to go config files in `configs/`. You can run them with\n\n```bash\npython main.py --config configs/toy/mueller_single_gaussian.yaml\npython main.py --config configs/toy/dual_channel_single_gaussian.yaml\npython main.py --config configs/toy/dual_channel_two_gaussians.yaml\n```\n\nfor the toy examples and\n\n```bash\npython main.py --config configs/aldp_diagonal_single_gaussian.yaml\n```\n\nfor real molecular systems.\n\n# Citation\nIf you find our work useful, please consider citing our paper:\n\n```bibtex\n@inproceedings{du2024doob,\n  author = {Du, Yuanqi and Plainer, Michael and Brekelmans, Rob and Duan, Chenru and No{\\'e}, Frank and Gomes, Carla P. and Aspuru-Guzik, Al{\\'a}n and Neklyudov, Kirill},\n  title = {Doob’s Lagrangian: A Sample-Efficient Variational Approach to Transition Path Sampling},\n  booktitle = {Advances in Neural Information Processing Systems},\n  editor = {Globerson, A. and Mackey, L. and Belgrave, D. and Fan, A. and Paquet, U. and Tomczak, J. and Zhang, C.},\n  pages = {65791--65822},\n  publisher = {Curran Associates, Inc.},\n  volume = {37},\n  year = {2024}\n}\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fplainerman%2Fvariational-doob","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fplainerman%2Fvariational-doob","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fplainerman%2Fvariational-doob/lists"}