diffneusim 1.0.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- diffneusim/__init__.py +1 -0
- diffneusim/_cache.py +42 -0
- diffneusim/_paths.py +5 -0
- diffneusim/bindings/rew14_ext.cu +115 -0
- diffneusim/bindings/soft14_capi.cpp +443 -0
- diffneusim/bindings/soft14_engine_ext.cu +596 -0
- diffneusim/bindings/soft_capi.cpp +782 -0
- diffneusim/bindings/soft_engine_ext.cu +495 -0
- diffneusim/core/cpu_engine/build.sh +40 -0
- diffneusim/core/cpu_engine/fiber/cuda_runtime.h +445 -0
- diffneusim/core/cpu_engine/x14_cpu.cpp +283 -0
- diffneusim/core/diff/dual.h +126 -0
- diffneusim/core/include/diffneusim/macros.h +35 -0
- diffneusim/core/kin/kinematic_tree.h +273 -0
- diffneusim/core/math/so3.h +182 -0
- diffneusim/core/soft/adj/out_adj.h +102 -0
- diffneusim/core/soft/adj/rnea_adj.h +425 -0
- diffneusim/core/soft/adj/rows_adj.h +439 -0
- diffneusim/core/soft/adj/rows_functor.h +89 -0
- diffneusim/core/soft/adj/rows_lanes.h +443 -0
- diffneusim/core/soft/adj/shell_adj.h +243 -0
- diffneusim/core/soft/adj/tree_adj.h +356 -0
- diffneusim/core/soft/collide.h +183 -0
- diffneusim/core/soft/gpu/adj14.cuh +233 -0
- diffneusim/core/soft/gpu/adj14_mus.cuh +98 -0
- diffneusim/core/soft/gpu/adj_shell.cuh +50 -0
- diffneusim/core/soft/gpu/adj_tab.cuh +49 -0
- diffneusim/core/soft/gpu/body14.cuh +47 -0
- diffneusim/core/soft/gpu/chol_rn.cuh +458 -0
- diffneusim/core/soft/gpu/chol_small.cuh +123 -0
- diffneusim/core/soft/gpu/chol_split.cuh +193 -0
- diffneusim/core/soft/gpu/engine_launch.cuh +263 -0
- diffneusim/core/soft/gpu/fk_rn.cuh +109 -0
- diffneusim/core/soft/gpu/generated/body_019e20820f86_mmfloor.cuh +28 -0
- diffneusim/core/soft/gpu/generated/body_62f77a4bb16b_mmfloor.cuh +52 -0
- diffneusim/core/soft/gpu/generated/body_77dbb7213f26_mmfloor_rampsb3l_n6t12.cuh +28 -0
- diffneusim/core/soft/gpu/generated/body_8989b60e4486_mmfloor_rampsb3l_n6t12.cuh +28 -0
- diffneusim/core/soft/gpu/generated/body_8989b60e4486_mmfloor_rhlsd05_n6t12.cuh +28 -0
- diffneusim/core/soft/gpu/generated/body_8989b60e4486_mmfloor_rhlsdef_n6t12.cuh +28 -0
- diffneusim/core/soft/gpu/generated/body_8989b60e4486_mmfloor_rhlsmjd_n6t12.cuh +28 -0
- diffneusim/core/soft/gpu/generated/body_a1e8b196b2cd_mmfloor_rampsb3l_n6t12.cuh +52 -0
- diffneusim/core/soft/gpu/generated/body_a944653edd64_mmfloor.cuh +25 -0
- diffneusim/core/soft/gpu/generated/body_a944653edd64_mmfloor_rampsb3l_n6t12.cuh +25 -0
- diffneusim/core/soft/gpu/generated/g1_soft_5db44fd45286.cuh +74 -0
- diffneusim/core/soft/gpu/generated/split_62f77a4bb16b_mmfloor.cuh +18 -0
- diffneusim/core/soft/gpu/generated/split_a1e8b196b2cd_mmfloor_rampsb3l_n6t12.cuh +18 -0
- diffneusim/core/soft/gpu/generated/x14_soft_019e20820f86_mmfloor.cuh +123 -0
- diffneusim/core/soft/gpu/generated/x14_soft_62f77a4bb16b_mmfloor.cuh +129 -0
- diffneusim/core/soft/gpu/generated/x14_soft_77dbb7213f26_mmfloor_rampsb3l_n6t12.cuh +123 -0
- diffneusim/core/soft/gpu/generated/x14_soft_8989b60e4486_mmfloor_rampsb3l_n6t12.cuh +123 -0
- diffneusim/core/soft/gpu/generated/x14_soft_8989b60e4486_mmfloor_rhlsd05_n6t12.cuh +123 -0
- diffneusim/core/soft/gpu/generated/x14_soft_8989b60e4486_mmfloor_rhlsdef_n6t12.cuh +123 -0
- diffneusim/core/soft/gpu/generated/x14_soft_8989b60e4486_mmfloor_rhlsmjd_n6t12.cuh +123 -0
- diffneusim/core/soft/gpu/generated/x14_soft_a1e8b196b2cd_mmfloor_rampsb3l_n6t12.cuh +129 -0
- diffneusim/core/soft/gpu/generated/x14_soft_a944653edd64_mmfloor.cuh +123 -0
- diffneusim/core/soft/gpu/generated/x14_soft_a944653edd64_mmfloor_rampsb3l_n6t12.cuh +123 -0
- diffneusim/core/soft/gpu/k_mus.cuh +1038 -0
- diffneusim/core/soft/gpu/k_mus_host.cuh +377 -0
- diffneusim/core/soft/gpu/k_pre.cuh +52 -0
- diffneusim/core/soft/gpu/kernel_p.cuh +490 -0
- diffneusim/core/soft/gpu/kp14.cuh +465 -0
- diffneusim/core/soft/gpu/l2v2.cuh +367 -0
- diffneusim/core/soft/gpu/l2x14.cuh +319 -0
- diffneusim/core/soft/gpu/l3.cuh +1483 -0
- diffneusim/core/soft/gpu/model_view.cuh +48 -0
- diffneusim/core/soft/gpu/mus_case_fits.h +15 -0
- diffneusim/core/soft/gpu/mus_classes.h +182 -0
- diffneusim/core/soft/gpu/mus_row_cf.h +44 -0
- diffneusim/core/soft/gpu/rew14.cuh +177 -0
- diffneusim/core/soft/gpu/rows_ctab.cuh +44 -0
- diffneusim/core/soft/gpu/tree_m.cuh +247 -0
- diffneusim/core/soft/gpu/x14_engine_kernels.cuh +260 -0
- diffneusim/core/soft/gpu/x14_rowcf.h +14 -0
- diffneusim/core/soft/hand.h +124 -0
- diffneusim/core/soft/impedance.h +115 -0
- diffneusim/core/soft/jvp.h +202 -0
- diffneusim/core/soft/kin.h +250 -0
- diffneusim/core/soft/muscle.h +1208 -0
- diffneusim/core/soft/newton.h +371 -0
- diffneusim/core/soft/rows.h +176 -0
- diffneusim/core/soft/step.h +188 -0
- diffneusim/core/soft/tape.h +313 -0
- diffneusim/core/soft/x14/collide14.h +69 -0
- diffneusim/core/soft/x14/jvp14.h +182 -0
- diffneusim/core/soft/x14/law14.h +453 -0
- diffneusim/core/soft/x14adj/collide14_adj.h +134 -0
- diffneusim/core/soft/x14adj/passive14_adj.h +162 -0
- diffneusim/core/soft/x14adj/reward14.h +484 -0
- diffneusim/core/soft/x14adj/rows14_adj.h +400 -0
- diffneusim/core/soft/x14adj/scan14.h +349 -0
- diffneusim/core/soft/x14adj/shell14_adj.h +122 -0
- diffneusim/core/soft/x14adj/sweep14.h +255 -0
- diffneusim/core/soft/x14adj/tree14_adj.h +500 -0
- diffneusim/core/soft/x14adj/x14adj_common.h +96 -0
- diffneusim/data/mirror/H1622v2k_geyer_hfdeq.npz +0 -0
- diffneusim/data/mirror/H1622v2k_hfd.npz +0 -0
- diffneusim/data/mirror/H1622v2k_millard_hfdeq.npz +0 -0
- diffneusim/data/mirror/fullbody_contact.npz +0 -0
- diffneusim/data/mirror/fullbody_contact_spinecoupled_armless_ball_lspine_millard.npz +0 -0
- diffneusim/data/mirror/fullbody_contact_spinecoupled_armless_ball_lspine_millard_stickspin_wrapvia_mtp60k25_trunkfix_toepair_n1_p2str.npz +0 -0
- diffneusim/data/mirror/fullbody_contact_spinecoupled_armless_ball_lspine_millard_stickspin_wrapvia_mtp60k25_trunkfix_toepair_n1_p2str_rigid.npz +0 -0
- diffneusim/data/mirror/fullbody_contact_spinecoupled_armless_ball_lspine_millard_stickspin_wrapvia_mtp60k25_trunkfix_toepair_n1_src.npz +0 -0
- diffneusim/data/mirror/fullbody_contact_spinecoupled_armless_ball_lspine_millard_stickspin_wrapvia_mtp60k25_trunkfix_toepair_n1_src_rigid.npz +0 -0
- diffneusim/data/mirror/fullbody_contact_spinecoupled_armless_ball_lspine_osimeq.npz +0 -0
- diffneusim/data/mirror/fullbody_contact_spinecoupled_armless_ball_lspine_osimeq_stickspin.npz +0 -0
- diffneusim/data/mirror/fullbody_contact_spinecoupled_armless_ball_lspine_osimeq_stickspin_wrapvia_mtp60k25_calf2_pe.npz +0 -0
- diffneusim/data/mirror/fullbody_contact_spinecoupled_armless_ball_lspine_osimeq_stickspin_wrapvia_mtp60k25_trunkfix_calf2_pe_toepair_flsrc.npz +0 -0
- diffneusim/data/mirror/fullbody_contact_spinecoupled_armless_ball_lspine_osimeq_stickspin_wrapvia_mtp60k25_trunkfix_calf2_pe_toepair_flsrc_axfix.npz +0 -0
- diffneusim/data/mirror/fullbody_contact_spinecoupled_armless_ball_lspine_osimeq_stickspin_wrapvia_mtp60k25_trunkfix_calf2_pe_toepair_flsrc_axfixlegs01.npz +0 -0
- diffneusim/data/mirror/fullbody_contact_spinecoupled_armless_ball_lspine_osimeq_stickspin_wrapvia_mtp60k25_trunkfix_calf2_pe_toepair_flsrc_jd01.npz +0 -0
- diffneusim/data/mirror/fullbody_contact_spinecoupled_armless_ball_lspine_osimeq_stickspin_wrapvia_mtp60k25_trunkfix_calf2_pe_toepair_flsrc_jd01legs.npz +0 -0
- diffneusim/data/mirror/fullbody_contact_spinecoupled_armless_ball_lspine_osimeq_stickspin_wrapvia_mtp60k25_trunkfix_calf2_pe_toepair_flsrc_jd01lumbar.npz +0 -0
- diffneusim/data/mirror/fullbody_contact_spinecoupled_armless_ball_lspine_osimeq_stickspin_wrapvia_mtp60k25_trunkfix_calf2_pe_toepair_flsrc_lumbfix.npz +0 -0
- diffneusim/data/mirror/fullbody_contact_spinecoupled_armless_ball_lspine_osimeq_stickspin_wrapvia_mtp60k25_trunkfix_calf2_pe_toepair_flsrc_lumbfixlegs01.npz +0 -0
- diffneusim/data/mirror/fullbody_contact_spinecoupled_armless_ball_lspine_osimeq_stickspin_wrapvia_mtp60k25_trunkfix_calf2_pe_toepair_flsrc_n1.npz +0 -0
- diffneusim/data/mirror/fullbody_contact_spinecoupled_armless_ball_lspine_osimeq_stickspin_wrapvia_mtp60k25_trunkfix_calf2_pe_toepair_flsrc_n1a.npz +0 -0
- diffneusim/data/mirror/fullbody_contact_spinecoupled_armless_ball_lspine_osimeq_stickspin_wrapvia_mtp60k25_trunkfix_calf2_pe_toepair_flsrc_n2.npz +0 -0
- diffneusim/data/mirror/fullbody_contact_spinecoupled_armless_ball_lspine_osimeq_stickspin_wrapvia_mtp60k25_trunkfix_calf2_pe_toepair_flsrc_rom23.npz +0 -0
- diffneusim/data/mirror/fullbody_contact_spinecoupled_fusedhand_ball_lspine_girdle_millard_stickspin_wrapvia_mtp60k25_trunkfix_toepair.npz +0 -0
- diffneusim/data/mirror/fullbody_contact_spinecoupled_fusedhand_ball_lspine_girdle_osimeq_stickspin_wrapvia_mtp60k25_trunkfix_calf2_pe_toepair_flsrc.npz +0 -0
- diffneusim/data/mirror/fullbody_contact_spinecoupled_fusedhand_ball_lspine_girdle_osimeq_stickspin_wrapvia_mtp60k25_trunkfix_calf2_pe_toepair_flsrc_hinge.npz +0 -0
- diffneusim/data/mirror/fullbody_contact_spinecoupled_fusedhand_ball_lspine_girdle_osimeq_stickspin_wrapvia_mtp60k25_trunkfix_calf2_pe_toepair_flsrc_n1.npz +0 -0
- diffneusim/data/mirror/fullbody_contact_spinecoupled_fusedhand_ball_lspine_girdle_osimeq_stickspin_wrapvia_mtp60k25_trunkfix_calf2_pe_toepair_flsrc_n1a.npz +0 -0
- diffneusim/data/mirror/fullbody_contact_spinecoupled_fusedhand_ball_lspine_girdle_osimeq_stickspin_wrapvia_mtp60k25_trunkfix_calf2_pe_toepair_flsrc_n2.npz +0 -0
- diffneusim/data/mirror/fullbody_contact_spinecoupled_fusedhand_ball_lspine_girdle_osimeq_stickspin_wrapvia_mtp60k25_trunkfix_calf2_pe_toepair_flsrc_rom23.npz +0 -0
- diffneusim/data/mirror/fullbody_contact_spinecoupled_fusedhand_lspine_girdle_osimeq.npz +0 -0
- diffneusim/data/mirror/fullbody_contact_spinecoupled_lspine_girdle_millard.npz +0 -0
- diffneusim/data/mirror/fullbody_contact_spinecoupled_lspine_girdle_osimeq.npz +0 -0
- diffneusim/data/mirror/myoleg26_3d_compound_g14eq.npz +0 -0
- diffneusim/data/mirror/myoleg26_3d_kneeexp_g14eq.npz +0 -0
- diffneusim/data/mirror/myoleg26_3d_kneeexp_g14eq_trunkpose.npz +0 -0
- diffneusim/data/mirror/myoleg26_3d_kneeexp_g14eq_trunkpose_spin.npz +0 -0
- diffneusim/data/mirror/myoleg26_3d_kneeexp_g14eq_trunkpose_spin_ank30.npz +0 -0
- diffneusim/data/mirror/myoleg26_3d_kneeexp_g14eq_trunkpose_spin_ank30_hip30.npz +0 -0
- diffneusim/data/mirror/myoleg26_3d_kneeexp_g14eq_trunkpose_spin_ank30_hip30_luispe.npz +0 -0
- diffneusim/data/mirror/myoleg26_3d_kneeexp_g14eq_trunkpose_spin_ank30_hip30_trunk0701.npz +0 -0
- diffneusim/data/muscle_fit/wang_mass_volume_14t.json +91 -0
- diffneusim/data/muscle_fit/wang_mass_volume_14t_axfix.json +91 -0
- diffneusim/data/muscle_fit/wang_mass_volume_14t_axfixlegs01.json +91 -0
- diffneusim/data/muscle_fit/wang_mass_volume_14t_jd01.json +91 -0
- diffneusim/data/muscle_fit/wang_mass_volume_14t_jd01legs.json +91 -0
- diffneusim/data/muscle_fit/wang_mass_volume_14t_jd01lumbar.json +91 -0
- diffneusim/data/muscle_fit/wang_mass_volume_14t_lumbfix.json +91 -0
- diffneusim/data/muscle_fit/wang_mass_volume_14t_lumbfixlegs01.json +91 -0
- diffneusim/data/muscle_fit/wang_mass_volume_14t_n1.json +91 -0
- diffneusim/data/muscle_fit/wang_mass_volume_14t_n1a.json +91 -0
- diffneusim/data/muscle_fit/wang_mass_volume_14t_n2.json +91 -0
- diffneusim/data/muscle_fit/wang_mass_volume_14t_rom23.json +91 -0
- diffneusim/data/reference/musclemimic/myofullbody_mimic_sites.json +261 -0
- diffneusim/data/reference/pose3/pose3_scone.json +305 -0
- diffneusim/data/reference/pose3/pose3_scone.txt +3 -0
- diffneusim/data/reference/pose3/pose3_scone_gait.npz +0 -0
- diffneusim/data/reference/pose3/pose3_scone_mirror.npz +0 -0
- diffneusim/data/reference/pose3/pose3_scone_stand.npz +0 -0
- diffneusim/data/reference/x016run/MD5SUMS +241 -0
- diffneusim/data/reference/x016run/x016run_states.txt +240 -0
- diffneusim/data/reference/x016run/x016run_v3p00_s0_l0.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p00_s0_l1.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p00_s0_l2.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p00_s0_l3.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p00_s0_r0.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p00_s0_r1.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p00_s0_r2.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p00_s0_r3.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p00_s1_l0.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p00_s1_l1.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p00_s1_l2.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p00_s1_l3.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p00_s1_r0.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p00_s1_r1.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p00_s1_r2.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p00_s1_r3.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p00_s2_l0.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p00_s2_l1.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p00_s2_l2.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p00_s2_l3.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p00_s2_r0.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p00_s2_r1.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p00_s2_r2.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p00_s2_r3.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p00_s3_l0.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p00_s3_l1.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p00_s3_l2.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p00_s3_l3.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p00_s3_r0.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p00_s3_r1.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p00_s3_r2.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p00_s3_r3.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p00_s4_l0.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p00_s4_l1.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p00_s4_l2.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p00_s4_l3.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p00_s4_r0.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p00_s4_r1.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p00_s4_r2.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p00_s4_r3.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p00_s5_l0.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p00_s5_l1.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p00_s5_l2.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p00_s5_l3.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p00_s5_r0.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p00_s5_r1.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p00_s5_r2.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p00_s5_r3.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p00_s6_l0.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p00_s6_l1.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p00_s6_l2.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p00_s6_l3.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p00_s6_r0.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p00_s6_r1.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p00_s6_r2.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p00_s6_r3.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p00_s7_l0.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p00_s7_l1.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p00_s7_l2.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p00_s7_l3.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p00_s7_r0.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p00_s7_r1.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p00_s7_r2.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p00_s7_r3.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p25_s0_l0.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p25_s0_l1.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p25_s0_l2.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p25_s0_l3.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p25_s0_r0.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p25_s0_r1.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p25_s0_r2.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p25_s0_r3.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p25_s1_l0.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p25_s1_l1.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p25_s1_l2.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p25_s1_l3.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p25_s1_r0.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p25_s1_r1.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p25_s1_r2.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p25_s1_r3.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p25_s2_l0.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p25_s2_l1.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p25_s2_l2.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p25_s2_l3.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p25_s2_r0.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p25_s2_r1.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p25_s2_r2.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p25_s2_r3.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p25_s3_l0.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p25_s3_l1.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p25_s3_l2.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p25_s3_l3.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p25_s3_r0.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p25_s3_r1.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p25_s3_r2.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p25_s3_r3.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p25_s4_l0.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p25_s4_l1.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p25_s4_l2.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p25_s4_l3.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p25_s4_r0.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p25_s4_r1.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p25_s4_r2.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p25_s4_r3.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p25_s5_l0.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p25_s5_l1.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p25_s5_l2.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p25_s5_l3.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p25_s5_r0.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p25_s5_r1.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p25_s5_r2.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p25_s5_r3.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p25_s6_l0.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p25_s6_l1.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p25_s6_l2.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p25_s6_l3.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p25_s6_r0.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p25_s6_r1.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p25_s6_r2.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p25_s6_r3.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p25_s7_l0.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p25_s7_l1.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p25_s7_l2.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p25_s7_l3.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p25_s7_r0.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p25_s7_r1.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p25_s7_r2.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p25_s7_r3.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p50_s0_l0.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p50_s0_l1.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p50_s0_l2.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p50_s0_l3.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p50_s0_r0.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p50_s0_r1.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p50_s0_r2.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p50_s0_r3.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p50_s1_l0.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p50_s1_l1.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p50_s1_l2.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p50_s1_l3.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p50_s1_r0.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p50_s1_r1.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p50_s1_r2.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p50_s1_r3.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p50_s2_l0.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p50_s2_l1.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p50_s2_l2.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p50_s2_l3.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p50_s2_r0.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p50_s2_r1.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p50_s2_r2.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p50_s2_r3.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p50_s3_l0.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p50_s3_l1.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p50_s3_l2.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p50_s3_l3.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p50_s3_r0.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p50_s3_r1.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p50_s3_r2.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p50_s3_r3.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p50_s5_l0.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p50_s5_l1.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p50_s5_l2.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p50_s5_l3.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p50_s5_r0.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p50_s5_r1.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p50_s5_r2.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p50_s5_r3.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p50_s6_l0.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p50_s6_l1.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p50_s6_l2.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p50_s6_l3.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p50_s6_r0.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p50_s6_r1.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p50_s6_r2.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p50_s6_r3.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p50_s7_l0.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p50_s7_l1.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p50_s7_l2.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p50_s7_l3.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p50_s7_r0.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p50_s7_r1.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p50_s7_r2.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p50_s7_r3.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p75_s0_l0.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p75_s0_l1.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p75_s0_l2.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p75_s0_l3.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p75_s0_r0.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p75_s0_r1.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p75_s0_r2.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p75_s0_r3.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p75_s1_l0.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p75_s1_l1.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p75_s1_l2.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p75_s1_l3.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p75_s1_r0.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p75_s1_r1.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p75_s1_r2.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p75_s1_r3.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p75_s2_l0.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p75_s2_l1.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p75_s2_l2.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p75_s2_l3.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p75_s2_r0.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p75_s2_r1.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p75_s2_r2.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p75_s2_r3.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p75_s3_l0.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p75_s3_l1.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p75_s3_l2.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p75_s3_l3.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p75_s3_r0.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p75_s3_r1.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p75_s3_r2.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p75_s3_r3.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p75_s5_l0.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p75_s5_l1.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p75_s5_l2.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p75_s5_l3.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p75_s5_r0.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p75_s5_r1.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p75_s5_r2.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p75_s5_r3.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p75_s6_l0.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p75_s6_l1.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p75_s6_l2.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p75_s6_l3.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p75_s6_r0.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p75_s6_r1.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p75_s6_r2.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p75_s6_r3.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p75_s7_l0.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p75_s7_l1.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p75_s7_l2.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p75_s7_l3.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p75_s7_r0.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p75_s7_r1.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p75_s7_r2.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p75_s7_r3.npz +0 -0
- diffneusim/data/state_prior/lumbar_poly_fullbody_contact_spinecoupled_armless_ball_lspine_osimeq_stickspin_wrapvia_mtp60k25_trunkfix_calf2_pe_toepair_flsrc.npz +0 -0
- diffneusim/engine/__init__.py +0 -0
- diffneusim/engine/build_tag.py +52 -0
- diffneusim/engine/case_tables.py +46 -0
- diffneusim/engine/d16_body.py +80 -0
- diffneusim/engine/engine14.py +367 -0
- diffneusim/engine/gen_split.py +159 -0
- diffneusim/engine/hand_format.py +69 -0
- diffneusim/engine/live14.py +149 -0
- diffneusim/engine/phase_b_tree.py +137 -0
- diffneusim/engine/soft14.py +130 -0
- diffneusim/engine/soft_capi.py +373 -0
- diffneusim/engine/soft_engine.py +165 -0
- diffneusim/engine/step14.py +132 -0
- diffneusim/engine/tape_format.py +89 -0
- diffneusim/engine/x14cpu.py +163 -0
- diffneusim/env/__init__.py +0 -0
- diffneusim/env/absent.py +20 -0
- diffneusim/env/cpu14.py +105 -0
- diffneusim/env/e0loop14.py +224 -0
- diffneusim/env/env14.py +568 -0
- diffneusim/env/kin_contact14.py +193 -0
- diffneusim/env/mimic_sites_x14.json +366 -0
- diffneusim/env/old_count.py +78 -0
- diffneusim/env/rew14.py +114 -0
- diffneusim/env/rew14_hook.py +105 -0
- diffneusim/g1/__init__.py +1 -0
- diffneusim/g1/arm_a2.py +165 -0
- diffneusim/g1/arm_a3.py +576 -0
- diffneusim/g1/read_a3.py +79 -0
- diffneusim/g1/rg1_read.py +89 -0
- diffneusim/model/__init__.py +66 -0
- diffneusim/model/case.py +17 -0
- diffneusim/model/dnmodel.py +79 -0
- diffneusim/model/fuse_fixed.py +281 -0
- diffneusim/model/monitor.py +834 -0
- diffneusim/models/BODIES.toml +48 -0
- diffneusim/models/MANIFEST.toml +979 -0
- diffneusim/models/cases/G290/case.bin +0 -0
- diffneusim/models/cases/G290/case.json +1 -0
- diffneusim/models/cases/G356-SRC/case.bin +0 -0
- diffneusim/models/cases/G356-SRC/case.json +1 -0
- diffneusim/models/cases/G416/case.bin +0 -0
- diffneusim/models/cases/G416/case.json +1 -0
- diffneusim/models/cases/M290C-SRC/case.bin +0 -0
- diffneusim/models/cases/M290C-SRC/case.json +1 -0
- diffneusim/models/cases/M290R-SRC/case.bin +0 -0
- diffneusim/models/cases/M290R-SRC/case.json +1 -0
- diffneusim/models/cases/M356C-SRC/case.bin +0 -0
- diffneusim/models/cases/M356C-SRC/case.json +1 -0
- diffneusim/models/cases/M356R-SRC/case.bin +0 -0
- diffneusim/models/cases/M356R-SRC/case.json +1 -0
- diffneusim/models/cases/M416C-SRC/case.bin +0 -0
- diffneusim/models/cases/M416C-SRC/case.json +1 -0
- diffneusim/models/derived/d16_expanded_62f77a4bb16b1e67_mmfloor.xml +673 -0
- diffneusim/models/derived/d16_expanded_a1e8b196b2cd7b3c_mmfloor.xml +673 -0
- diffneusim/models/derived/d16_soft_law_019e20820f8633b9_mmfloor.json +7844 -0
- diffneusim/models/derived/d16_soft_law_62f77a4bb16b1e67_mmfloor.json +16855 -0
- diffneusim/models/derived/d16_soft_law_77dbb7213f26e821_mmfloor_rampsb3l_n6t12.json +7883 -0
- diffneusim/models/derived/d16_soft_law_8989b60e44860c5b_mmfloor_rampsb3l_n6t12.json +7883 -0
- diffneusim/models/derived/d16_soft_law_8989b60e44860c5b_mmfloor_rhlsd05_n6t12.json +7868 -0
- diffneusim/models/derived/d16_soft_law_8989b60e44860c5b_mmfloor_rhlsdef_n6t12.json +7868 -0
- diffneusim/models/derived/d16_soft_law_8989b60e44860c5b_mmfloor_rhlsmjd_n6t12.json +7868 -0
- diffneusim/models/derived/d16_soft_law_a1e8b196b2cd7b3c_mmfloor_rampsb3l_n6t12.json +16894 -0
- diffneusim/models/derived/d16_soft_law_a944653edd642082_mmfloor.json +12655 -0
- diffneusim/models/derived/d16_soft_law_a944653edd642082_mmfloor_rampsb3l_n6t12.json +12700 -0
- diffneusim/models/derived/unitree_g1_soft_law.json +15580 -0
- diffneusim/models/fullbody_contact_spinecoupled_armless_ball_lspine_millard_stickspin_wrapvia_mtp60k25_trunkfix_toepair_n1_src.dnmodel +28913 -0
- diffneusim/models/fullbody_contact_spinecoupled_armless_ball_lspine_millard_stickspin_wrapvia_mtp60k25_trunkfix_toepair_n1_src_qk.txt +1 -0
- diffneusim/models/fullbody_contact_spinecoupled_armless_ball_lspine_millard_stickspin_wrapvia_mtp60k25_trunkfix_toepair_n1_src_rigid.dnmodel +29202 -0
- diffneusim/models/fullbody_contact_spinecoupled_armless_ball_lspine_millard_stickspin_wrapvia_mtp60k25_trunkfix_toepair_n1_src_rigid_qk.txt +1 -0
- diffneusim/models/fullbody_contact_spinecoupled_armless_ball_lspine_osimeq_stickspin_wrapvia_mtp60k25_trunkfix_calf2_pe_toepair_flsrc_axfixlegs01.dnmodel +1 -0
- diffneusim/models/fullbody_contact_spinecoupled_armless_ball_lspine_osimeq_stickspin_wrapvia_mtp60k25_trunkfix_calf2_pe_toepair_flsrc_n1.dnmodel +1 -0
- diffneusim/models/fullbody_contact_spinecoupled_armless_ball_lspine_osimeq_stickspin_wrapvia_mtp60k25_trunkfix_calf2_pe_toepair_flsrc_n1_qk.txt +1 -0
- diffneusim/models/fullbody_contact_spinecoupled_ball_lspine_girdle_millard_stickspin_wrapvia_mtp60k25_trunkfix_toepair_n1_src.dnmodel +46970 -0
- diffneusim/models/fullbody_contact_spinecoupled_ball_lspine_girdle_millard_stickspin_wrapvia_mtp60k25_trunkfix_toepair_n1_src_qk.txt +1 -0
- diffneusim/models/fullbody_contact_spinecoupled_ball_lspine_girdle_osimeq_stickspin_wrapvia_mtp60k25_trunkfix_calf2_pe_toepair_flsrc_n1.dnmodel +1 -0
- diffneusim/models/fullbody_contact_spinecoupled_ball_lspine_girdle_osimeq_stickspin_wrapvia_mtp60k25_trunkfix_calf2_pe_toepair_flsrc_n1_qk.txt +1 -0
- diffneusim/models/fullbody_contact_spinecoupled_fusedhand_ball_lspine_girdle_millard_stickspin_wrapvia_mtp60k25_trunkfix_toepair_n1_src.dnmodel +38570 -0
- diffneusim/models/fullbody_contact_spinecoupled_fusedhand_ball_lspine_girdle_millard_stickspin_wrapvia_mtp60k25_trunkfix_toepair_n1_src_qk.txt +1 -0
- diffneusim/models/fullbody_contact_spinecoupled_fusedhand_ball_lspine_girdle_millard_stickspin_wrapvia_mtp60k25_trunkfix_toepair_n1_src_rigid.dnmodel +38923 -0
- diffneusim/models/fullbody_contact_spinecoupled_fusedhand_ball_lspine_girdle_millard_stickspin_wrapvia_mtp60k25_trunkfix_toepair_n1_src_rigid_qk.txt +1 -0
- diffneusim/models/fullbody_contact_spinecoupled_fusedhand_ball_lspine_girdle_osimeq_stickspin_wrapvia_mtp60k25_trunkfix_calf2_pe_toepair_flsrc_n1.dnmodel +1 -0
- diffneusim/models/fullbody_contact_spinecoupled_fusedhand_ball_lspine_girdle_osimeq_stickspin_wrapvia_mtp60k25_trunkfix_calf2_pe_toepair_flsrc_n1_qk.txt +1 -0
- diffneusim/models/fullbody_meshes/1mc.stl +0 -0
- diffneusim/models/fullbody_meshes/2distph.stl +0 -0
- diffneusim/models/fullbody_meshes/2mc.stl +0 -0
- diffneusim/models/fullbody_meshes/2midph.stl +0 -0
- diffneusim/models/fullbody_meshes/2proxph.stl +0 -0
- diffneusim/models/fullbody_meshes/3distph.stl +0 -0
- diffneusim/models/fullbody_meshes/3mc.stl +0 -0
- diffneusim/models/fullbody_meshes/3midph.stl +0 -0
- diffneusim/models/fullbody_meshes/3proxph.stl +0 -0
- diffneusim/models/fullbody_meshes/4distph.stl +0 -0
- diffneusim/models/fullbody_meshes/4mc.stl +0 -0
- diffneusim/models/fullbody_meshes/4midph.stl +0 -0
- diffneusim/models/fullbody_meshes/4proxph.stl +0 -0
- diffneusim/models/fullbody_meshes/5distph.stl +0 -0
- diffneusim/models/fullbody_meshes/5mc.stl +0 -0
- diffneusim/models/fullbody_meshes/5midph.stl +0 -0
- diffneusim/models/fullbody_meshes/5proxph.stl +0 -0
- diffneusim/models/fullbody_meshes/NOTICE +2 -0
- diffneusim/models/fullbody_meshes/capitate.stl +0 -0
- diffneusim/models/fullbody_meshes/clavicle.stl +0 -0
- diffneusim/models/fullbody_meshes/hamate.stl +0 -0
- diffneusim/models/fullbody_meshes/hat_cervical.stl +0 -0
- diffneusim/models/fullbody_meshes/hat_jaw.stl +0 -0
- diffneusim/models/fullbody_meshes/hat_skull.stl +0 -0
- diffneusim/models/fullbody_meshes/humerus.stl +0 -0
- diffneusim/models/fullbody_meshes/l_bofoot.stl +0 -0
- diffneusim/models/fullbody_meshes/l_femur.stl +0 -0
- diffneusim/models/fullbody_meshes/l_fibula.stl +0 -0
- diffneusim/models/fullbody_meshes/l_foot.stl +0 -0
- diffneusim/models/fullbody_meshes/l_patella.stl +0 -0
- diffneusim/models/fullbody_meshes/l_pelvis.stl +0 -0
- diffneusim/models/fullbody_meshes/l_talus.stl +0 -0
- diffneusim/models/fullbody_meshes/l_tibia.stl +0 -0
- diffneusim/models/fullbody_meshes/lumbar1.stl +0 -0
- diffneusim/models/fullbody_meshes/lumbar2.stl +0 -0
- diffneusim/models/fullbody_meshes/lumbar3.stl +0 -0
- diffneusim/models/fullbody_meshes/lumbar4.stl +0 -0
- diffneusim/models/fullbody_meshes/lumbar5.stl +0 -0
- diffneusim/models/fullbody_meshes/lunate.stl +0 -0
- diffneusim/models/fullbody_meshes/pisiform.stl +0 -0
- diffneusim/models/fullbody_meshes/r_bofoot.stl +0 -0
- diffneusim/models/fullbody_meshes/r_femur.stl +0 -0
- diffneusim/models/fullbody_meshes/r_fibula.stl +0 -0
- diffneusim/models/fullbody_meshes/r_foot.stl +0 -0
- diffneusim/models/fullbody_meshes/r_patella.stl +0 -0
- diffneusim/models/fullbody_meshes/r_pelvis.stl +0 -0
- diffneusim/models/fullbody_meshes/r_talus.stl +0 -0
- diffneusim/models/fullbody_meshes/r_tibia.stl +0 -0
- diffneusim/models/fullbody_meshes/radius.stl +0 -0
- diffneusim/models/fullbody_meshes/sacrum.stl +0 -0
- diffneusim/models/fullbody_meshes/scaphoid.stl +0 -0
- diffneusim/models/fullbody_meshes/scapula.stl +0 -0
- diffneusim/models/fullbody_meshes/thoracic10_s.stl +0 -0
- diffneusim/models/fullbody_meshes/thoracic11_s.stl +0 -0
- diffneusim/models/fullbody_meshes/thoracic12_s.stl +0 -0
- diffneusim/models/fullbody_meshes/thoracic1_s.stl +0 -0
- diffneusim/models/fullbody_meshes/thoracic2_s.stl +0 -0
- diffneusim/models/fullbody_meshes/thoracic3_s.stl +0 -0
- diffneusim/models/fullbody_meshes/thoracic4_s.stl +0 -0
- diffneusim/models/fullbody_meshes/thoracic5_s.stl +0 -0
- diffneusim/models/fullbody_meshes/thoracic6_s.stl +0 -0
- diffneusim/models/fullbody_meshes/thoracic7_s.stl +0 -0
- diffneusim/models/fullbody_meshes/thoracic8_s.stl +0 -0
- diffneusim/models/fullbody_meshes/thoracic9_s.stl +0 -0
- diffneusim/models/fullbody_meshes/thorax.stl +0 -0
- diffneusim/models/fullbody_meshes/thumbdist.stl +0 -0
- diffneusim/models/fullbody_meshes/thumbprox.stl +0 -0
- diffneusim/models/fullbody_meshes/trapezium.stl +0 -0
- diffneusim/models/fullbody_meshes/trapezoid.stl +0 -0
- diffneusim/models/fullbody_meshes/triquetrum.stl +0 -0
- diffneusim/models/fullbody_meshes/ulna.stl +0 -0
- diffneusim/models/source/myo_fullbody/UPSTREAM.md +91 -0
- diffneusim/models/source/myoleg/UPSTREAM.md +52 -0
- diffneusim/models/source/unitree_g1/LICENSE.mjlab +202 -0
- diffneusim/models/source/unitree_g1/UPSTREAM.md +38 -0
- diffneusim/models/source/unitree_g1/assets/head_link.STL +0 -0
- diffneusim/models/source/unitree_g1/assets/left_ankle_pitch_link.STL +0 -0
- diffneusim/models/source/unitree_g1/assets/left_ankle_roll_link.STL +0 -0
- diffneusim/models/source/unitree_g1/assets/left_elbow_link.STL +0 -0
- diffneusim/models/source/unitree_g1/assets/left_hip_pitch_link.STL +0 -0
- diffneusim/models/source/unitree_g1/assets/left_hip_roll_link.STL +0 -0
- diffneusim/models/source/unitree_g1/assets/left_hip_yaw_link.STL +0 -0
- diffneusim/models/source/unitree_g1/assets/left_knee_link.STL +0 -0
- diffneusim/models/source/unitree_g1/assets/left_rubber_hand.STL +0 -0
- diffneusim/models/source/unitree_g1/assets/left_shoulder_pitch_link.STL +0 -0
- diffneusim/models/source/unitree_g1/assets/left_shoulder_roll_link.STL +0 -0
- diffneusim/models/source/unitree_g1/assets/left_shoulder_yaw_link.STL +0 -0
- diffneusim/models/source/unitree_g1/assets/left_wrist_pitch_link.STL +0 -0
- diffneusim/models/source/unitree_g1/assets/left_wrist_roll_link.STL +0 -0
- diffneusim/models/source/unitree_g1/assets/left_wrist_yaw_link.STL +0 -0
- diffneusim/models/source/unitree_g1/assets/logo_link.STL +0 -0
- diffneusim/models/source/unitree_g1/assets/pelvis.STL +0 -0
- diffneusim/models/source/unitree_g1/assets/pelvis_contour_link.STL +0 -0
- diffneusim/models/source/unitree_g1/assets/right_ankle_pitch_link.STL +0 -0
- diffneusim/models/source/unitree_g1/assets/right_ankle_roll_link.STL +0 -0
- diffneusim/models/source/unitree_g1/assets/right_elbow_link.STL +0 -0
- diffneusim/models/source/unitree_g1/assets/right_hip_pitch_link.STL +0 -0
- diffneusim/models/source/unitree_g1/assets/right_hip_roll_link.STL +0 -0
- diffneusim/models/source/unitree_g1/assets/right_hip_yaw_link.STL +0 -0
- diffneusim/models/source/unitree_g1/assets/right_knee_link.STL +0 -0
- diffneusim/models/source/unitree_g1/assets/right_rubber_hand.STL +0 -0
- diffneusim/models/source/unitree_g1/assets/right_shoulder_pitch_link.STL +0 -0
- diffneusim/models/source/unitree_g1/assets/right_shoulder_roll_link.STL +0 -0
- diffneusim/models/source/unitree_g1/assets/right_shoulder_yaw_link.STL +0 -0
- diffneusim/models/source/unitree_g1/assets/right_wrist_pitch_link.STL +0 -0
- diffneusim/models/source/unitree_g1/assets/right_wrist_roll_link.STL +0 -0
- diffneusim/models/source/unitree_g1/assets/right_wrist_yaw_link.STL +0 -0
- diffneusim/models/source/unitree_g1/assets/torso_link_rev_1_0.STL +0 -0
- diffneusim/models/source/unitree_g1/assets/waist_roll_link_rev_1_0.STL +0 -0
- diffneusim/models/source/unitree_g1/assets/waist_yaw_link_rev_1_0.STL +0 -0
- diffneusim/models/source/unitree_g1/dump_mjlab_reference.py +30 -0
- diffneusim/models/source/unitree_g1/g1.xml +308 -0
- diffneusim/models/source/unitree_g1/g1_constants.py +298 -0
- diffneusim/models/source/unitree_g1/mjlab_compiled_reference.json +857 -0
- diffneusim/models/unitree_g1.dnmodel +4393 -0
- diffneusim/models/unitree_g1_selfcol.dnmodel +20824 -0
- diffneusim/rl/__init__.py +2 -0
- diffneusim/rl/dynsyn_layer.py +146 -0
- diffneusim/rl/footstep_plan.py +337 -0
- diffneusim/rl/g1_bm_env.py +572 -0
- diffneusim/rl/g1_bm_eval.py +168 -0
- diffneusim/rl/g1_bm_fused.py +275 -0
- diffneusim/rl/g1_bm_ppo.py +622 -0
- diffneusim/rl/g1_bm_sapo.py +551 -0
- diffneusim/rl/g1_ppo.py +395 -0
- diffneusim/rl/g1_sapo_soft.py +240 -0
- diffneusim/rl/g1_soft_env.py +452 -0
- diffneusim/rl/g1_soft_grad.py +145 -0
- diffneusim/rl/geyer_curves_torch.py +108 -0
- diffneusim/rl/gpu_fullbody_vec_env.py +1241 -0
- diffneusim/rl/imitation.py +2027 -0
- diffneusim/rl/imitation_reward_v2.py +248 -0
- diffneusim/rl/imitation_reward_v3.py +349 -0
- diffneusim/rl/latent_task.py +175 -0
- diffneusim/rl/llc_reward.py +316 -0
- diffneusim/rl/millard_curves_torch.py +154 -0
- diffneusim/rl/mirror_symmetry.py +212 -0
- diffneusim/rl/model_path.py +35 -0
- diffneusim/rl/mvae_recon.py +123 -0
- diffneusim/rl/nets_shac.py +599 -0
- diffneusim/rl/reset_pool.py +154 -0
- diffneusim/rl/sapo_capture.py +873 -0
- diffneusim/rl/sapo_vec.py +1051 -0
- diffneusim/rl/shac_vec.py +346 -0
- diffneusim/rl/state_prior.py +151 -0
- diffneusim/rl/step_library.py +105 -0
- diffneusim/rl/task_walk_env.py +1793 -0
- diffneusim/rl/task_walk_reward.py +3300 -0
- diffneusim/run.py +23 -0
- diffneusim/run_env.py +46 -0
- diffneusim/tasks/__init__.py +147 -0
- diffneusim/tasks/legacy_names.py +63 -0
- diffneusim/tasks/paths.py +79 -0
- diffneusim/tasks/settings.py +202 -0
- diffneusim/third_party/instantmimic_947430ee/LICENSE +202 -0
- diffneusim/third_party/instantmimic_947430ee/NOTICE +19 -0
- diffneusim/third_party/instantmimic_947430ee/README.md +31 -0
- diffneusim/third_party/instantmimic_947430ee/instantmimic/envs/unitree_g1/tasks/beyondmimic_tracking/benchmark_protocol.py +106 -0
- diffneusim/third_party/instantmimic_947430ee/instantmimic/envs/unitree_g1/tasks/beyondmimic_tracking/metrics.py +214 -0
- diffneusim/third_party/instantmimic_947430ee/instantmimic/envs/unitree_g1/tasks/beyondmimic_tracking/reference.py +513 -0
- diffneusim/third_party/instantmimic_947430ee/instantmimic/motion/quaternion.py +193 -0
- diffneusim/train/__init__.py +0 -0
- diffneusim/train/eval_ckpt.py +239 -0
- diffneusim/train/eval_mimic.py +133 -0
- diffneusim/train/gait_report.py +203 -0
- diffneusim/train/gcot_chain.py +51 -0
- diffneusim/train/levers.py +135 -0
- diffneusim/train/masked_reset.py +314 -0
- diffneusim/train/rl_algorithm_suite.py +917 -0
- diffneusim/train/train14.py +240 -0
- diffneusim/train/train_tw14.py +674 -0
- diffneusim/viz/__init__.py +5 -0
- diffneusim/viz/__main__.py +41 -0
- diffneusim/viz/camera.py +115 -0
- diffneusim/viz/dnrec.py +118 -0
- diffneusim/viz/dnrec_io.py +686 -0
- diffneusim/viz/hud.py +565 -0
- diffneusim/viz/meshes.py +458 -0
- diffneusim/viz/play.py +237 -0
- diffneusim/viz/record.py +74 -0
- diffneusim/viz/render.py +1402 -0
- diffneusim/viz/renderer.py +268 -0
- diffneusim/viz/rl_env_render.py +635 -0
- diffneusim/viz/snapshot.py +54 -0
- diffneusim/viz/strobe.py +124 -0
- diffneusim/viz/to_mp4.py +58 -0
- diffneusim/viz/ui.py +481 -0
- diffneusim/viz/viewer.py +2086 -0
- diffneusim-1.0.0.dist-info/METADATA +226 -0
- diffneusim-1.0.0.dist-info/RECORD +682 -0
- diffneusim-1.0.0.dist-info/WHEEL +5 -0
- diffneusim-1.0.0.dist-info/licenses/LICENSE +201 -0
- diffneusim-1.0.0.dist-info/licenses/LICENSES/BSD-3-Clause-NC-ARMS-hand-wrist-4.3.txt +20 -0
- diffneusim-1.0.0.dist-info/licenses/LICENSES/BSD-3-Clause-NC-MoBL-ARMS.txt +25 -0
- diffneusim-1.0.0.dist-info/licenses/LICENSES/CC-BY-3.0-OpenSim-geometry.txt +25 -0
- diffneusim-1.0.0.dist-info/licenses/LICENSES/MIT-Christophy2012-lumbarspine.txt +10 -0
- diffneusim-1.0.0.dist-info/licenses/LICENSES/MIT-Lai2017-model-high-flex.txt +10 -0
- diffneusim-1.0.0.dist-info/licenses/LICENSES/MIT-Lee2015-hand_muscle.txt +11 -0
- diffneusim-1.0.0.dist-info/licenses/LICENSES/MIT-Rajagopal2016-full_body.txt +11 -0
- diffneusim-1.0.0.dist-info/licenses/LICENSES/MIT-Uhlrich2022-fbmodpassivecal.txt +10 -0
- diffneusim-1.0.0.dist-info/licenses/NOTICE +274 -0
- diffneusim-1.0.0.dist-info/top_level.txt +1 -0
|
@@ -0,0 +1,212 @@
|
|
|
1
|
+
"""Canonical-frame left/right symmetry reduction, after Park et al. (`use_symmetry`).
|
|
2
|
+
|
|
3
|
+
Their wrapper does two things together, and only together do they mean anything: a binary latch says
|
|
4
|
+
which foot struck the ground most recently, and while the LEFT one did, BOTH the observation and the
|
|
5
|
+
action are mirrored. The policy therefore always sees a world in which the most-recently-struck leg is
|
|
6
|
+
the right leg, and cannot tell the two physical legs apart. That halves the state-action space and makes
|
|
7
|
+
a left/right symmetric gait the natural solution. It is ON in every one of their five configs, with no
|
|
8
|
+
code default -- a premise, not an ablation -- and we have never had it.
|
|
9
|
+
|
|
10
|
+
It is a strong PRIOR, not a hard constraint: if the second foot never strikes, the latch never flips and
|
|
11
|
+
"keep this leg planted" stays representable.
|
|
12
|
+
|
|
13
|
+
The permutation/sign vectors come from data/mirror/<model>.npz (tools/mirror_map_gen.py), which solves
|
|
14
|
+
them against the model's own kinematics and against the simulator, and is gated on
|
|
15
|
+
mirror(step(s,a)) == step(mirror(s), mirror(a)). Nothing here re-derives geometry.
|
|
16
|
+
"""
|
|
17
|
+
from __future__ import annotations
|
|
18
|
+
|
|
19
|
+
import pathlib
|
|
20
|
+
|
|
21
|
+
import numpy as np
|
|
22
|
+
import torch
|
|
23
|
+
|
|
24
|
+
from diffneusim._paths import ROOT as ROOT # (3a) the repo root
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
def load_maps(model_path):
|
|
28
|
+
"""The model's sagittal-mirror permutations/signs: (qperm, qsign, vperm, vsign, mperm).
|
|
29
|
+
|
|
30
|
+
Factored out of `MirrorSymmetry` because the RESET-TIME left/right swap needs the same maps without
|
|
31
|
+
the canonical-frame wrapper: Bolt mirrors the starting pose with p = 0.5 on every reset
|
|
32
|
+
(`msk_envs/utils/pose_helper.py:141`) and has no mirror wrapper at all, so the two are independent
|
|
33
|
+
mechanisms and either can be used alone. `tools/mirror_map_gen.py` solves these against the model's
|
|
34
|
+
own kinematics and gates them on `mirror(step(s,a)) == step(mirror(s), mirror(a))`."""
|
|
35
|
+
stem = pathlib.Path(model_path).stem
|
|
36
|
+
p = ROOT / "data" / "mirror" / f"{stem}.npz"
|
|
37
|
+
assert p.exists(), (
|
|
38
|
+
f"the left/right maps need {p}; generate it with\n"
|
|
39
|
+
f" python tools/mirror_map_gen.py --dnmodel {model_path} --out {p}")
|
|
40
|
+
m = np.load(p, allow_pickle=True)
|
|
41
|
+
# the maps record the body by the name it had when they were generated (the development name, *.jmodel): compare through the
|
|
42
|
+
# paper records' name map
|
|
43
|
+
from diffneusim.tasks.legacy_names import current_value
|
|
44
|
+
assert current_value(str(m["model"])) == pathlib.Path(model_path).name, (str(m["model"]), model_path)
|
|
45
|
+
return m["qperm"], m["qsign"], m["vperm"], m["vsign"], m["mperm"]
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
class MirrorSymmetry:
|
|
49
|
+
"""Per-env mirroring of the observation and the action, driven by a heel-strike latch."""
|
|
50
|
+
|
|
51
|
+
def __init__(self, model_path, num_envs, device, obs_blocks, drop_q0=True, n_drop_q=None,
|
|
52
|
+
act_basis=None):
|
|
53
|
+
"""`obs_blocks` names the observation's layout in order, e.g. ("q", "qd", "lce", "scalar").
|
|
54
|
+
Built ONCE into a single index/sign pair so mirroring costs one gather per step.
|
|
55
|
+
|
|
56
|
+
`act_basis` = the (nm, k) matrix V of a LINEAR action basis, when the policy emits a latent action
|
|
57
|
+
instead of per-muscle excitations. See _latent_mirror."""
|
|
58
|
+
stem = pathlib.Path(model_path).stem
|
|
59
|
+
p = ROOT / "data" / "mirror" / f"{stem}.npz"
|
|
60
|
+
assert p.exists(), (
|
|
61
|
+
f"mirror symmetry needs {p}; generate it with\n"
|
|
62
|
+
f" python tools/mirror_map_gen.py --dnmodel {model_path} --out {p}")
|
|
63
|
+
self.device = device
|
|
64
|
+
(self.qperm, self.qsign, self.vperm,
|
|
65
|
+
self.vsign, self.mperm) = load_maps(model_path)
|
|
66
|
+
nq, nv, nm = len(self.qperm), len(self.vperm), len(self.mperm)
|
|
67
|
+
|
|
68
|
+
idx, sgn, base = [], [], 0
|
|
69
|
+
for blk in obs_blocks:
|
|
70
|
+
if blk == "q":
|
|
71
|
+
# The env drops the leading absolute-position entries: myoleg26 drops q[0] (forward x),
|
|
72
|
+
# the full body drops q[0:2] (x and y). Each dropped index must map to ITSELF, or the
|
|
73
|
+
# remaining tail is not a sub-permutation -- assert rather than assume. A dropped entry may
|
|
74
|
+
# carry sign -1 (the LATERAL position negates under the mirror); that is fine precisely
|
|
75
|
+
# because it is not in the observation.
|
|
76
|
+
lo = int(n_drop_q) if n_drop_q is not None else (1 if drop_q0 else 0)
|
|
77
|
+
for i in range(lo):
|
|
78
|
+
assert self.qperm[i] == i, (
|
|
79
|
+
f"q[{i}] does not map to itself (-> {int(self.qperm[i])}); the obs cannot drop it "
|
|
80
|
+
f"and stay mirrorable")
|
|
81
|
+
if lo >= 1:
|
|
82
|
+
assert self.qsign[0] == 1.0, "q[0] (forward) must not negate under a sagittal mirror"
|
|
83
|
+
idx += [int(self.qperm[i]) - lo + base for i in range(lo, nq)]
|
|
84
|
+
sgn += [float(self.qsign[i]) for i in range(lo, nq)]
|
|
85
|
+
base += nq - lo
|
|
86
|
+
elif blk == "qd":
|
|
87
|
+
idx += [int(v) + base for v in self.vperm]
|
|
88
|
+
sgn += [float(s) for s in self.vsign]
|
|
89
|
+
base += nv
|
|
90
|
+
elif blk in ("lce", "act"):
|
|
91
|
+
idx += [int(v) + base for v in self.mperm]
|
|
92
|
+
sgn += [1.0] * nm
|
|
93
|
+
base += nm
|
|
94
|
+
elif blk == "refobs":
|
|
95
|
+
# [foot_L(x,y,z) - pelvis, foot_R(x,y,z) - pelvis, grf_L, grf_R, com_v(x,y,z)] in world
|
|
96
|
+
# z-up with y lateral. Under the sagittal mirror the two feet SWAP and every lateral (y)
|
|
97
|
+
# component negates; the vertical GRFs swap without sign; COM velocity keeps its own y sign
|
|
98
|
+
# rule (forward and vertical invariant, lateral negates).
|
|
99
|
+
idx += [base + 3, base + 4, base + 5, base + 0, base + 1, base + 2]
|
|
100
|
+
sgn += [1.0, -1.0, 1.0, 1.0, -1.0, 1.0]
|
|
101
|
+
idx += [base + 7, base + 6]
|
|
102
|
+
sgn += [1.0, 1.0]
|
|
103
|
+
idx += [base + 8, base + 9, base + 10]
|
|
104
|
+
sgn += [1.0, -1.0, 1.0]
|
|
105
|
+
base += 11
|
|
106
|
+
elif blk == "scalar": # commanded speed: mirror-invariant
|
|
107
|
+
idx += [base]
|
|
108
|
+
sgn += [1.0]
|
|
109
|
+
base += 1
|
|
110
|
+
elif blk == "heading": # (sin e, cos e) of the heading error: e negates, so sin flips
|
|
111
|
+
idx += [base, base + 1]
|
|
112
|
+
sgn += [-1.0, 1.0]
|
|
113
|
+
base += 2
|
|
114
|
+
elif blk == "footstep": # (fwd, left) of the swing and the next target: the lateral parts flip
|
|
115
|
+
idx += [base, base + 1, base + 2, base + 3]
|
|
116
|
+
sgn += [1.0, -1.0, 1.0, -1.0]
|
|
117
|
+
base += 4
|
|
118
|
+
else:
|
|
119
|
+
raise AssertionError(f"unknown observation block {blk!r}")
|
|
120
|
+
self.obs_idx = torch.tensor(idx, dtype=torch.long, device=device)
|
|
121
|
+
self.obs_sgn = torch.tensor(sgn, dtype=torch.float32, device=device)
|
|
122
|
+
self.act_idx = torch.tensor(self.mperm.astype(np.int64), dtype=torch.long, device=device)
|
|
123
|
+
self.lat_idx = self.lat_sgn = None
|
|
124
|
+
if act_basis is not None:
|
|
125
|
+
self.lat_idx, self.lat_sgn = self._latent_mirror(act_basis, device)
|
|
126
|
+
self.n_obs = base
|
|
127
|
+
# True = the LEFT foot struck most recently, i.e. the frame is flipped for this env.
|
|
128
|
+
self.flipped = torch.zeros(num_envs, dtype=torch.bool, device=device)
|
|
129
|
+
self._prev_r = torch.zeros(num_envs, dtype=torch.bool, device=device)
|
|
130
|
+
self._prev_l = torch.zeros(num_envs, dtype=torch.bool, device=device)
|
|
131
|
+
|
|
132
|
+
def _latent_mirror(self, V, device):
|
|
133
|
+
"""The mirror of a LATENT action, for a linear action basis a = clamp(V z + a_rest).
|
|
134
|
+
|
|
135
|
+
The muscle permutation P does not apply to a latent z -- but it does not have to. The basis is built
|
|
136
|
+
with tools/svd_basis_gen.py --symmetrize (M <- (M + P M P^T)/2), so span(V) is P-invariant and there
|
|
137
|
+
is a T with P V = V T; then mirroring the latent action is exactly z -> T z, in the same latent space,
|
|
138
|
+
and the SVD reduction composes with the symmetry prior at no cost. (a_rest is a scalar, so it is
|
|
139
|
+
mirror-invariant, and the clamp is elementwise, so it commutes with a permutation.)
|
|
140
|
+
|
|
141
|
+
On the committed 32-dim armless_ball basis T comes out an EXACT signed permutation: 12 latent dims
|
|
142
|
+
map to themselves, 10 pairs swap, 5 carry sign -1, and max|V T - P V| = 7.5e-15 in f64. That is a
|
|
143
|
+
property of the built matrix, not a theorem about the code, so it is checked here and the map is then
|
|
144
|
+
SNAPPED to the exact signed permutation -- which keeps `action` an exact involution. A basis that was
|
|
145
|
+
not symmetrized fails this assert rather than silently feeding the muscles an unmirrored action.
|
|
146
|
+
"""
|
|
147
|
+
Vn = V.detach().cpu().double().numpy()
|
|
148
|
+
assert Vn.shape[0] == len(self.mperm), (Vn.shape, len(self.mperm))
|
|
149
|
+
PV = Vn[self.mperm, :]
|
|
150
|
+
T = np.linalg.lstsq(Vn, PV, rcond=None)[0] # the best T with V T = P V
|
|
151
|
+
res = float(np.abs(Vn @ T - PV).max())
|
|
152
|
+
assert res < 1e-5 * max(1.0, float(np.abs(Vn).max())), (
|
|
153
|
+
f"the action basis does not admit a latent mirror: min max|V T - P V| = {res:.3e}. span(V) is not "
|
|
154
|
+
f"invariant under the muscle permutation, i.e. the basis was NOT built with "
|
|
155
|
+
f"tools/svd_basis_gen.py --symmetrize (or was built for a different model). Mirroring the latent "
|
|
156
|
+
f"action would put an unmirrored excitation on the muscles.")
|
|
157
|
+
idx = np.abs(T).argmax(axis=1)
|
|
158
|
+
sgn = np.sign(T[np.arange(len(T)), idx])
|
|
159
|
+
# exact signed permutation: one +-1 per row/column and nothing else
|
|
160
|
+
assert sorted(idx.tolist()) == list(range(len(T))), f"T is not a permutation: {idx}"
|
|
161
|
+
assert np.allclose(np.abs(T[np.arange(len(T)), idx]), 1.0, atol=1e-4), np.abs(T).max()
|
|
162
|
+
snapped = np.zeros_like(T); snapped[np.arange(len(T)), idx] = sgn
|
|
163
|
+
assert np.abs(T - snapped).max() < 1e-4, f"T is not +-1-valued: {np.abs(T - snapped).max():.3e}"
|
|
164
|
+
# ... and an involution, as it must be: V T^2 = P V T = P P V = V
|
|
165
|
+
assert (idx[idx] == np.arange(len(idx))).all() and np.allclose(sgn[idx] * sgn, 1.0)
|
|
166
|
+
# z' = T z, i.e. z'_j = sgn_j * z_{idx_j} (T has one entry per row, at column idx_j)
|
|
167
|
+
return (torch.tensor(idx.astype(np.int64), dtype=torch.long, device=device),
|
|
168
|
+
torch.tensor(sgn, dtype=torch.float32, device=device))
|
|
169
|
+
|
|
170
|
+
def reset(self, env_ids):
|
|
171
|
+
"""A restarted env starts unflipped -- their wrapper sets phase = 0.0 in reset().
|
|
172
|
+
|
|
173
|
+
REPLACE, never mutate. `flipped` is consumed by torch.where inside obs()/action(), so it is saved
|
|
174
|
+
for the backward pass; editing it in place bumps its version and BPTT dies with "one of the
|
|
175
|
+
variables needed for gradient computation has been modified by an inplace operation". The same
|
|
176
|
+
mistake is already recorded against the reward's `valid` mask -- this is the second time.
|
|
177
|
+
"""
|
|
178
|
+
f = self.flipped.clone(); f[env_ids] = False
|
|
179
|
+
self.flipped = f
|
|
180
|
+
r = self._prev_r.clone(); r[env_ids] = False
|
|
181
|
+
self._prev_r = r
|
|
182
|
+
l = self._prev_l.clone(); l[env_ids] = False
|
|
183
|
+
self._prev_l = l
|
|
184
|
+
|
|
185
|
+
def update(self, right_down, left_down):
|
|
186
|
+
"""Latch on the RISING edge of each foot's contact, exactly as phase_detect does: right strike
|
|
187
|
+
clears the flip, left strike sets it. A foot that stays down does not re-trigger."""
|
|
188
|
+
r_strike = right_down & ~self._prev_r
|
|
189
|
+
l_strike = left_down & ~self._prev_l
|
|
190
|
+
self.flipped = torch.where(r_strike, torch.zeros_like(self.flipped), self.flipped)
|
|
191
|
+
self.flipped = torch.where(l_strike & ~r_strike, torch.ones_like(self.flipped), self.flipped)
|
|
192
|
+
self._prev_r, self._prev_l = right_down, left_down
|
|
193
|
+
|
|
194
|
+
def obs(self, obs):
|
|
195
|
+
"""(n_env, n_obs) -> the same, mirrored for flipped envs."""
|
|
196
|
+
assert obs.shape[1] == self.n_obs, (obs.shape, self.n_obs)
|
|
197
|
+
m = obs[:, self.obs_idx] * self.obs_sgn
|
|
198
|
+
return torch.where(self.flipped[:, None], m, obs)
|
|
199
|
+
|
|
200
|
+
def action(self, actions):
|
|
201
|
+
"""(n_env, n_act) -> the same, mirrored for flipped envs.
|
|
202
|
+
|
|
203
|
+
Per-muscle: a pure permutation with no signs, because it is applied to the EXCITATION and muscle
|
|
204
|
+
activations are non-negative and do not flip. Latent (a linear action basis): the signed permutation
|
|
205
|
+
of _latent_mirror, which reproduces that same muscle permutation after the basis expands it."""
|
|
206
|
+
if self.lat_idx is not None:
|
|
207
|
+
assert actions.shape[1] == self.lat_idx.numel(), (actions.shape, self.lat_idx.numel())
|
|
208
|
+
m = actions[:, self.lat_idx] * self.lat_sgn
|
|
209
|
+
else:
|
|
210
|
+
assert actions.shape[1] == self.act_idx.numel(), (actions.shape, self.act_idx.numel())
|
|
211
|
+
m = actions[:, self.act_idx]
|
|
212
|
+
return torch.where(self.flipped[:, None], m, actions)
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"""Resolve a `.dnmodel` name to a path, with an `models/archive/` fallback.
|
|
2
|
+
|
|
3
|
+
One-off parameter-sweep variants live in `models/archive/` (see its README) so the live model set stays
|
|
4
|
+
legible. Every `run_config.json` and `env.sh` from a past experiment still names them bare, e.g.
|
|
5
|
+
`MYOLEG26_DNMODEL=myoleg26_3d_k500.dnmodel`, so archiving them must not break reproducing those cells --
|
|
6
|
+
hence this lookup rather than a bare `models/<name>` join.
|
|
7
|
+
|
|
8
|
+
Order is deliberate: `models/` wins, so archiving can never shadow a live model of the same name.
|
|
9
|
+
"""
|
|
10
|
+
from __future__ import annotations
|
|
11
|
+
|
|
12
|
+
import pathlib
|
|
13
|
+
|
|
14
|
+
from diffneusim._paths import ROOT as ROOT # (3a) the repo root
|
|
15
|
+
# THE DEFAULT myoLeg26 model (decisions/0033, 2026-09-25): the imitation checkpoint's. Every myoLeg26 entry point that
|
|
16
|
+
# picks a model when none is given reads this name; it was myoleg26_3d_kneeexp_g14eq.dnmodel before.
|
|
17
|
+
MYOLEG26_DEFAULT = "myoleg26_3d_kneeexp_g14eq_trunkpose_spin_ank30_hip30.dnmodel"
|
|
18
|
+
MODELS = ROOT / "models"
|
|
19
|
+
ARCHIVE = MODELS / "archive"
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
def resolve_model(name) -> pathlib.Path:
|
|
23
|
+
"""`<name>` -> models/<name>, else models/archive/<name>. An absolute path passes through."""
|
|
24
|
+
p = pathlib.Path(name)
|
|
25
|
+
if p.is_absolute():
|
|
26
|
+
return p
|
|
27
|
+
live = MODELS / p
|
|
28
|
+
if live.exists():
|
|
29
|
+
return live
|
|
30
|
+
arch = ARCHIVE / p
|
|
31
|
+
if arch.exists():
|
|
32
|
+
return arch
|
|
33
|
+
raise FileNotFoundError(
|
|
34
|
+
f"model {name!r} is in neither {MODELS} nor {ARCHIVE}. If a run config names it, the file was "
|
|
35
|
+
"deleted rather than archived -- restore it from git history.")
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
"""MuscleVAE's reconstruction objective on our bodies (DN_IM_RECON=mvae; imitation.py `_recon_reward`).
|
|
2
|
+
|
|
3
|
+
SOURCE. Feng et al., MuscleVAE (arXiv 2312.07340) Eq. 14, L_rec = sum_t gamma^t (|s~ - s|_W + |s~_muscle - s_muscle|_W'), with W
|
|
4
|
+
and gamma left unstated in the paper. The released code (PKU-MoCCA/MuscleVAE, MuscleVAECore/Utils/motion_utils.py) states them:
|
|
5
|
+
`state2ob` (l. 204-234) per body, in the ROOT body's frame: position relative to the root, 6D rotation (the first two columns of
|
|
6
|
+
the rotation matrix, diff_quat.py:550-554), linear and angular velocity; plus every body's world height
|
|
7
|
+
and the world up axis seen from the root
|
|
8
|
+
`pose_err` (l. 279-305) one L1 norm per component over all bodies and axes, the velocity pair times the control dt (1/20), weights
|
|
9
|
+
Data/Parameters/muscle.yml `musclevae.weight`: pos 0.2, rot 0.1, vel 0.5, avel 0.5, height 1.2, up_dir 3
|
|
10
|
+
`resample` (l. 40-50) the state's velocities are a backward difference over the control step (`env_recompute_velocity` True,
|
|
11
|
+
muscle_env.py:177, 388): v = (p_t - p_{t-1}) / dt, w = 2 vec(qdot (x) q_{t-1}*), qdot = (s q_t - q_{t-1}) / dt
|
|
12
|
+
with s the sign of <q_t, q_{t-1}>
|
|
13
|
+
The policy loss itself is in code MuscleVAE did not release; ControlVAE's `train_policy` (controlvae.py:415-460, the code MuscleVAE
|
|
14
|
+
builds on) applies `pose_err` to the RAW state of each imagined step against that step's reference, discounts by 0.95^i and divides
|
|
15
|
+
by the rollout length, and adds `weight_l2 |a|^2 + weight_l1 |a|_1` and the KL. Their `cal_rwd` (musclevae.py:286-292) turns the same
|
|
16
|
+
error into a reward, exp(-err / 20), for the start-state value table (C3).
|
|
17
|
+
|
|
18
|
+
WHAT IS LEFT OUT, stated: the muscle term `scaled_ml` (weight 0.1; pose_err_with_muscle, l. 307-317) needs the MTU path length as a
|
|
19
|
+
differentiable function of q, which the engine does not expose (bindings/mtu_gpu_ext.cu has no length readout; muscle_pd.py reads
|
|
20
|
+
l_mtu back through the tendon curve, which fails on a slack tendon). Their `coact` and `time_state` weights (muscle.yml) are read
|
|
21
|
+
nowhere in the released code.
|
|
22
|
+
|
|
23
|
+
BODIES. Their character has 23 bodies (Data/Misc/muscle_character.json, capsule-jehee-v4); MVAE_BODIES maps each to one of ours by
|
|
24
|
+
anatomy. Our torso, neck, head and femur/tibia are welded frames, which body_poses_subset composes from their moving ancestor. Their
|
|
25
|
+
two toe segments per foot map to our one toe body (21 entries, not 23). Their lowerback maps to the middle lumbar vertebra (lumbar3);
|
|
26
|
+
our scapulae, radii, tali, the other four vertebrae and the massless intermediate frames have no counterpart and are not read. A
|
|
27
|
+
body's position is its centre of mass (an ODE body's position is its COM), its rotation its body frame.
|
|
28
|
+
"""
|
|
29
|
+
import torch
|
|
30
|
+
|
|
31
|
+
MVAE_WEIGHT = {"pos": 0.2, "rot": 0.1, "vel": 0.5, "avel": 0.5, "height": 1.2, "up_dir": 3.0} # muscle.yml musclevae.weight
|
|
32
|
+
MVAE_RWD_SCALE = 20.0 # cal_rwd's exp(-err / 20)
|
|
33
|
+
TERMS = ("pos", "rot", "vel", "avel", "height", "up_dir")
|
|
34
|
+
|
|
35
|
+
# (theirs, ours); the first entry is the root
|
|
36
|
+
MVAE_BODIES = (("pelvis", "pelvis"),
|
|
37
|
+
("rUpperLeg", "femur_r"), ("rLowerLeg", "tibia_r"), ("rFoot", "calcn_r"), ("FootThumbR+FootPinkyR", "toes_r"),
|
|
38
|
+
("lUpperLeg", "femur_l"), ("lLowerLeg", "tibia_l"), ("lFoot", "calcn_l"), ("FootThumbL+FootPinkyL", "toes_l"),
|
|
39
|
+
("lowerback", "lumbar3"), ("torso", "torso"), ("Neck", "neck"), ("Head", "head"),
|
|
40
|
+
("rClavicle", "clavicle_r"), ("rUpperArm", "humerus_r"), ("rLowerArm", "ulna_r"), ("rHand", "lunate_r"),
|
|
41
|
+
("lClavicle", "clavicle_l"), ("lUpperArm", "humerus_l"), ("lLowerArm", "ulna_l"), ("lHand", "lunate_l"))
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
def body_layout(jm, device, dtype=torch.float32):
|
|
45
|
+
"""(body indices (B,), COM offsets in the body frame (B,3,1)) for MVAE_BODIES on the dnmodel `jm`. A name must name exactly one
|
|
46
|
+
body that carries mass: an intermediate frame shares its segment's name with zero mass, and would be the wrong pose."""
|
|
47
|
+
names = [b["name"] for b in jm["bodies"]]
|
|
48
|
+
idx = []
|
|
49
|
+
for _, ours in MVAE_BODIES:
|
|
50
|
+
hits = [i for i, n in enumerate(names) if n == ours and float(jm["bodies"][i].get("mass", 0.0)) > 0.01]
|
|
51
|
+
assert len(hits) == 1, (ours, hits)
|
|
52
|
+
idx.append(hits[0])
|
|
53
|
+
com = torch.tensor([jm["bodies"][i].get("com", [0.0, 0.0, 0.0]) for i in idx], dtype=dtype, device=device)[:, :, None]
|
|
54
|
+
return idx, com
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
# quaternions (w, x, y, z) on axis -2: (..., 4, n)
|
|
58
|
+
def _qmul(a, b):
|
|
59
|
+
aw, ax, ay, az = a.unbind(-2)
|
|
60
|
+
bw, bx, by, bz = b.unbind(-2)
|
|
61
|
+
return torch.stack((aw * bw - ax * bx - ay * by - az * bz, aw * bx + ax * bw + ay * bz - az * by,
|
|
62
|
+
aw * by - ax * bz + ay * bw + az * bx, aw * bz + ax * by - ay * bx + az * bw), -2)
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
def _qconj(q):
|
|
66
|
+
w, x, y, z = q.unbind(-2)
|
|
67
|
+
return torch.stack((w, -x, -y, -z), -2)
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
def _qrot(q, v):
|
|
71
|
+
w, x, y, z = q.unbind(-2)
|
|
72
|
+
vx, vy, vz = v.unbind(-2)
|
|
73
|
+
return torch.stack(((1 - 2 * (y * y + z * z)) * vx + 2 * (x * y - z * w) * vy + 2 * (x * z + y * w) * vz,
|
|
74
|
+
2 * (x * y + z * w) * vx + (1 - 2 * (x * x + z * z)) * vy + 2 * (y * z - x * w) * vz,
|
|
75
|
+
2 * (x * z - y * w) * vx + 2 * (y * z + x * w) * vy + (1 - 2 * (x * x + y * y)) * vz), -2)
|
|
76
|
+
|
|
77
|
+
|
|
78
|
+
def _vec6d(q):
|
|
79
|
+
"""The first two columns of R(q), (..., 6, n): quat_to_vec6d's entries (their order differs; an L1 sum does not see it)."""
|
|
80
|
+
w, x, y, z = q.unbind(-2)
|
|
81
|
+
return torch.stack((1 - 2 * (y * y + z * z), 2 * (x * y + z * w), 2 * (x * z - y * w),
|
|
82
|
+
2 * (x * y - z * w), 1 - 2 * (x * x + z * z), 2 * (y * z + x * w)), -2)
|
|
83
|
+
|
|
84
|
+
|
|
85
|
+
def com_poses(pos, quat, idx, com):
|
|
86
|
+
"""Stack the FK dicts' bodies `idx` into COM positions (B,3,n) and body quaternions (B,4,n)."""
|
|
87
|
+
P = torch.stack([pos[b] for b in idx], 0)
|
|
88
|
+
Q = torch.stack([quat[b] for b in idx], 0)
|
|
89
|
+
return P + _qrot(Q, com.to(P.dtype).expand(-1, -1, P.shape[-1])), Q
|
|
90
|
+
|
|
91
|
+
|
|
92
|
+
def nlerp(A, B, w):
|
|
93
|
+
"""Sign-aligned normalised blend of quaternions (..., 4, n) by w (n,), the per-frame reference lerp."""
|
|
94
|
+
B = torch.where((A * B).sum(-2, keepdim=True) < 0.0, -B, B)
|
|
95
|
+
Q = A * (1.0 - w) + B * w
|
|
96
|
+
return Q / Q.norm(dim=-2, keepdim=True).clamp_min(1e-12)
|
|
97
|
+
|
|
98
|
+
|
|
99
|
+
def features(P, Q, P0, Q0, dt, up=2):
|
|
100
|
+
"""state2ob on our bodies: (P, Q) now and (P0, Q0) one control step earlier, root first. Returns the six components:
|
|
101
|
+
pos (B,3,n), rot (B,6,n), vel (B,3,n), avel (B,3,n) in the root frame, height (B,n), up_dir (3,n)."""
|
|
102
|
+
rinv = _qconj(Q[0:1])
|
|
103
|
+
vel = (P - P0) / dt
|
|
104
|
+
s = torch.where((Q * Q0).sum(-2, keepdim=True) < 0.0, -1.0, 1.0)
|
|
105
|
+
avel = 2.0 * _qmul((Q * s - Q0) / dt, _qconj(Q0))[..., 1:, :]
|
|
106
|
+
e_up = torch.zeros_like(P[0:1])
|
|
107
|
+
e_up[:, up] = 1.0
|
|
108
|
+
return {"pos": _qrot(rinv, P - P[0:1]), "rot": _vec6d(_qmul(rinv, Q)), "vel": _qrot(rinv, vel), "avel": _qrot(rinv, avel),
|
|
109
|
+
"height": P[:, up], "up_dir": _qrot(rinv, e_up)[0]}
|
|
110
|
+
|
|
111
|
+
|
|
112
|
+
def l1_terms(fa, fb, dt):
|
|
113
|
+
"""pose_err per env, unweighted: one L1 norm per component over every body and axis, the velocities times dt. (n,) each."""
|
|
114
|
+
out = {}
|
|
115
|
+
for k in TERMS:
|
|
116
|
+
d = (fa[k] - fb[k]).abs()
|
|
117
|
+
out[k] = d.reshape(-1, d.shape[-1]).sum(0) * (dt if k in ("vel", "avel") else 1.0)
|
|
118
|
+
return out
|
|
119
|
+
|
|
120
|
+
|
|
121
|
+
def weighted(terms, weight=MVAE_WEIGHT):
|
|
122
|
+
"""sum_k w_k term_k, (n,): pose_err summed as cal_rwd and train_policy sum it."""
|
|
123
|
+
return sum(weight[k] * terms[k] for k in TERMS)
|