{"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/on-the-versatile-uses-of-partial-distance","title":"On the Versatile Uses of Partial Distance Correlation in Deep Learning","arxiv_id":"2207.09684","date":"2022-07-20","proceeding":null,"authors":["Xingjian Zhen","Zihang Meng","Rudrasis Chakraborty","Vikas Singh"],"abstract":"Comparing the functional behavior of neural network models, whether it is a single network over time or two (or more networks) during or post-training, is an essential step in understanding what they are learning (and what they are not), and for identifying strategies for regularization or efficiency improvements. Despite recent progress, e.g., comparing vision transformers to CNNs, systematic comparison of function, especially across different networks, remains difficult and is often carried out layer by layer. Approaches such as canonical correlation analysis (CCA) are applicable in principle, but have been sparingly used so far. In this paper, we revisit a (less widely known) from statistics, called distance correlation (and its partial variant), designed to evaluate correlation between feature spaces of different dimensions. We describe the steps necessary to carry out its deployment for large scale models -- this opens the door to a surprising array of applications ranging from conditioning one deep model w.r.t. another, learning disentangled representations as well as optimizing diverse models that would directly be more robust to adversarial attacks. Our experiments suggest a versatile regularizer (or constraint) with many advantages, which avoids some of the common difficulties one faces in such analyses. Code is at https://github.com/zhenxingjian/Partial_Distance_Correlation.","url_abs":"https://arxiv.org/abs/2207.09684v3","url_pdf":"https://arxiv.org/pdf/2207.09684v3.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":"on-the-versatile-uses-of-partial-distance","repo_url":"https://github.com/zhenxingjian/partial_distance_correlation","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok","spdx":"MIT"}}],"tasks":[],"methods":[],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2207.09684","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2207.09684"}},"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/zhenxingjian/partial_distance_correlation","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":"d6a7ca2043932b32","entry":"Distance_Correlation","repo":"zhenxingjian/partial_distance_correlation","repo_kind":"official","path":"Partial_Distance_Correlation/Partial_DC.py","file_url":"https://github.com/zhenxingjian/partial_distance_correlation/blob/HEAD/Partial_Distance_Correlation/Partial_DC.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":"d6a7ca2043932b32"}},{"code_sha256_prefix":"91a148521688e6dd","entry":"P_Distance_Matrix","repo":"zhenxingjian/partial_distance_correlation","repo_kind":"official","path":"Partial_Distance_Correlation/Partial_DC.py","file_url":"https://github.com/zhenxingjian/partial_distance_correlation/blob/HEAD/Partial_Distance_Correlation/Partial_DC.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":"91a148521688e6dd"}},{"code_sha256_prefix":"1dd8cdb411590540","entry":"P_Distance_Matrix","repo":"zhenxingjian/partial_distance_correlation","repo_kind":"official","path":"Partial_Distance_Correlation/Partial_DC_grad.py","file_url":"https://github.com/zhenxingjian/partial_distance_correlation/blob/HEAD/Partial_Distance_Correlation/Partial_DC_grad.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":"1dd8cdb411590540"}},{"code_sha256_prefix":"19c9bc4a8add35e1","entry":"bracket_op","repo":"zhenxingjian/partial_distance_correlation","repo_kind":"official","path":"Partial_Distance_Correlation/Partial_DC.py","file_url":"https://github.com/zhenxingjian/partial_distance_correlation/blob/HEAD/Partial_Distance_Correlation/Partial_DC.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":"19c9bc4a8add35e1"}},{"code_sha256_prefix":"9e7b15eb05cf47df","entry":"get_dataset","repo":"zhenxingjian/partial_distance_correlation","repo_kind":"official","path":"Partial_Distance_Correlation/main_pDC_models.py","file_url":"https://github.com/zhenxingjian/partial_distance_correlation/blob/HEAD/Partial_Distance_Correlation/main_pDC_models.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":"9e7b15eb05cf47df"}},{"code_sha256_prefix":"ad49e7ad3bdf5f43","entry":"get_normalize_layer","repo":"zhenxingjian/partial_distance_correlation","repo_kind":"official","path":"Partial_Distance_Correlation/main_pDC_models.py","file_url":"https://github.com/zhenxingjian/partial_distance_correlation/blob/HEAD/Partial_Distance_Correlation/main_pDC_models.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":"ad49e7ad3bdf5f43"}},{"code_sha256_prefix":"2870376b8032253c","entry":"make_pairwise_metrics","repo":"zhenxingjian/partial_distance_correlation","repo_kind":"official","path":"Partial_Distance_Correlation/main_similarity.py","file_url":"https://github.com/zhenxingjian/partial_distance_correlation/blob/HEAD/Partial_Distance_Correlation/main_similarity.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":"2870376b8032253c"}},{"code_sha256_prefix":"2af53fce5490aa77","entry":"reshape_transform","repo":"zhenxingjian/partial_distance_correlation","repo_kind":"official","path":"Partial_Distance_Correlation/main_CAM.py","file_url":"https://github.com/zhenxingjian/partial_distance_correlation/blob/HEAD/Partial_Distance_Correlation/main_CAM.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":"2af53fce5490aa77"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}