{"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/offline-imitation-from-observation-via-primal","title":"Offline Imitation from Observation via Primal Wasserstein State Occupancy Matching","arxiv_id":"2311.01331","date":"2023-11-02","proceeding":null,"authors":["Kai Yan","Alexander G. Schwing","Yu-Xiong Wang"],"abstract":"In real-world scenarios, arbitrary interactions with the environment can often be costly, and actions of expert demonstrations are not always available. To reduce the need for both, offline Learning from Observations (LfO) is extensively studied: the agent learns to solve a task given only expert states and task-agnostic non-expert state-action pairs. The state-of-the-art DIstribution Correction Estimation (DICE) methods, as exemplified by SMODICE, minimize the state occupancy divergence between the learner's and empirical expert policies. However, such methods are limited to either $f$-divergences (KL and $chi^2$) or Wasserstein distance with Rubinstein duality, the latter of which constrains the underlying distance metric crucial to the performance of Wasserstein-based solutions. To enable more flexible distance metrics, we propose Primal Wasserstein DICE (PW-DICE). It minimizes the primal Wasserstein distance between the learner and expert state occupancies and leverages a contrastively learned distance metric. Theoretically, our framework is a generalization of SMODICE, and is the first work that unifies $f$-divergence and Wasserstein minimization. Empirically, we find that PW-DICE improves upon several state-of-the-art methods. The code is available at https://github.com/KaiYan289/PW-DICE.","url_abs":"https://arxiv.org/abs/2311.01331v3","url_pdf":"https://arxiv.org/pdf/2311.01331v3.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":"offline-imitation-from-observation-via-primal","repo_url":"https://github.com/kaiyan289/pw-dice","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":0,"framework":"pytorch","reach":{"status":"ok"}}],"tasks":[],"methods":[],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"syntology_url":"https://syntology.ai/paper/2311.01331","atlas_url":"https://app.syntology.ai/?focus=2311.01331","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2311.01331"}},"developers":"https://syntology.ai/developers","read_at":"2026-09-25T09:33:49+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":"deterministic:regex_extraction","url":"https://github.com/KaiYan289/PW-DICE","reach":{"status":"ok"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/kaiyan289/pw-dice","reach":{"status":"ok"}}],"summary":{"ran":9,"ran_draft_wrong":2,"ran_honours":1,"unverified":2},"by_repo_kind":{"official":{"samples":14,"ran":12,"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":14,"samples":[{"code_sha256_prefix":"7ce1439208658937","entry":"add_terminals","repo":"KaiYan289/PW-DICE","repo_kind":"official","path":"PWDICE_continuous/dataset.py","file_url":"https://github.com/KaiYan289/PW-DICE/blob/HEAD/PWDICE_continuous/dataset.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":"7ce1439208658937"}},{"code_sha256_prefix":"cf5ce98955ab4534","entry":"atanh","repo":"KaiYan289/PW-DICE","repo_kind":"official","path":"PWDICE_continuous/NN.py","file_url":"https://github.com/KaiYan289/PW-DICE/blob/HEAD/PWDICE_continuous/NN.py","link_basis":"harvester_set","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":"cf5ce98955ab4534"}},{"code_sha256_prefix":"c8bdd33928f69383","entry":"choice","repo":"KaiYan289/PW-DICE","repo_kind":"official","path":"PWDICE_continuous/advance_NN.py","file_url":"https://github.com/KaiYan289/PW-DICE/blob/HEAD/PWDICE_continuous/advance_NN.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":"c8bdd33928f69383"}},{"code_sha256_prefix":"347766442faf6236","entry":"choice2","repo":"KaiYan289/PW-DICE","repo_kind":"official","path":"PWDICE_continuous/advance_NN.py","file_url":"https://github.com/KaiYan289/PW-DICE/blob/HEAD/PWDICE_continuous/advance_NN.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":"347766442faf6236"}},{"code_sha256_prefix":"3665ac63b6a49f6e","entry":"concatlist","repo":"kaiyan289/pw-dice","repo_kind":"official","path":"PWDICE_tabular_wrapup/ours_newKL_solver_arbitrary.py","file_url":"https://github.com/kaiyan289/pw-dice/blob/HEAD/PWDICE_tabular_wrapup/ours_newKL_solver_arbitrary.py","link_basis":"first_harvest_node","language":"python","status":"ran_honours","verification_level":1,"contract_check":"HONOURS","metamorphic_tier":"well_formed","behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"3665ac63b6a49f6e"}},{"code_sha256_prefix":"0e03fe35d8e01f02","entry":"construct_dataset","repo":"KaiYan289/PW-DICE","repo_kind":"official","path":"PWDICE_continuous/dataset.py","file_url":"https://github.com/KaiYan289/PW-DICE/blob/HEAD/PWDICE_continuous/dataset.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":"0e03fe35d8e01f02"}},{"code_sha256_prefix":"333cd5157d8a351c","entry":"get_data","repo":"KaiYan289/PW-DICE","repo_kind":"official","path":"PWDICE_continuous/datagen.py","file_url":"https://github.com/KaiYan289/PW-DICE/blob/HEAD/PWDICE_continuous/datagen.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":"333cd5157d8a351c"}},{"code_sha256_prefix":"ac35521adf325e83","entry":"get_data_pre","repo":"KaiYan289/PW-DICE","repo_kind":"official","path":"PWDICE_continuous/datagen.py","file_url":"https://github.com/KaiYan289/PW-DICE/blob/HEAD/PWDICE_continuous/datagen.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":"ac35521adf325e83"}},{"code_sha256_prefix":"2b68a6cee77f95fb","entry":"get_dataset","repo":"KaiYan289/PW-DICE","repo_kind":"official","path":"PWDICE_continuous/dataset.py","file_url":"https://github.com/KaiYan289/PW-DICE/blob/HEAD/PWDICE_continuous/dataset.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":"2b68a6cee77f95fb"}},{"code_sha256_prefix":"ec8e6f427087880b","entry":"get_dist","repo":"KaiYan289/PW-DICE","repo_kind":"official","path":"PWDICE_continuous/dist_metric.py","file_url":"https://github.com/KaiYan289/PW-DICE/blob/HEAD/PWDICE_continuous/dist_metric.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":"ec8e6f427087880b"}},{"code_sha256_prefix":"03cb6d46061c329e","entry":"list2gen","repo":"kaiyan289/pw-dice","repo_kind":"official","path":"PWDICE_tabular_wrapup/ours_newKL_solver_arbitrary.py","file_url":"https://github.com/kaiyan289/pw-dice/blob/HEAD/PWDICE_tabular_wrapup/ours_newKL_solver_arbitrary.py","link_basis":"first_harvest_node","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"OUTPUT_MISDECLARED","metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"03cb6d46061c329e"}},{"code_sha256_prefix":"2331e1c5de71901c","entry":"soft_linear_piecewise_loss","repo":"KaiYan289/PW-DICE","repo_kind":"official","path":"PWDICE_continuous/dist_metric.py","file_url":"https://github.com/KaiYan289/PW-DICE/blob/HEAD/PWDICE_continuous/dist_metric.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":"2331e1c5de71901c"}},{"code_sha256_prefix":"b1a53ce39d2e8d5c","entry":"estimate_traj_val","repo":"KaiYan289/PW-DICE","repo_kind":"official","path":"PWDICE_continuous/advance_NN.py","file_url":"https://github.com/KaiYan289/PW-DICE/blob/HEAD/PWDICE_continuous/advance_NN.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":"b1a53ce39d2e8d5c"}},{"code_sha256_prefix":"a5206fc3db71b6bf","entry":"git_commit","repo":"kaiyan289/pw-dice","repo_kind":"official","path":"PWDICE_tabular_wrapup/ours_newKL_solver_arbitrary.py","file_url":"https://github.com/kaiyan289/pw-dice/blob/HEAD/PWDICE_tabular_wrapup/ours_newKL_solver_arbitrary.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":"a5206fc3db71b6bf"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}