{"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/survae-flows-surjections-to-bridge-the-gap","title":"SurVAE Flows: Surjections to Bridge the Gap between VAEs and Flows","arxiv_id":"2007.02731","date":"2020-07-06","proceeding":"NeurIPS 2020 12","authors":["Didrik Nielsen","Priyank Jaini","Emiel Hoogeboom","Ole Winther","Max Welling"],"abstract":"Normalizing flows and variational autoencoders are powerful generative models that can represent complicated density functions. However, they both impose constraints on the models: Normalizing flows use bijective transformations to model densities whereas VAEs learn stochastic transformations that are non-invertible and thus typically do not provide tractable estimates of the marginal likelihood. In this paper, we introduce SurVAE Flows: A modular framework of composable transformations that encompasses VAEs and normalizing flows. SurVAE Flows bridge the gap between normalizing flows and VAEs with surjective transformations, wherein the transformations are deterministic in one direction -- thereby allowing exact likelihood computation, and stochastic in the reverse direction -- hence providing a lower bound on the corresponding likelihood. We show that several recently proposed methods, including dequantization and augmented normalizing flows, can be expressed as SurVAE Flows. Finally, we introduce common operations such as the max value, the absolute value, sorting and stochastic permutation as composable layers in SurVAE Flows.","url_abs":"https://arxiv.org/abs/2007.02731v2","url_pdf":"https://arxiv.org/pdf/2007.02731v2.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":"survae-flows-surjections-to-bridge-the-gap","repo_url":"https://github.com/didriknielsen/survae_flows","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok","spdx":"MIT"}},{"paper_slug":"survae-flows-surjections-to-bridge-the-gap","repo_url":"https://github.com/ramonpeter/elsa","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok","spdx":"MIT"}},{"paper_slug":"survae-flows-surjections-to-bridge-the-gap","repo_url":"https://github.com/revsic/tf-survae-flows","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"tf","reach":{"status":"ok","spdx":"MIT"}}],"tasks":[],"methods":[{"method_slug":"normalizing-flows","method_name":"Normalizing Flows"}],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2007.02731","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2007.02731"}},"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/didriknielsen/survae_flows","reach":{"status":"ok","spdx":"MIT"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/revsic/tf-survae-flows","reach":{"status":"ok","spdx":"MIT"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/ramonpeter/elsa","reach":{"status":"ok","spdx":"MIT"}}],"summary":{"ran":3,"unverified":7},"by_repo_kind":{"official":{"samples":4,"ran":3,"repositories":1},"listed":{"samples":6,"ran":0,"repositories":2}},"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":"d232e453e386a533","entry":"elbo_nats","repo":"didriknielsen/survae_flows","repo_kind":"official","path":"survae/utils/loss.py","file_url":"https://github.com/didriknielsen/survae_flows/blob/HEAD/survae/utils/loss.py","link_basis":"harvester_set","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"d232e453e386a533"}},{"code_sha256_prefix":"9f24b4c6cbb5e19f","entry":"loglik_bpd","repo":"didriknielsen/survae_flows","repo_kind":"official","path":"survae/utils/loss.py","file_url":"https://github.com/didriknielsen/survae_flows/blob/HEAD/survae/utils/loss.py","link_basis":"harvester_set","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"9f24b4c6cbb5e19f"}},{"code_sha256_prefix":"9bff0117086fa0a0","entry":"loglik_nats","repo":"didriknielsen/survae_flows","repo_kind":"official","path":"survae/utils/loss.py","file_url":"https://github.com/didriknielsen/survae_flows/blob/HEAD/survae/utils/loss.py","link_basis":"harvester_set","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"9bff0117086fa0a0"}},{"code_sha256_prefix":"6eb70245806e4ae4","entry":"act_factor","repo":"didriknielsen/survae_flows","repo_kind":"official","path":"survae/nn/layers/activations_factory.py","file_url":"https://github.com/didriknielsen/survae_flows/blob/HEAD/survae/nn/layers/activations_factory.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":"6eb70245806e4ae4"}},{"code_sha256_prefix":"33374fb83c4aaff3","entry":"interpret_array","repo":"ramonpeter/elsa","repo_kind":"listed","path":"elsa/mappings/helper.py","file_url":"https://github.com/ramonpeter/elsa/blob/HEAD/elsa/mappings/helper.py","link_basis":"harvester_set","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":"33374fb83c4aaff3"}},{"code_sha256_prefix":"1f52c85a53a421d0","entry":"map_fourvector_rambo","repo":"ramonpeter/elsa","repo_kind":"listed","path":"elsa/mappings/helper.py","file_url":"https://github.com/ramonpeter/elsa/blob/HEAD/elsa/mappings/helper.py","link_basis":"harvester_set","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":"1f52c85a53a421d0"}},{"code_sha256_prefix":"95a17905907a83b0","entry":"mean_except_batch","repo":"revsic/tf-survae-flows","repo_kind":"listed","path":"survaeflow/utils.py","file_url":"https://github.com/revsic/tf-survae-flows/blob/HEAD/survaeflow/utils.py","link_basis":"harvester_set","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":"95a17905907a83b0"}},{"code_sha256_prefix":"c610476ce81501d8","entry":"save_distribution","repo":"ramonpeter/elsa","repo_kind":"listed","path":"elsa/utils/plots.py","file_url":"https://github.com/ramonpeter/elsa/blob/HEAD/elsa/utils/plots.py","link_basis":"harvester_set","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":"c610476ce81501d8"}},{"code_sha256_prefix":"d29caa5dfe0cdcf7","entry":"sum_except_batch","repo":"revsic/tf-survae-flows","repo_kind":"listed","path":"survaeflow/utils.py","file_url":"https://github.com/revsic/tf-survae-flows/blob/HEAD/survaeflow/utils.py","link_basis":"harvester_set","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":"d29caa5dfe0cdcf7"}},{"code_sha256_prefix":"cecf8ebf923a66fd","entry":"two_body_decay_factor","repo":"ramonpeter/elsa","repo_kind":"listed","path":"elsa/mappings/helper.py","file_url":"https://github.com/ramonpeter/elsa/blob/HEAD/elsa/mappings/helper.py","link_basis":"harvester_set","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":"cecf8ebf923a66fd"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}