{"id":30181329,"url":"https://github.com/marvinsxtr/jax-flow-matching","last_synced_at":"2025-10-06T18:51:54.651Z","repository":{"id":307740593,"uuid":"1030543756","full_name":"marvinsxtr/jax-flow-matching","owner":"marvinsxtr","description":"2D Flow Matching in JAX with equinox and diffrax","archived":false,"fork":false,"pushed_at":"2025-08-01T21:52:01.000Z","size":1220,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-08-12T08:48:27.658Z","etag":null,"topics":["diffrax","educational","equinox","flow-matching","jax"],"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/marvinsxtr.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":"2025-08-01T20:32:17.000Z","updated_at":"2025-08-06T13:19:02.000Z","dependencies_parsed_at":"2025-08-01T23:50:26.829Z","dependency_job_id":null,"html_url":"https://github.com/marvinsxtr/jax-flow-matching","commit_stats":null,"previous_names":["marvinsxtr/jax-flow-matching"],"tags_count":1,"template":false,"template_full_name":"marvinsxtr/ml-project-template","purl":"pkg:github/marvinsxtr/jax-flow-matching","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marvinsxtr%2Fjax-flow-matching","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marvinsxtr%2Fjax-flow-matching/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marvinsxtr%2Fjax-flow-matching/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marvinsxtr%2Fjax-flow-matching/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/marvinsxtr","download_url":"https://codeload.github.com/marvinsxtr/jax-flow-matching/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marvinsxtr%2Fjax-flow-matching/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278663381,"owners_count":26024389,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-06T02:00:05.630Z","response_time":65,"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":["diffrax","educational","equinox","flow-matching","jax"],"created_at":"2025-08-12T08:34:07.094Z","updated_at":"2025-10-06T18:51:54.622Z","avatar_url":"https://github.com/marvinsxtr.png","language":"Jupyter Notebook","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 2D Flow Matching in JAX\n\n![Flow trajectory visualization](trajectory.png)\n\nThis notebook implements a simple 2D flow matching model using JAX, equinox and diffrax. It trains a neural network to learn the velocity field that transforms samples from a standard Gaussian distribution to a target checkerboard distribution.\n\n[![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/marvinsxtr/jax-flow-matching/blob/main/jax_flow_matching.ipynb)\n\n## Overview\n\nThis notebook implements flow matching on a 2D checkerboard dataset using an affine probability path $x_t = (1-t) \\cdot x_0 + t \\cdot x_1$ with $x_0 \\sim \\mathcal{N}(0, I)$. An MLP learns the velocity field $v_\\theta(x, t)$ for ODE-based sampling and likelihood estimation via Hutchinson's trace estimator.\n\n## Dependencies\n\nThis notebook requires the following JAX ecosystem packages:\n\n- **[JAX](https://github.com/google/jax)**: Core library for high-performance numerical computing\n- **[Equinox](https://github.com/patrick-kidger/equinox)**: Neural network library built on JAX\n- **[Diffrax](https://github.com/patrick-kidger/diffrax)**: Differential equation solver for JAX\n- **[jaxtyping](https://github.com/google/jaxtyping)**: Type annotations for JAX arrays\n- **[Optax](https://github.com/deepmind/optax)**: Gradient processing and optimization library\n\nAdditional standard packages: `numpy`, `matplotlib`\n\n## Container Setup\n\nThis implementation can be run using Docker or Apptainer containers for reproducible results.\n\n### Docker (Local Machine)\n\n1. **Install VSCode Dev Containers Extension**\n\n   First, install the [Dev Containers](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-containers) extension in VSCode.\n\n2. **Open the Repository in the Dev Container**\n\n   Click the `Reopen in Container` button in the pop-up that appears once you open the repository in VSCode.\n\n   Alternatively, open the command palette in VSCode by pressing `Shift+Alt+P` (Windows/Linux) or `Shift+Cmd+P` (Mac), and type `Dev Containers: Reopen in Container`.\n\n### Apptainer (Cluster)\n\n1. **Install VSCode Remote Tunnels Extension**\n\n   First, install the [Remote Tunnels](https://marketplace.visualstudio.com/items?itemName=ms-vscode.remote-server) extension in VSCode.\n\n2. **Launch container**\n\n   To open a tunnel to connect your local VSCode to the container on the cluster:\n   \n   ```bash\n   apptainer run --nv --writable-tmpfs oras://ghcr.io/marvinsxtr/jax-flow-matching:latest-sif code tunnel\n   ```\n\n   In VSCode press `Shift+Alt+P` (Windows/Linux) or `Shift+Cmd+P` (Mac), type \"connect to tunnel\", select GitHub and select your named node on the cluster. Your IDE is now connected to the cluster.\n\n## Attribution\n\nThis implementation is based on concepts from the following sources:\n\n- [Flow Matching Guide and Code](https://arxiv.org/abs/2412.06264)\n- [Reference PyTorch Implementation](https://github.com/facebookresearch/flow_matching/blob/main/examples/2d_flow_matching.ipynb)\n- [Flow Matching for Generative Modeling](https://arxiv.org/abs/2210.02747)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmarvinsxtr%2Fjax-flow-matching","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmarvinsxtr%2Fjax-flow-matching","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmarvinsxtr%2Fjax-flow-matching/lists"}