{"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/functional-gradient-flows-for-constrained","title":"Functional Gradient Flows for Constrained Sampling","arxiv_id":"2410.23170","date":"2024-10-30","proceeding":null,"authors":["Shiyue Zhang","Longlin Yu","Ziheng Cheng","Cheng Zhang"],"abstract":"Recently, through a unified gradient flow perspective of Markov chain Monte Carlo (MCMC) and variational inference (VI), particle-based variational inference methods (ParVIs) have been proposed that tend to combine the best of both worlds. While typical ParVIs such as Stein Variational Gradient Descent (SVGD) approximate the gradient flow within a reproducing kernel Hilbert space (RKHS), many attempts have been made recently to replace RKHS with more expressive function spaces, such as neural networks. While successful, these methods are mainly designed for sampling from unconstrained domains. In this paper, we offer a general solution to constrained sampling by introducing a boundary condition for the gradient flow which would confine the particles within the specific domain. This allows us to propose a new functional gradient ParVI method for constrained sampling, called constrained functional gradient flow (CFG), with provable continuous-time convergence in total variation (TV). We also present novel numerical strategies to handle the boundary integral term arising from the domain constraints. Our theory and experiments demonstrate the effectiveness of the proposed framework.","url_abs":"https://arxiv.org/abs/2410.23170v1","url_pdf":"https://arxiv.org/pdf/2410.23170v1.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":"functional-gradient-flows-for-constrained","repo_url":"https://github.com/ShiyueZhang66/Constrained-Functional-Gradient-Flow","is_official":1,"mentioned_in_paper":0,"mentioned_in_github":0,"framework":"pytorch","reach":null}],"tasks":[{"task_slug":"variational-inference","task_name":"Variational Inference"}],"methods":[{"method_slug":"variational-inference","method_name":"Variational Inference"}],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2410.23170","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2410.23170"}},"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/ShiyueZhang66/Constrained-Functional-Gradient-Flow","reach":null}],"summary":{"ran":4,"ran_honours":1,"ran_draft_wrong":5,"unverified":2},"by_repo_kind":{"official":{"samples":9,"ran":7,"repositories":1},"community":{"samples":3,"ran":3,"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":9,"samples":[{"code_sha256_prefix":"12fbdc03d5e1e46f","entry":"BNNClassifier","repo":"ShiyueZhang66/Constrained-Functional-Gradient-Flow","repo_kind":"official","path":"Monotonic BNN/CFG_bnn/runners.py","file_url":"https://github.com/ShiyueZhang66/Constrained-Functional-Gradient-Flow/blob/HEAD/Monotonic%20BNN/CFG_bnn/runners.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":"12fbdc03d5e1e46f"}},{"code_sha256_prefix":"ff0707ff82829c52","entry":"F_net","repo":"ShiyueZhang66/Constrained-Functional-Gradient-Flow","repo_kind":"official","path":"Monotonic BNN/CFG_bnn/runners.py","file_url":"https://github.com/ShiyueZhang66/Constrained-Functional-Gradient-Flow/blob/HEAD/Monotonic%20BNN/CFG_bnn/runners.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":"ff0707ff82829c52"}},{"code_sha256_prefix":"3f24bf5f55d8ce60","entry":"Z_net","repo":"ShiyueZhang66/Constrained-Functional-Gradient-Flow","repo_kind":"official","path":"Monotonic BNN/CFG_bnn/runners.py","file_url":"https://github.com/ShiyueZhang66/Constrained-Functional-Gradient-Flow/blob/HEAD/Monotonic%20BNN/CFG_bnn/runners.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":"3f24bf5f55d8ce60"}},{"code_sha256_prefix":"d451d2d77a159994","entry":"generate_normalize_numerical_mat","repo":"ShiyueZhang66/Constrained-Functional-Gradient-Flow","repo_kind":"official","path":"Monotonic BNN/CFG_bnn/runners.py","file_url":"https://github.com/ShiyueZhang66/Constrained-Functional-Gradient-Flow/blob/HEAD/Monotonic%20BNN/CFG_bnn/runners.py","link_basis":"first_harvest_node","language":"python","status":"ran_honours","verification_level":1,"contract_check":"HONOURS","metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"d451d2d77a159994"}},{"code_sha256_prefix":"8579b1f0c4075070","entry":"generate_one_hot_mat","repo":"ShiyueZhang66/Constrained-Functional-Gradient-Flow","repo_kind":"official","path":"Monotonic BNN/CFG_bnn/runners.py","file_url":"https://github.com/ShiyueZhang66/Constrained-Functional-Gradient-Flow/blob/HEAD/Monotonic%20BNN/CFG_bnn/runners.py","link_basis":"first_harvest_node","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"MISDECLARED","metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"8579b1f0c4075070"}},{"code_sha256_prefix":"b7525eaf099c0049","entry":"get_skimming_mask","repo":"Extraltodeus/Skimmed_CFG","repo_kind":"community","path":"skimmed_CFG.py","file_url":"https://github.com/Extraltodeus/Skimmed_CFG/blob/HEAD/skimmed_CFG.py","link_basis":"first_harvest_node","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"MISDECLARED","metamorphic_tier":"deterministic","behaviour_fingerprint":true,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"b7525eaf099c0049"}},{"code_sha256_prefix":"0f0e888ded533663","entry":"interpolated_scales","repo":"Extraltodeus/Skimmed_CFG","repo_kind":"community","path":"skimmed_CFG.py","file_url":"https://github.com/Extraltodeus/Skimmed_CFG/blob/HEAD/skimmed_CFG.py","link_basis":"first_harvest_node","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"MISDECLARED","metamorphic_tier":"invariant","behaviour_fingerprint":true,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"0f0e888ded533663"}},{"code_sha256_prefix":"a97ff05389d00e15","entry":"load_data","repo":"ShiyueZhang66/Constrained-Functional-Gradient-Flow","repo_kind":"official","path":"Monotonic BNN/CFG_bnn/runners.py","file_url":"https://github.com/ShiyueZhang66/Constrained-Functional-Gradient-Flow/blob/HEAD/Monotonic%20BNN/CFG_bnn/runners.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":"a97ff05389d00e15"}},{"code_sha256_prefix":"7e1954f30c7a9e83","entry":"normalize_data_ours","repo":"ShiyueZhang66/Constrained-Functional-Gradient-Flow","repo_kind":"official","path":"Monotonic BNN/CFG_bnn/runners.py","file_url":"https://github.com/ShiyueZhang66/Constrained-Functional-Gradient-Flow/blob/HEAD/Monotonic%20BNN/CFG_bnn/runners.py","link_basis":"first_harvest_node","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"OUTPUT_MISDECLARED","metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"7e1954f30c7a9e83"}},{"code_sha256_prefix":"97625a658e3fa3aa","entry":"skimmed_CFG","repo":"Extraltodeus/Skimmed_CFG","repo_kind":"community","path":"skimmed_CFG.py","file_url":"https://github.com/Extraltodeus/Skimmed_CFG/blob/HEAD/skimmed_CFG.py","link_basis":"first_harvest_node","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"MISDECLARED","metamorphic_tier":"invariant","behaviour_fingerprint":true,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"97625a658e3fa3aa"}},{"code_sha256_prefix":"953cf1ae00d88ff9","entry":"ConstrainedGWG","repo":"ShiyueZhang66/Constrained-Functional-Gradient-Flow","repo_kind":"official","path":"Monotonic BNN/CFG_bnn/runners.py","file_url":"https://github.com/ShiyueZhang66/Constrained-Functional-Gradient-Flow/blob/HEAD/Monotonic%20BNN/CFG_bnn/runners.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":"953cf1ae00d88ff9"}},{"code_sha256_prefix":"ff25ad1c88331c77","entry":"RUNNER","repo":"ShiyueZhang66/Constrained-Functional-Gradient-Flow","repo_kind":"official","path":"Monotonic BNN/CFG_bnn/runners.py","file_url":"https://github.com/ShiyueZhang66/Constrained-Functional-Gradient-Flow/blob/HEAD/Monotonic%20BNN/CFG_bnn/runners.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":"ff25ad1c88331c77"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}