{"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/arxiv-2606-07058","title":"Constructing VAE Latent Spaces with Prescribed Topology","arxiv_id":"2606.07058","date":"2026-06-05","proceeding":null,"authors":["Jilles S. van Hulst","Jakub M. Tomczak","W. P. M. H. Heemels","Duarte J. Antunes"],"abstract":"Variational autoencoders (VAEs) learn low-dimensional latent representations of high-dimensional data. When the data lies on a manifold with non-Euclidean topology, the standard Gaussian prior introduces a topological mismatch that degrades reconstruction quality and prevents faithful representation. We present a constructive mathematical framework that resolves this mismatch for all manifolds that admit a product covering space. These are manifolds expressible as products of elementary factors (circles, intervals, or lines) or as quotients of such products by a finite symmetry group. The class includes cylinders, tori, Möbius strips, Klein bottles, and real projective spaces. Factorized distributions over the elementary factors yield product topologies with closed-form, decoupled KL divergences, so that each latent factor can be shaped independently while keeping training tractable. We catalogue reparametrizable encoder-prior pairs for periodic, bounded, and unbounded supports, and provide coordinate transformations that allow standard neural networks to output non-Euclidean parameters with smooth gradients. For quotient manifolds, the decoder receives group-invariant features of the covering-space coordinates, so that identified points produce identical outputs. Anchor constraints fix the coordinate system relative to the data or create soft topological holes. Experiments on synthetic manifolds and real-image datasets (rotated and cyclically shifted MNIST) confirm that a topology-matched prior aligns KL regularization with the data manifold. The resulting topology-aware models outperform the Gaussian baseline at all practically relevant regularization strengths. The code is available at https://github.com/JvHulst/VAE-Topology.","url_abs":"https://arxiv.org/abs/2606.07058","url_pdf":"https://arxiv.org/pdf/2606.07058","source":{"archive":null,"snapshot":"2025-07-28","note":"not in the Papers with Code archive (frozen at the snapshot)","row_kind":"graph","title_abstract_authors_date":"arXiv metadata, CC0 1.0 (https://info.arxiv.org/help/license)"},"code_links":[],"tasks":[],"methods":[],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2606.07058","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2606.07058"}},"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":[{"mentioned_in_github":null,"is_official":null,"provenance":"deterministic:regex_extraction","mentioned_in_paper":null,"url":"https://github.com/JvHulst/VAE-Topology","reach":null}],"summary":{"ran":13,"unverified":4},"by_repo_kind":{"found_in_text":{"samples":17,"ran":13,"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":17,"samples":[{"code_sha256_prefix":"9f30648af50f3d54","entry":"build_cnn_decoder","repo":"JvHulst/VAE-Topology","repo_kind":"found_in_text","path":"topovae/layers.py","file_url":"https://github.com/JvHulst/VAE-Topology/blob/HEAD/topovae/layers.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"9f30648af50f3d54"}},{"code_sha256_prefix":"701b645dc5f5cffe","entry":"build_cnn_encoder","repo":"JvHulst/VAE-Topology","repo_kind":"found_in_text","path":"topovae/layers.py","file_url":"https://github.com/JvHulst/VAE-Topology/blob/HEAD/topovae/layers.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"701b645dc5f5cffe"}},{"code_sha256_prefix":"d3ceea825bc3aaaa","entry":"build_mlp","repo":"JvHulst/VAE-Topology","repo_kind":"found_in_text","path":"topovae/layers.py","file_url":"https://github.com/JvHulst/VAE-Topology/blob/HEAD/topovae/layers.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"d3ceea825bc3aaaa"}},{"code_sha256_prefix":"82f7a6b589c995ab","entry":"find_canonical_circle_anchors","repo":"JvHulst/VAE-Topology","repo_kind":"found_in_text","path":"experiments/mnist/anchors.py","file_url":"https://github.com/JvHulst/VAE-Topology/blob/HEAD/experiments/mnist/anchors.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"82f7a6b589c995ab"}},{"code_sha256_prefix":"173f54bcdd3edb63","entry":"find_canonical_torus_anchors","repo":"JvHulst/VAE-Topology","repo_kind":"found_in_text","path":"experiments/mnist/anchors.py","file_url":"https://github.com/JvHulst/VAE-Topology/blob/HEAD/experiments/mnist/anchors.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"173f54bcdd3edb63"}},{"code_sha256_prefix":"1e9f549c89982e6e","entry":"geodesic_distance","repo":"JvHulst/VAE-Topology","repo_kind":"found_in_text","path":"topovae/evaluate.py","file_url":"https://github.com/JvHulst/VAE-Topology/blob/HEAD/topovae/evaluate.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"1e9f549c89982e6e"}},{"code_sha256_prefix":"87618a19ddf19bc8","entry":"image_grid_height","repo":"JvHulst/VAE-Topology","repo_kind":"found_in_text","path":"experiments/_panels.py","file_url":"https://github.com/JvHulst/VAE-Topology/blob/HEAD/experiments/_panels.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"87618a19ddf19bc8"}},{"code_sha256_prefix":"bcf7c048b9deaef8","entry":"image_strip_height","repo":"JvHulst/VAE-Topology","repo_kind":"found_in_text","path":"experiments/_panels.py","file_url":"https://github.com/JvHulst/VAE-Topology/blob/HEAD/experiments/_panels.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"bcf7c048b9deaef8"}},{"code_sha256_prefix":"6fd0c05ff0f82f1d","entry":"label3d_pad","repo":"JvHulst/VAE-Topology","repo_kind":"found_in_text","path":"experiments/_style.py","file_url":"https://github.com/JvHulst/VAE-Topology/blob/HEAD/experiments/_style.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"6fd0c05ff0f82f1d"}},{"code_sha256_prefix":"2ee41728ae4fa311","entry":"make_image_aware_figure","repo":"JvHulst/VAE-Topology","repo_kind":"found_in_text","path":"experiments/_panels.py","file_url":"https://github.com/JvHulst/VAE-Topology/blob/HEAD/experiments/_panels.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"2ee41728ae4fa311"}},{"code_sha256_prefix":"1a2dc18ccc230207","entry":"make_mnist_loaders","repo":"JvHulst/VAE-Topology","repo_kind":"found_in_text","path":"experiments/mnist/data.py","file_url":"https://github.com/JvHulst/VAE-Topology/blob/HEAD/experiments/mnist/data.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"1a2dc18ccc230207"}},{"code_sha256_prefix":"ddfe30416a0a5392","entry":"panel_title","repo":"JvHulst/VAE-Topology","repo_kind":"found_in_text","path":"experiments/_style.py","file_url":"https://github.com/JvHulst/VAE-Topology/blob/HEAD/experiments/_style.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"ddfe30416a0a5392"}},{"code_sha256_prefix":"b514c6156490904e","entry":"scale_fonts_to_page","repo":"JvHulst/VAE-Topology","repo_kind":"found_in_text","path":"experiments/_style.py","file_url":"https://github.com/JvHulst/VAE-Topology/blob/HEAD/experiments/_style.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"b514c6156490904e"}},{"code_sha256_prefix":"6d93c0350e91c42c","entry":"compute_all_metrics","repo":"JvHulst/VAE-Topology","repo_kind":"found_in_text","path":"topovae/evaluate.py","file_url":"https://github.com/JvHulst/VAE-Topology/blob/HEAD/topovae/evaluate.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"6d93c0350e91c42c"}},{"code_sha256_prefix":"d182f6687cd24492","entry":"compute_mnist_metrics","repo":"JvHulst/VAE-Topology","repo_kind":"found_in_text","path":"topovae/evaluate.py","file_url":"https://github.com/JvHulst/VAE-Topology/blob/HEAD/topovae/evaluate.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"d182f6687cd24492"}},{"code_sha256_prefix":"44e46609c8dcf082","entry":"make_rotated_mnist_data","repo":"JvHulst/VAE-Topology","repo_kind":"found_in_text","path":"experiments/mnist/data.py","file_url":"https://github.com/JvHulst/VAE-Topology/blob/HEAD/experiments/mnist/data.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"44e46609c8dcf082"}},{"code_sha256_prefix":"f347aeace68abc4a","entry":"make_shifted_mnist_data","repo":"JvHulst/VAE-Topology","repo_kind":"found_in_text","path":"experiments/mnist/data.py","file_url":"https://github.com/JvHulst/VAE-Topology/blob/HEAD/experiments/mnist/data.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"f347aeace68abc4a"}}]},"arxiv_metadata":{"licence":"arXiv metadata, CC0 1.0 (https://info.arxiv.org/help/license)","fields":["title","abstract","authors","date"],"primary_category":"cs.LG","source":"arxiv_2026.jsonl"},"syntology_extracted_results":null}