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,135 @@
|
|
|
1
|
+
"""The trainer-speed levers and the gate variants (LEVERS_PLAN.md). Each variant is applied to a built SapoVec (`algo`) and returns
|
|
2
|
+
an undo callable. Levers wrap the critic / optimizer objects, never the engine calls, so they carry to the new engine's path.
|
|
3
|
+
|
|
4
|
+
default, repeat nothing
|
|
5
|
+
ulp the gate's input nudged by 1 ulp: critic gate: obs_buf; optim gate: the raw gradients
|
|
6
|
+
ln_eps control: the critic's LayerNorm eps x 10
|
|
7
|
+
adam_eps control: the critic AdamW eps x 10
|
|
8
|
+
adam_beta2 control: the critic AdamW (1 - beta2) x 2
|
|
9
|
+
m1 lever: the critic compiled (torch.compile, inductor: LayerNorm + SiLU + bias fused)
|
|
10
|
+
m2 lever: the critic AdamW fused (fused=True), same hyperparameters and state
|
|
11
|
+
m4a lever: inductor CUDA graphs for the env's compiled regions (a dynamo reset, then triton.cudagraphs)
|
|
12
|
+
"""
|
|
13
|
+
import copy
|
|
14
|
+
|
|
15
|
+
import torch
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
def base_critic(algo):
|
|
19
|
+
if not hasattr(algo, "_lv_critic"):
|
|
20
|
+
algo._lv_critic = algo.critic
|
|
21
|
+
return algo._lv_critic
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
def base_opt(algo):
|
|
25
|
+
if not hasattr(algo, "_lv_opt"):
|
|
26
|
+
algo._lv_opt = algo.critic_opt
|
|
27
|
+
return algo._lv_opt
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
def _nudge(t):
|
|
31
|
+
return torch.nextafter(t, torch.full_like(t, float("inf")))
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
def apply(variant, algo, gate):
|
|
35
|
+
undo = []
|
|
36
|
+
algo._lv_ulp_grads = False
|
|
37
|
+
if variant in ("default", "repeat"):
|
|
38
|
+
pass
|
|
39
|
+
elif variant == "ulp":
|
|
40
|
+
if gate == "critic":
|
|
41
|
+
with torch.no_grad():
|
|
42
|
+
algo.obs_buf.copy_(_nudge(algo.obs_buf))
|
|
43
|
+
else:
|
|
44
|
+
algo._lv_ulp_grads = True
|
|
45
|
+
elif variant == "ln_eps":
|
|
46
|
+
for m in algo.critic.modules():
|
|
47
|
+
if isinstance(m, torch.nn.LayerNorm):
|
|
48
|
+
undo.append(lambda m=m, e=m.eps: setattr(m, "eps", e))
|
|
49
|
+
m.eps = m.eps * 10
|
|
50
|
+
elif variant in ("adam_eps", "adam_beta2"):
|
|
51
|
+
for g in algo.critic_opt.param_groups:
|
|
52
|
+
if variant == "adam_eps":
|
|
53
|
+
undo.append(lambda g=g, e=g["eps"]: g.__setitem__("eps", e))
|
|
54
|
+
g["eps"] = g["eps"] * 10
|
|
55
|
+
else:
|
|
56
|
+
b1, b2 = g["betas"]
|
|
57
|
+
undo.append(lambda g=g, b=g["betas"]: g.__setitem__("betas", b))
|
|
58
|
+
g["betas"] = (b1, 1.0 - 2.0 * (1.0 - b2))
|
|
59
|
+
elif variant == "m1":
|
|
60
|
+
base = algo.critic
|
|
61
|
+
algo.critic = torch.compile(base, dynamic=False)
|
|
62
|
+
undo.append(lambda: setattr(algo, "critic", base))
|
|
63
|
+
elif variant == "m1c": # M1 in place (nn.Module.compile): the same compiled forward as m1, state_dict keys unchanged, so the
|
|
64
|
+
algo.critic.compile(dynamic=False) # trainer's checkpoints and SUITE_INIT_CKPT resumes stay plain (the learning test)
|
|
65
|
+
undo.append(lambda: setattr(algo.critic, "_compiled_call_impl", None))
|
|
66
|
+
elif variant == "m2":
|
|
67
|
+
old = algo.critic_opt
|
|
68
|
+
g0 = old.param_groups[0]
|
|
69
|
+
new = torch.optim.AdamW([p for g in old.param_groups for p in g["params"]], lr=g0["lr"], betas=g0["betas"], eps=g0["eps"],
|
|
70
|
+
weight_decay=g0["weight_decay"], amsgrad=g0["amsgrad"], fused=True)
|
|
71
|
+
new.load_state_dict(old.state_dict())
|
|
72
|
+
algo.critic_opt = new
|
|
73
|
+
undo.append(lambda: setattr(algo, "critic_opt", old))
|
|
74
|
+
elif variant == "m4a": # inductor CUDA graphs (cudagraph trees) for every region compiled from here on: the env's FK / mimic
|
|
75
|
+
# compiles recompile with it after the reset. Alone only: a critic compiled after it is graphed too. (No `import torch.x`
|
|
76
|
+
# here: it would bind `torch` as a local of apply() and break the m1 branch, UnboundLocalError, 04:11)
|
|
77
|
+
from torch import _dynamo
|
|
78
|
+
from torch._inductor import config as ic
|
|
79
|
+
assert not isinstance(getattr(algo, "critic", None), _dynamo.eval_frame.OptimizedModule), "m4a before / without m1"
|
|
80
|
+
_dynamo.reset()
|
|
81
|
+
ic.triton.cudagraphs = True
|
|
82
|
+
undo.append(lambda: (_dynamo.reset(), setattr(ic.triton, "cudagraphs", False)))
|
|
83
|
+
else:
|
|
84
|
+
raise SystemExit(f"unknown variant {variant}")
|
|
85
|
+
|
|
86
|
+
def run_undo():
|
|
87
|
+
for u in reversed(undo):
|
|
88
|
+
u()
|
|
89
|
+
return run_undo
|
|
90
|
+
|
|
91
|
+
|
|
92
|
+
def capture_optim_inputs(algo, critic0, copt0, obs0, tgt0, rng0, cap):
|
|
93
|
+
"""the default path's raw gradients of train_critic's first minibatch, for G-optim's identical inputs"""
|
|
94
|
+
algo.critic, algo.critic_opt = base_critic(algo), base_opt(algo)
|
|
95
|
+
algo.critic.load_state_dict(critic0); algo.critic_opt.load_state_dict(copy.deepcopy(copt0))
|
|
96
|
+
algo.obs_buf.copy_(obs0); algo.target_values.copy_(tgt0)
|
|
97
|
+
torch.cuda.set_rng_state_all(rng0)
|
|
98
|
+
cap.clear()
|
|
99
|
+
algo.train_critic()
|
|
100
|
+
torch.cuda.synchronize()
|
|
101
|
+
return dict(grads=cap["grads"].clone())
|
|
102
|
+
|
|
103
|
+
|
|
104
|
+
def optim_only_step(algo, ref):
|
|
105
|
+
"""train_critic's step on identical raw gradients: nan_to_num, clip (the sapo_vec name, wrapped by the gate), critic_opt.step"""
|
|
106
|
+
from diffneusim.rl import sapo_vec
|
|
107
|
+
g = ref["grads"]
|
|
108
|
+
if algo._lv_ulp_grads:
|
|
109
|
+
g = _nudge(g)
|
|
110
|
+
o = 0
|
|
111
|
+
for p in algo.critic.parameters():
|
|
112
|
+
n = p.numel()
|
|
113
|
+
p.grad = g[o:o + n].view_as(p).clone()
|
|
114
|
+
o += n
|
|
115
|
+
assert o == g.numel()
|
|
116
|
+
for p in algo.critic.parameters():
|
|
117
|
+
p.grad.nan_to_num_(0.0, 0.0, 0.0)
|
|
118
|
+
sapo_vec.clip_grad_norm_(algo.critic.parameters(), algo.grad_norm)
|
|
119
|
+
algo.critic_opt.step()
|
|
120
|
+
|
|
121
|
+
|
|
122
|
+
def install(algo, names):
|
|
123
|
+
"""adopt levers in a training run (no undo): the driver calls it right after make_algo and the warm start"""
|
|
124
|
+
for n in names:
|
|
125
|
+
assert n in ("m1", "m1c", "m4a"), f"not an adopted lever: {n}"
|
|
126
|
+
apply(n, algo, gate="critic")
|
|
127
|
+
algo._lv_installed = list(names)
|
|
128
|
+
return algo
|
|
129
|
+
|
|
130
|
+
|
|
131
|
+
def install_from_env(algo):
|
|
132
|
+
"""E0SPEED_LEVERS=m1[,...]: the flag. Unset: nothing (the default path)"""
|
|
133
|
+
import os
|
|
134
|
+
names = [x for x in os.environ.get("E0SPEED_LEVERS", "").split(",") if x]
|
|
135
|
+
return install(algo, names)
|
|
@@ -0,0 +1,314 @@
|
|
|
1
|
+
"""The masked reset (the paper imitation's per-step reset): every env's reset under a mask, with no host read, captured as one
|
|
2
|
+
forward-only CUDA graph per control step inside the actor window's graphs.
|
|
3
|
+
|
|
4
|
+
from diffneusim.train import masked_reset
|
|
5
|
+
masked_reset.install(out_dir) # before the env is built: wraps Env14.__init__ and the actor-window installer
|
|
6
|
+
|
|
7
|
+
The reset (one control step, every env at once, mask m = done):
|
|
8
|
+
cid = randint(n_clips, (N,)), phi = rand(N) * phase_max[cid] (env.rng, drawn for the whole window at its start)
|
|
9
|
+
q0, qd0 = task.ref_at(phi) on cid; the joint-limit clamp; lce0 = Engine14.equil_lce(old_to_law(q0), l_opt, A0, mask = m)
|
|
10
|
+
q, qd, lce, a, z, actions, phase, clip_id, _prev_x = where(m, reset value, current)
|
|
11
|
+
progress, _just_reset, Env14's warm and reset_mask: masked_fill_ / logical_or_ in place
|
|
12
|
+
The values written for a reset env are the per-env reset's for the same (cid, phi); only the RNG stream differs from it.
|
|
13
|
+
|
|
14
|
+
In the graph windows, R_k (the reset after slot k) is captured per slot in its own pool. It reads A_k's static outputs, this slot's
|
|
15
|
+
rows of the draw table and four persistent state buffers (z, actions, _prev_x, clip_id), runs the masked reset, and copies the
|
|
16
|
+
results in place into A_k's static outputs and the buffers. Its gradient: the outputs alias A_k's static outputs, and the backward
|
|
17
|
+
is grad.masked_fill(mask, 0), the backward of where(m, reset value, x) for x. The first (recorded) window runs the same reset
|
|
18
|
+
eagerly on the same draw table.
|
|
19
|
+
|
|
20
|
+
Folded from the paper's launchers (p4_launch.py e3459351 / p4b_launch.py c946a00d, run as one): the same operations in the same order.
|
|
21
|
+
"""
|
|
22
|
+
import json
|
|
23
|
+
import os
|
|
24
|
+
import pathlib
|
|
25
|
+
import time
|
|
26
|
+
|
|
27
|
+
import torch
|
|
28
|
+
|
|
29
|
+
from diffneusim.env import env14 as E14
|
|
30
|
+
from diffneusim.rl import gpu_fullbody_vec_env as GFE
|
|
31
|
+
from diffneusim.rl import sapo_capture as SC
|
|
32
|
+
|
|
33
|
+
A_OUT = ("ent", "ent_norm", "rew", "done", "timeout", "obr", "ep_end", "q", "qd", "lce", "a", "phase", "progress", "a1")
|
|
34
|
+
R_GRAD = ("q", "qd", "lce", "a") # the reset values that carry a gradient (the where on them)
|
|
35
|
+
ST = {"window": 0, "k": 0, "w_wall": None, "w_raw": None, "f": None, "out": None}
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
def like(x, ref):
|
|
39
|
+
"""x (no gradient: a reset value) in ref's layout, so that where(m, x, ref) keeps ref's strides as the per-env reset's clone()
|
|
40
|
+
does (the window's chain checks every linked input's shape, dtype and stride)"""
|
|
41
|
+
if x.stride() == ref.stride():
|
|
42
|
+
return x
|
|
43
|
+
with torch.no_grad():
|
|
44
|
+
return torch.empty_like(ref).copy_(x)
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
def keep(out, ref):
|
|
48
|
+
assert out.shape == ref.shape and out.dtype == ref.dtype and out.stride() == ref.stride(), (out.shape, ref.shape, out.stride(), ref.stride())
|
|
49
|
+
return out
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
def masked_reset(env, e14, m, cid, phi):
|
|
53
|
+
"""the reset of every env under mask m (bool [N]) with no host read, on the drawn (cid, phi)"""
|
|
54
|
+
t, N, dev = env.imitation_task, env.num_envs, env.device
|
|
55
|
+
with torch.no_grad():
|
|
56
|
+
prev, t.clip_id = t.clip_id, cid
|
|
57
|
+
try:
|
|
58
|
+
q0, qd0 = t.ref_at(phi)
|
|
59
|
+
finally:
|
|
60
|
+
t.clip_id = prev
|
|
61
|
+
q0 = q0.clone()
|
|
62
|
+
q0[env._lim_qadr] = torch.clamp(q0[env._lim_qadr], env._lim_lo, env._lim_hi)
|
|
63
|
+
lce_seed = env.l_opt.view(-1, 1).repeat(1, N).contiguous()
|
|
64
|
+
a0 = torch.full((env.nm, N), env.A0, dtype=torch.float32, device=dev)
|
|
65
|
+
qn, _ = E14.old_to_law(q0, torch.zeros(env.qd.shape[0], N, dtype=q0.dtype, device=q0.device))
|
|
66
|
+
lce0 = e14.eng.equil_lce(qn.t().contiguous().float(), lce_seed.t().contiguous().float(), a0.t().contiguous().float(), m,
|
|
67
|
+
outer=8).t().contiguous()
|
|
68
|
+
mq = m.view(1, N)
|
|
69
|
+
env.q = keep(torch.where(mq, like(q0, env.q), env.q), env.q)
|
|
70
|
+
env.qd = keep(torch.where(mq, like(qd0, env.qd), env.qd), env.qd)
|
|
71
|
+
env.lce = keep(torch.where(mq, like(lce0, env.lce), env.lce), env.lce)
|
|
72
|
+
env.a = keep(torch.where(mq, like(a0, env.a), env.a), env.a)
|
|
73
|
+
env.z = keep(torch.where(m.view(1, N, *([1] * (env.z.dim() - 2))), torch.zeros((), dtype=env.z.dtype, device=dev), env.z), env.z)
|
|
74
|
+
env.actions = keep(torch.where(m.view(N, *([1] * (env.actions.dim() - 1))), torch.zeros((), dtype=env.actions.dtype, device=dev),
|
|
75
|
+
env.actions), env.actions)
|
|
76
|
+
env.progress.masked_fill_(m, 0)
|
|
77
|
+
env._just_reset.masked_fill_(m, True)
|
|
78
|
+
env._prev_x = keep(torch.where(m, env.q[GFE.ROOT_FWD].detach(), env._prev_x), env._prev_x)
|
|
79
|
+
env.phase = keep(torch.where(m, like(phi, env.phase), env.phase), env.phase)
|
|
80
|
+
t.clip_id = keep(torch.where(m, cid, t.clip_id), t.clip_id)
|
|
81
|
+
with torch.no_grad():
|
|
82
|
+
e14.warm.masked_fill_(m.view(N, *([1] * (e14.warm.dim() - 1))), 0.0)
|
|
83
|
+
e14.reset_mask.logical_or_(m)
|
|
84
|
+
return cid, phi
|
|
85
|
+
|
|
86
|
+
|
|
87
|
+
class _RFn(torch.autograd.Function):
|
|
88
|
+
"""R_k's replay in the autograd graph: the outputs alias A_k's static q, qd, lce, a (now post-reset); the backward passes the
|
|
89
|
+
kept columns and zeroes the reset ones, the values of where(m, reset value, x)'s backward for x"""
|
|
90
|
+
|
|
91
|
+
@staticmethod
|
|
92
|
+
def forward(ctx, W, k, q, qd, lce, a):
|
|
93
|
+
W.rg[k].replay()
|
|
94
|
+
outs = tuple(o.detach() for o in W.r_alias[k])
|
|
95
|
+
ctx.m = W.mbuf[k]
|
|
96
|
+
nd = [o for o, x in zip(outs, (q, qd, lce, a)) if not x.requires_grad]
|
|
97
|
+
if nd:
|
|
98
|
+
ctx.mark_non_differentiable(*nd)
|
|
99
|
+
return outs
|
|
100
|
+
|
|
101
|
+
@staticmethod
|
|
102
|
+
@torch.autograd.function.once_differentiable
|
|
103
|
+
def backward(ctx, *g):
|
|
104
|
+
m = ctx.m.view(1, -1)
|
|
105
|
+
return (None, None) + tuple(None if x is None else x.masked_fill(m, 0.0) for x in g)
|
|
106
|
+
|
|
107
|
+
|
|
108
|
+
class SapoWindowR(SC.SapoWindow):
|
|
109
|
+
"""the actor window with the masked reset in place of the per-env reset"""
|
|
110
|
+
|
|
111
|
+
def __init__(self, algo, env, e14, mode):
|
|
112
|
+
super().__init__(algo, env, e14, mode)
|
|
113
|
+
self.cid_tab = self.phi_tab = None # (S, N) start draws, refilled in place every window
|
|
114
|
+
self.rg = None # R_k's graphs once captured
|
|
115
|
+
self.mbuf = None
|
|
116
|
+
self.Z = self.ACT = self.PX = self.CID = self.JR = None
|
|
117
|
+
self.stats = dict(windows=0, r_replays=0)
|
|
118
|
+
self._souts = None
|
|
119
|
+
|
|
120
|
+
# ---------------------------------------------------------------- the start draws, for every slot of the window
|
|
121
|
+
def window_start(self):
|
|
122
|
+
env, t, S, N = self.env, self.task, self.S, self.N
|
|
123
|
+
for k in range(S):
|
|
124
|
+
cid = torch.randint(t.n_clips, (N,), generator=env.rng, device=env.device)
|
|
125
|
+
phi = torch.rand(N, generator=env.rng, device=env.device) * t._rsi_phase_max[cid]
|
|
126
|
+
if self.cid_tab is None:
|
|
127
|
+
self.cid_tab = torch.empty((S, N), dtype=cid.dtype, device=cid.device)
|
|
128
|
+
self.phi_tab = torch.empty((S, N), dtype=phi.dtype, device=phi.device)
|
|
129
|
+
self.cid_tab[k].copy_(cid)
|
|
130
|
+
self.phi_tab[k].copy_(phi)
|
|
131
|
+
if self.rg is not None: # graph windows: the env state R_k reads and writes lives in fixed buffers
|
|
132
|
+
with torch.no_grad():
|
|
133
|
+
for buf, name in ((self.Z, "z"), (self.ACT, "actions"), (self.PX, "_prev_x")):
|
|
134
|
+
cur = getattr(env, name)
|
|
135
|
+
if cur is not buf:
|
|
136
|
+
assert cur.shape == buf.shape and cur.dtype == buf.dtype and cur.stride() == buf.stride(), name
|
|
137
|
+
buf.copy_(cur)
|
|
138
|
+
setattr(env, name, buf)
|
|
139
|
+
if t.clip_id is not self.CID:
|
|
140
|
+
self.CID.copy_(t.clip_id)
|
|
141
|
+
t.clip_id = self.CID
|
|
142
|
+
assert env._just_reset is self.JR, "env._just_reset was reassigned after R's capture"
|
|
143
|
+
self.stats["windows"] += 1
|
|
144
|
+
if self.stats["windows"] % 50 == 0:
|
|
145
|
+
mem_line(f"window {self.stats['windows']}")
|
|
146
|
+
|
|
147
|
+
# ---------------------------------------------------------------- the reset, in place of env._step_reset
|
|
148
|
+
def reset_step(self, k, graph, q, qd, lce, a, done, timeout):
|
|
149
|
+
env, e14, t = self.env, self.e14, self.task
|
|
150
|
+
if not graph: # the eager masked reset on the table's rows
|
|
151
|
+
masked_reset(env, e14, done.detach().bool(), self.cid_tab[k], self.phi_tab[k])
|
|
152
|
+
return
|
|
153
|
+
assert env.z is self.Z and env.actions is self.ACT and env._prev_x is self.PX and t.clip_id is self.CID
|
|
154
|
+
assert env._just_reset is self.JR
|
|
155
|
+
env.q, env.qd, env.lce, env.a = _RFn.apply(self, k, q, qd, lce, a)
|
|
156
|
+
self.stats["r_replays"] += 1 # env.phase / env.progress alias A_k's outputs, rewritten in place
|
|
157
|
+
|
|
158
|
+
# ---------------------------------------------------------------- the window's record, then R's captures
|
|
159
|
+
def _chain(self, calls, args, links):
|
|
160
|
+
out, self._souts = SC._graph_chain(calls, args, links, return_souts=True)
|
|
161
|
+
return out
|
|
162
|
+
|
|
163
|
+
def record(self, parts="ab"):
|
|
164
|
+
assert parts == "ab", parts
|
|
165
|
+
super().record(parts)
|
|
166
|
+
souts, self._souts = self._souts, None
|
|
167
|
+
self.capture_r(souts)
|
|
168
|
+
|
|
169
|
+
def capture_r(self, souts):
|
|
170
|
+
env, e14, t, S, N = self.env, self.e14, self.task, self.S, self.N
|
|
171
|
+
assert len(souts) == 2 * S and all(len(o) == len(A_OUT) for o in souts[0::2])
|
|
172
|
+
assert self.cid_tab is not None, "the recorded window drew the table"
|
|
173
|
+
names = ("q", "qd", "lce", "a", "z", "actions", "_prev_x", "phase", "progress")
|
|
174
|
+
keep_env = {n: getattr(env, n) for n in names}
|
|
175
|
+
keep_clip = t.clip_id
|
|
176
|
+
with torch.no_grad():
|
|
177
|
+
self.Z = env.z.detach().clone()
|
|
178
|
+
self.ACT = env.actions.detach().clone()
|
|
179
|
+
self.PX = env._prev_x.detach().clone()
|
|
180
|
+
self.CID = t.clip_id.detach().clone()
|
|
181
|
+
self.mbuf = torch.zeros((S, N), dtype=torch.bool, device=env.device)
|
|
182
|
+
self.JR = env._just_reset
|
|
183
|
+
self.rpool = torch.cuda.graph_pool_handle()
|
|
184
|
+
self.rg, self.r_alias = [], []
|
|
185
|
+
torch.cuda.synchronize()
|
|
186
|
+
m0, r0 = torch.cuda.memory_allocated(), torch.cuda.memory_reserved()
|
|
187
|
+
for k in range(S):
|
|
188
|
+
so = {n: o.detach() for n, o in zip(A_OUT, souts[2 * k])}
|
|
189
|
+
g = torch.cuda.CUDAGraph()
|
|
190
|
+
with torch.no_grad(), torch.cuda.graph(g, pool=self.rpool):
|
|
191
|
+
self._r_body(k, so)
|
|
192
|
+
for n, v in keep_env.items(): # the capture's tensors go back to R's pool for the next slot
|
|
193
|
+
setattr(env, n, v)
|
|
194
|
+
t.clip_id = keep_clip
|
|
195
|
+
self.rg.append(g)
|
|
196
|
+
self.r_alias.append(tuple(so[n] for n in R_GRAD))
|
|
197
|
+
torch.cuda.synchronize()
|
|
198
|
+
gb = lambda b: f"{b / 2**30:.3f}"
|
|
199
|
+
print(f"[masked_reset] captured R_0 .. R_{S - 1} (forward-only, own pool): allocated {gb(m0)} -> {gb(torch.cuda.memory_allocated())} "
|
|
200
|
+
f"GB, reserved {gb(r0)} -> {gb(torch.cuda.memory_reserved())}", flush=True)
|
|
201
|
+
mem_line("after R's captures")
|
|
202
|
+
|
|
203
|
+
def _r_body(self, k, so):
|
|
204
|
+
"""captured: the masked reset on A_k's static outputs, the results copied back where the next slot reads them"""
|
|
205
|
+
env, e14, t = self.env, self.e14, self.task
|
|
206
|
+
env.q, env.qd, env.lce, env.a, env.phase, env.progress = so["q"], so["qd"], so["lce"], so["a"], so["phase"], so["progress"]
|
|
207
|
+
env.z, env.actions, env._prev_x = self.Z, self.ACT, self.PX
|
|
208
|
+
t.clip_id = self.CID
|
|
209
|
+
m = so["done"].detach().bool()
|
|
210
|
+
self.mbuf[k].copy_(m)
|
|
211
|
+
masked_reset(env, e14, m, self.cid_tab[k], self.phi_tab[k])
|
|
212
|
+
assert env.progress is so["progress"] and env._just_reset is self.JR # masked_fill_ in place
|
|
213
|
+
for n in ("q", "qd", "lce", "a", "phase"):
|
|
214
|
+
so[n].copy_(getattr(env, n))
|
|
215
|
+
self.Z.copy_(env.z)
|
|
216
|
+
self.ACT.copy_(env.actions)
|
|
217
|
+
self.PX.copy_(env._prev_x)
|
|
218
|
+
self.CID.copy_(t.clip_id)
|
|
219
|
+
|
|
220
|
+
def baked(self):
|
|
221
|
+
b = super().baked()
|
|
222
|
+
if self.cid_tab is not None:
|
|
223
|
+
b.update(cid_tab=self.cid_tab, phi_tab=self.phi_tab)
|
|
224
|
+
return b
|
|
225
|
+
|
|
226
|
+
|
|
227
|
+
def mem_line(where):
|
|
228
|
+
s = torch.cuda.memory_stats()
|
|
229
|
+
rec = dict(where=where, allocated_gb=round(torch.cuda.memory_allocated() / 2**30, 3),
|
|
230
|
+
reserved_gb=round(torch.cuda.memory_reserved() / 2**30, 3),
|
|
231
|
+
max_allocated_gb=round(torch.cuda.max_memory_allocated() / 2**30, 3),
|
|
232
|
+
max_reserved_gb=round(torch.cuda.max_memory_reserved() / 2**30, 3),
|
|
233
|
+
alloc_retries=int(s.get("num_alloc_retries", 0)), ooms=int(s.get("num_ooms", 0)))
|
|
234
|
+
print(f"[masked_reset] mem {json.dumps(rec)}", flush=True)
|
|
235
|
+
with open(ST["out"] / "p4b_mem.jsonl", "a") as f:
|
|
236
|
+
f.write(json.dumps(rec) + "\n")
|
|
237
|
+
|
|
238
|
+
|
|
239
|
+
def _install_window(algo, env, e14):
|
|
240
|
+
W = SapoWindowR(algo, env, e14, "graph")
|
|
241
|
+
orig = algo.compute_actor_loss
|
|
242
|
+
|
|
243
|
+
def compute_actor_loss():
|
|
244
|
+
return W.actor_loss()
|
|
245
|
+
algo.compute_actor_loss = compute_actor_loss
|
|
246
|
+
|
|
247
|
+
def undo():
|
|
248
|
+
algo.compute_actor_loss = orig
|
|
249
|
+
W.undo = undo
|
|
250
|
+
print(f"[sapo_capture] the actor window with the masked reset R_k as forward-only graphs ({algo.steps_num} steps x "
|
|
251
|
+
f"{algo.num_envs} envs)", flush=True)
|
|
252
|
+
return W
|
|
253
|
+
|
|
254
|
+
|
|
255
|
+
def install(out_dir):
|
|
256
|
+
"""the masked reset for this process: Env14 gets the window log and the reset wrapper, the actor window becomes SapoWindowR.
|
|
257
|
+
out_dir receives p4_windows.jsonl (every training window's period) and p4b_mem.jsonl."""
|
|
258
|
+
assert ST["out"] is None, "masked_reset.install runs once"
|
|
259
|
+
ST["out"] = pathlib.Path(out_dir)
|
|
260
|
+
ST["out"].mkdir(parents=True, exist_ok=True)
|
|
261
|
+
ST["f"] = open(ST["out"] / "p4_windows.jsonl", "a")
|
|
262
|
+
assert os.environ.get("DN_RSI_NO_NOISE"), "the masked reset is RSI without reset noise"
|
|
263
|
+
assert os.environ.get("DN_FIBER_INIT_ITERS", "8") == "8"
|
|
264
|
+
assert os.environ.get("E0_ENV14_EQUIL14") == "1", "the masked reset runs the 14x law's equilibrium (E0_ENV14_EQUIL14=1)"
|
|
265
|
+
assert os.environ.get("E0_P3") == "1", "the masked reset is graphed inside the actor window's graphs (E0_P3=1)"
|
|
266
|
+
orig_e14 = E14.Env14.__init__
|
|
267
|
+
|
|
268
|
+
def e14_init(self, env, tree14, case_dir, H):
|
|
269
|
+
orig_e14(self, env, tree14, case_dir, H)
|
|
270
|
+
assert env.imitation and env.taskwalk is None and env.mirror is None and env.latent_task is None and env.musclepd is None
|
|
271
|
+
assert getattr(env, "ET_MODE", "") != "mvae_head" and not env.REF_SWITCH and self.reset_fix
|
|
272
|
+
t = env.imitation_task
|
|
273
|
+
assert t.any_nonloop and not bool(t.clip_loop.any()) and t._clip_only is None and getattr(t, "clip_mix", None) is None
|
|
274
|
+
assert not getattr(t, "RSI_STANCE", False) and t.CLIP_DRAW == "clip"
|
|
275
|
+
inner_init, inner_reset = env.initialize_trajectory, env._step_reset
|
|
276
|
+
|
|
277
|
+
def initialize_trajectory(*x, **kw):
|
|
278
|
+
if torch.is_grad_enabled():
|
|
279
|
+
# period_s is CLOCK_MONOTONIC_RAW's: on WSL, time.time() can be stepped, so a per-window time.time() span is wrong;
|
|
280
|
+
# period_wall_s keeps the time.time() span beside it
|
|
281
|
+
now, raw = time.time(), time.clock_gettime(time.CLOCK_MONOTONIC_RAW)
|
|
282
|
+
if ST["w_wall"] is not None:
|
|
283
|
+
ST["f"].write(json.dumps(dict(window=ST["window"], period_s=raw - ST["w_raw"], period_wall_s=now - ST["w_wall"])) + "\n")
|
|
284
|
+
ST["f"].flush()
|
|
285
|
+
ST["window"] += 1
|
|
286
|
+
ST["w_wall"], ST["w_raw"] = now, raw
|
|
287
|
+
ST["k"] = 0
|
|
288
|
+
return inner_init(*x, **kw)
|
|
289
|
+
|
|
290
|
+
def step_reset(done, extra, switching, switch_at, timeout):
|
|
291
|
+
if not torch.is_grad_enabled():
|
|
292
|
+
out = inner_reset(done, extra, switching, switch_at, timeout)
|
|
293
|
+
else: # a reset with gradient outside SapoWindowR's loop: the masked reset on its own draws
|
|
294
|
+
assert not switching
|
|
295
|
+
N = env.num_envs
|
|
296
|
+
cid = torch.randint(t.n_clips, (N,), generator=env.rng, device=env.device)
|
|
297
|
+
phi = torch.rand(N, generator=env.rng, device=env.device) * t._rsi_phase_max[cid]
|
|
298
|
+
masked_reset(env, self, done.detach().bool(), cid, phi)
|
|
299
|
+
out = None
|
|
300
|
+
ST["k"] += 1
|
|
301
|
+
return out
|
|
302
|
+
env.initialize_trajectory, env._step_reset = initialize_trajectory, step_reset
|
|
303
|
+
print("[masked_reset] installed on Env14 (graphed inside the actor window)", flush=True)
|
|
304
|
+
|
|
305
|
+
E14.Env14.__init__ = e14_init
|
|
306
|
+
SC.install_from_env = _install_window
|
|
307
|
+
|
|
308
|
+
import atexit
|
|
309
|
+
|
|
310
|
+
def at_exit():
|
|
311
|
+
print(f"[masked_reset] SUMMARY windows {ST['window']}", flush=True)
|
|
312
|
+
if torch.cuda.is_initialized():
|
|
313
|
+
mem_line("exit")
|
|
314
|
+
atexit.register(at_exit)
|