{"about":{"site":"https://codewithpapers.app","non_affiliation":"Code with Papers and Syntology are not affiliated with, endorsed by, or sponsored by Papers with Code, Meta, or the pwc-archive mirror.","licence":"CC BY-SA 4.0","licence_url":"https://creativecommons.org/licenses/by-sa/4.0/legalcode","attribution":"https://codewithpapers.app/attribution","modified":"archive material modified by Syntology; see the attribution page"},"url":"/paper/moser-flow-divergence-based-generative","title":"Moser Flow: Divergence-based Generative Modeling on Manifolds","arxiv_id":"2108.08052","date":"2021-08-18","proceeding":"NeurIPS 2021 12","authors":["Noam Rozen","Aditya Grover","Maximilian Nickel","Yaron Lipman"],"abstract":"We are interested in learning generative models for complex geometries described via manifolds, such as spheres, tori, and other implicit surfaces. Current extensions of existing (Euclidean) generative models are restricted to specific geometries and typically suffer from high computational costs. We introduce Moser Flow (MF), a new class of generative models within the family of continuous normalizing flows (CNF). MF also produces a CNF via a solution to the change-of-variable formula, however differently from other CNF methods, its model (learned) density is parameterized as the source (prior) density minus the divergence of a neural network (NN). The divergence is a local, linear differential operator, easy to approximate and calculate on manifolds. Therefore, unlike other CNFs, MF does not require invoking or backpropagating through an ODE solver during training. Furthermore, representing the model density explicitly as the divergence of a NN rather than as a solution of an ODE facilitates learning high fidelity densities. Theoretically, we prove that MF constitutes a universal density approximator under suitable assumptions. Empirically, we demonstrate for the first time the use of flow models for sampling from general curved surfaces and achieve significant improvements in density estimation, sample quality, and training complexity over existing CNFs on challenging synthetic geometries and real-world benchmarks from the earth and climate sciences.","url_abs":"https://arxiv.org/abs/2108.08052v2","url_pdf":"https://arxiv.org/pdf/2108.08052v2.pdf","source":{"archive":"pwc-archive (Hugging Face), CC BY-SA 4.0","snapshot":"2025-07-28","licence_url":"https://creativecommons.org/licenses/by-sa/4.0/legalcode","row_kind":"abstracts"},"code_links":[{"paper_slug":"moser-flow-divergence-based-generative","repo_url":"https://github.com/noamroze/moser_flow","is_official":1,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok","spdx":"MIT"}}],"tasks":[{"task_slug":"density-estimation","task_name":"Density Estimation"}],"methods":[{"method_slug":"normalizing-flows","method_name":"Normalizing Flows"}],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2108.08052","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2108.08052"}},"developers":"https://syntology.ai/developers","read_at":"2026-09-24T18:15:14+00:00","read_at_is":"when the build read Syntology's graph, not when any sample ran","claim":"Per-sample execution status on synthesized fixtures; not a correctness claim about the paper. Samples come from repositories linked to the paper, official or community; repo_kind says which.","repos":[{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/noamroze/moser_flow","reach":{"status":"ok","spdx":"MIT"}}],"summary":{"unverified":8},"by_repo_kind":{"official":{"samples":8,"ran":0,"repositories":1}},"repo_kind_vocabulary":{"official":"The archive marks this repository official for the paper","named_in_paper":"The archive records that the paper mentions this repository; it is not marked official","listed":"In the archive's code links for this paper, not marked official and not recorded as mentioned in the paper","found_in_text":"Syntology found this repository in the paper's own text; whether it is the authors' implementation is not asserted","community":"Not in the archive's code links for this paper; a community repository Syntology harvested"},"n_pointer_only_for_licence":0,"samples":[{"code_sha256_prefix":"afc8000701215633","entry":"build_mlp","repo":"noamroze/moser_flow","repo_kind":"official","path":"common/architectures.py","file_url":"https://github.com/noamroze/moser_flow/blob/HEAD/common/architectures.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"afc8000701215633"}},{"code_sha256_prefix":"fc72d67983e81dbc","entry":"evaluate_checkpoints","repo":"noamroze/moser_flow","repo_kind":"official","path":"evaluate_time.py","file_url":"https://github.com/noamroze/moser_flow/blob/HEAD/evaluate_time.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"fc72d67983e81dbc"}},{"code_sha256_prefix":"f8e51601051c0f50","entry":"evaluate_checkpoints","repo":"noamroze/moser_flow","repo_kind":"official","path":"run_statistical_experiment.py","file_url":"https://github.com/noamroze/moser_flow/blob/HEAD/run_statistical_experiment.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"f8e51601051c0f50"}},{"code_sha256_prefix":"b66e58e39476d143","entry":"exact_divergence","repo":"noamroze/moser_flow","repo_kind":"official","path":"common/estimators.py","file_url":"https://github.com/noamroze/moser_flow/blob/HEAD/common/estimators.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"b66e58e39476d143"}},{"code_sha256_prefix":"0fe9dd806a092065","entry":"get_train_metrics","repo":"noamroze/moser_flow","repo_kind":"official","path":"evaluate_time.py","file_url":"https://github.com/noamroze/moser_flow/blob/HEAD/evaluate_time.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"0fe9dd806a092065"}},{"code_sha256_prefix":"8fce565bb01c92df","entry":"get_val_metrics","repo":"noamroze/moser_flow","repo_kind":"official","path":"evaluate_time.py","file_url":"https://github.com/noamroze/moser_flow/blob/HEAD/evaluate_time.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"8fce565bb01c92df"}},{"code_sha256_prefix":"f27216ea9fe2e0a5","entry":"parse_activation","repo":"noamroze/moser_flow","repo_kind":"official","path":"common/architectures.py","file_url":"https://github.com/noamroze/moser_flow/blob/HEAD/common/architectures.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"f27216ea9fe2e0a5"}},{"code_sha256_prefix":"720fe92efdb3bac0","entry":"slice_size","repo":"noamroze/moser_flow","repo_kind":"official","path":"datasets.py","file_url":"https://github.com/noamroze/moser_flow/blob/HEAD/datasets.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"720fe92efdb3bac0"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}