solarian-diffusion 0.1.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.
Files changed (159) hide show
  1. diffusion_policy/__init__.py +0 -0
  2. diffusion_policy/codecs/__init__.py +0 -0
  3. diffusion_policy/codecs/imagecodecs_numcodecs.py +1408 -0
  4. diffusion_policy/common/__init__.py +0 -0
  5. diffusion_policy/common/checkpoint_util.py +64 -0
  6. diffusion_policy/common/json_logger.py +117 -0
  7. diffusion_policy/common/normalize_util.py +251 -0
  8. diffusion_policy/common/pose_repr_util.py +112 -0
  9. diffusion_policy/common/pytorch_util.py +82 -0
  10. diffusion_policy/common/q_critic_util.py +135 -0
  11. diffusion_policy/common/replay_buffer.py +672 -0
  12. diffusion_policy/common/sampler.py +204 -0
  13. diffusion_policy/config/legacy/task/blockpush_lowdim_seed.yaml +34 -0
  14. diffusion_policy/config/legacy/task/blockpush_lowdim_seed_abs.yaml +34 -0
  15. diffusion_policy/config/legacy/task/can_image.yaml +64 -0
  16. diffusion_policy/config/legacy/task/can_image_abs.yaml +64 -0
  17. diffusion_policy/config/legacy/task/can_lowdim.yaml +45 -0
  18. diffusion_policy/config/legacy/task/can_lowdim_abs.yaml +46 -0
  19. diffusion_policy/config/legacy/task/kitchen_lowdim.yaml +33 -0
  20. diffusion_policy/config/legacy/task/kitchen_lowdim_abs.yaml +38 -0
  21. diffusion_policy/config/legacy/task/lift_abs.yaml +72 -0
  22. diffusion_policy/config/legacy/task/lift_image.yaml +64 -0
  23. diffusion_policy/config/legacy/task/lift_image_abs.yaml +63 -0
  24. diffusion_policy/config/legacy/task/lift_lowdim.yaml +46 -0
  25. diffusion_policy/config/legacy/task/lift_lowdim_abs.yaml +47 -0
  26. diffusion_policy/config/legacy/task/pusht_image.yaml +40 -0
  27. diffusion_policy/config/legacy/task/pusht_lowdim.yaml +34 -0
  28. diffusion_policy/config/legacy/task/real_pusht_image.yaml +47 -0
  29. diffusion_policy/config/legacy/task/square_abs.yaml +72 -0
  30. diffusion_policy/config/legacy/task/square_image.yaml +64 -0
  31. diffusion_policy/config/legacy/task/square_image_abs.yaml +64 -0
  32. diffusion_policy/config/legacy/task/square_lowdim.yaml +46 -0
  33. diffusion_policy/config/legacy/task/square_lowdim_abs.yaml +47 -0
  34. diffusion_policy/config/legacy/task/tool_hang_abs.yaml +71 -0
  35. diffusion_policy/config/legacy/task/tool_hang_image.yaml +63 -0
  36. diffusion_policy/config/legacy/task/tool_hang_image_abs.yaml +63 -0
  37. diffusion_policy/config/legacy/task/tool_hang_lowdim.yaml +45 -0
  38. diffusion_policy/config/legacy/task/tool_hang_lowdim_abs.yaml +46 -0
  39. diffusion_policy/config/legacy/task/transport_image.yaml +75 -0
  40. diffusion_policy/config/legacy/task/transport_image_abs.yaml +75 -0
  41. diffusion_policy/config/legacy/task/transport_lowdim.yaml +49 -0
  42. diffusion_policy/config/legacy/task/transport_lowdim_abs.yaml +49 -0
  43. diffusion_policy/config/legacy/task/umi.yaml +45 -0
  44. diffusion_policy/config/legacy/task/umi_image.yaml +36 -0
  45. diffusion_policy/config/legacy/task/umi_teleop_image.yaml +41 -0
  46. diffusion_policy/config/legacy/train_bet_lowdim_workspace.yaml +132 -0
  47. diffusion_policy/config/legacy/train_diffusion_transformer_hybrid_workspace.yaml +141 -0
  48. diffusion_policy/config/legacy/train_diffusion_transformer_lowdim_kitchen_workspace.yaml +146 -0
  49. diffusion_policy/config/legacy/train_diffusion_transformer_lowdim_pusht_workspace.yaml +146 -0
  50. diffusion_policy/config/legacy/train_diffusion_transformer_lowdim_workspace.yaml +146 -0
  51. diffusion_policy/config/legacy/train_diffusion_transformer_real_hybrid_workspace.yaml +144 -0
  52. diffusion_policy/config/legacy/train_diffusion_transformer_umi_teleop_hybrid_workspace.yaml +156 -0
  53. diffusion_policy/config/legacy/train_diffusion_unet_ddim_hybrid_workspace.yaml +140 -0
  54. diffusion_policy/config/legacy/train_diffusion_unet_ddim_lowdim_workspace.yaml +146 -0
  55. diffusion_policy/config/legacy/train_diffusion_unet_hybrid_workspace.yaml +137 -0
  56. diffusion_policy/config/legacy/train_diffusion_unet_image_pretrained_workspace.yaml +149 -0
  57. diffusion_policy/config/legacy/train_diffusion_unet_image_workspace.yaml +150 -0
  58. diffusion_policy/config/legacy/train_diffusion_unet_lowdim_workspace.yaml +143 -0
  59. diffusion_policy/config/legacy/train_diffusion_unet_real_hybrid_workspace.yaml +141 -0
  60. diffusion_policy/config/legacy/train_diffusion_unet_real_image_workspace.yaml +152 -0
  61. diffusion_policy/config/legacy/train_diffusion_unet_real_pretrained_workspace.yaml +152 -0
  62. diffusion_policy/config/legacy/train_diffusion_unet_timm_workspace.yaml +145 -0
  63. diffusion_policy/config/legacy/train_diffusion_unet_umi_hybrid_workspace.yaml +141 -0
  64. diffusion_policy/config/legacy/train_diffusion_unet_umi_teleop_hybrid_workspace.yaml +153 -0
  65. diffusion_policy/config/legacy/train_diffusion_unet_umi_timm_workspace.yaml +145 -0
  66. diffusion_policy/config/legacy/train_diffusion_unet_umi_workspace.yaml +150 -0
  67. diffusion_policy/config/legacy/train_diffusion_unet_video_workspace.yaml +128 -0
  68. diffusion_policy/config/legacy/train_ibc_dfo_hybrid_workspace.yaml +111 -0
  69. diffusion_policy/config/legacy/train_ibc_dfo_lowdim_workspace.yaml +109 -0
  70. diffusion_policy/config/legacy/train_ibc_dfo_real_hybrid_workspace.yaml +111 -0
  71. diffusion_policy/config/legacy/train_robomimic_image_workspace.yaml +92 -0
  72. diffusion_policy/config/legacy/train_robomimic_lowdim_workspace.yaml +92 -0
  73. diffusion_policy/config/legacy/train_robomimic_real_image_workspace.yaml +92 -0
  74. diffusion_policy/config/rl_annotate.yaml +265 -0
  75. diffusion_policy/config/rl_annotate_per_frame.yaml +162 -0
  76. diffusion_policy/config/rl_annotate_per_frame_v4.yaml +162 -0
  77. diffusion_policy/config/rl_annotate_v2.yaml +141 -0
  78. diffusion_policy/config/rl_annotate_v3.yaml +165 -0
  79. diffusion_policy/config/task/lift.yaml +89 -0
  80. diffusion_policy/config/task/square.yaml +92 -0
  81. diffusion_policy/config/task/tool_hang.yaml +93 -0
  82. diffusion_policy/config/task/tool_hang_abs.yaml +71 -0
  83. diffusion_policy/config/task/umi.yaml +105 -0
  84. diffusion_policy/config/task/umi_bimanual.yaml +135 -0
  85. diffusion_policy/config/task/umi_cup_wild.yaml +106 -0
  86. diffusion_policy/config/task/umi_image.yaml +36 -0
  87. diffusion_policy/config/task/umi_pick_lego.yaml +106 -0
  88. diffusion_policy/config/task/umi_pick_single_lego_175.yaml +106 -0
  89. diffusion_policy/config/task/umi_pick_single_lego_bbox.yaml +135 -0
  90. diffusion_policy/config/task/umi_teleop_image.yaml +41 -0
  91. diffusion_policy/config/train_diffusion_transformer_umi_bimanual_workspace.yaml +185 -0
  92. diffusion_policy/config/train_diffusion_transformer_umi_workspace.yaml +185 -0
  93. diffusion_policy/config/train_diffusion_unet_image_workspace.yaml +152 -0
  94. diffusion_policy/config/train_diffusion_unet_timm_robomimic_workspace.yaml +152 -0
  95. diffusion_policy/config/train_diffusion_unet_timm_umi_cup_wild.yaml +260 -0
  96. diffusion_policy/config/train_diffusion_unet_timm_umi_pick_lego_pile_bbox.yaml +265 -0
  97. diffusion_policy/config/train_diffusion_unet_timm_umi_pick_lego_pile_bbox_awr.yaml +324 -0
  98. diffusion_policy/config/train_diffusion_unet_timm_umi_pick_lego_pile_bbox_parl.yaml +399 -0
  99. diffusion_policy/config/train_diffusion_unet_timm_umi_pick_single_lego.yaml +258 -0
  100. diffusion_policy/config/train_diffusion_unet_timm_umi_pick_single_lego_125.yaml +260 -0
  101. diffusion_policy/config/train_diffusion_unet_timm_umi_pick_single_lego_175.yaml +260 -0
  102. diffusion_policy/config/train_diffusion_unet_timm_umi_pick_single_lego_bbox.yaml +265 -0
  103. diffusion_policy/config/train_diffusion_unet_timm_umi_pick_two_legos_bbox.yaml +265 -0
  104. diffusion_policy/config/train_diffusion_unet_timm_umi_workspace.yaml +224 -0
  105. diffusion_policy/config/train_diffusion_unet_timm_umi_workspace_lego.yaml +213 -0
  106. diffusion_policy/config/train_diffusion_unet_timm_umi_workspace_lego_resume.yaml +213 -0
  107. diffusion_policy/config/train_diffusion_unet_timm_umi_workspace_pick_lego.yaml +254 -0
  108. diffusion_policy/config/train_diffusion_unet_timm_umi_workspace_red_cup.yaml +219 -0
  109. diffusion_policy/config/train_diffusion_unet_umi_bimanual_workspace.yaml +203 -0
  110. diffusion_policy/config/train_iql_umi.yaml +186 -0
  111. diffusion_policy/config/train_iql_umi_v2.yaml +212 -0
  112. diffusion_policy/config/train_iql_umi_v3.yaml +212 -0
  113. diffusion_policy/dataset/__init__.py +0 -0
  114. diffusion_policy/dataset/base_dataset.py +76 -0
  115. diffusion_policy/dataset/umi_dataset.py +652 -0
  116. diffusion_policy/env_runner/__init__.py +0 -0
  117. diffusion_policy/env_runner/base_image_runner.py +9 -0
  118. diffusion_policy/env_runner/real_pusht_image_runner.py +10 -0
  119. diffusion_policy/model/__init__.py +0 -0
  120. diffusion_policy/model/common/__init__.py +0 -0
  121. diffusion_policy/model/common/dict_of_tensor_mixin.py +38 -0
  122. diffusion_policy/model/common/lr_scheduler.py +46 -0
  123. diffusion_policy/model/common/module_attr_mixin.py +14 -0
  124. diffusion_policy/model/common/normalizer.py +353 -0
  125. diffusion_policy/model/common/tensor_util.py +960 -0
  126. diffusion_policy/model/diffusion/__init__.py +0 -0
  127. diffusion_policy/model/diffusion/conditional_unet1d.py +238 -0
  128. diffusion_policy/model/diffusion/conv1d_components.py +46 -0
  129. diffusion_policy/model/diffusion/ema_model.py +88 -0
  130. diffusion_policy/model/diffusion/mask_generator.py +221 -0
  131. diffusion_policy/model/diffusion/positional_embedding.py +17 -0
  132. diffusion_policy/model/vision/__init__.py +0 -0
  133. diffusion_policy/model/vision/crop_randomizer.py +288 -0
  134. diffusion_policy/model/vision/multi_image_obs_encoder.py +195 -0
  135. diffusion_policy/model/vision/timm_obs_encoder.py +525 -0
  136. diffusion_policy/policy/__init__.py +0 -0
  137. diffusion_policy/policy/base_image_policy.py +27 -0
  138. diffusion_policy/policy/diffusion_unet_image_policy.py +264 -0
  139. diffusion_policy/policy/diffusion_unet_timm_policy.py +607 -0
  140. diffusion_policy/policy/parl_action_optimizer.py +675 -0
  141. diffusion_policy/workspace/__init__.py +0 -0
  142. diffusion_policy/workspace/base_workspace.py +146 -0
  143. diffusion_policy/workspace/train_diffusion_unet_image_workspace.py +1585 -0
  144. solarian_diffusion/__init__.py +32 -0
  145. solarian_diffusion/config.py +31 -0
  146. solarian_diffusion/policy_server.py +316 -0
  147. solarian_diffusion/rtc.py +272 -0
  148. solarian_diffusion/service.py +16 -0
  149. solarian_diffusion/trainer.py +213 -0
  150. solarian_diffusion-0.1.0.dist-info/METADATA +126 -0
  151. solarian_diffusion-0.1.0.dist-info/RECORD +159 -0
  152. solarian_diffusion-0.1.0.dist-info/WHEEL +5 -0
  153. solarian_diffusion-0.1.0.dist-info/entry_points.txt +8 -0
  154. solarian_diffusion-0.1.0.dist-info/licenses/LICENSE +201 -0
  155. solarian_diffusion-0.1.0.dist-info/licenses/NOTICE +45 -0
  156. solarian_diffusion-0.1.0.dist-info/top_level.txt +3 -0
  157. umi/__init__.py +0 -0
  158. umi/common/__init__.py +0 -0
  159. umi/common/pose_util.py +115 -0
@@ -0,0 +1,144 @@
1
+ defaults:
2
+ - _self_
3
+ - task: real_pusht_image
4
+
5
+ name: train_diffusion_transformer_hybrid
6
+ _target_: diffusion_policy.workspace.train_diffusion_transformer_hybrid_workspace.TrainDiffusionTransformerHybridWorkspace
7
+
8
+ task_name: ${task.name}
9
+ shape_meta: ${task.shape_meta}
10
+ exp_name: "default"
11
+
12
+ horizon: 16
13
+ n_obs_steps: 2
14
+ n_action_steps: 8
15
+ n_latency_steps: 0
16
+ dataset_obs_steps: ${n_obs_steps}
17
+ past_action_visible: False
18
+ keypoint_visible_rate: 1.0
19
+ obs_as_cond: True
20
+
21
+ policy:
22
+ _target_: diffusion_policy.policy.diffusion_transformer_hybrid_image_policy.DiffusionTransformerHybridImagePolicy
23
+
24
+ shape_meta: ${shape_meta}
25
+
26
+ noise_scheduler:
27
+ _target_: diffusers.schedulers.scheduling_ddim.DDIMScheduler
28
+ num_train_timesteps: 100
29
+ beta_start: 0.0001
30
+ beta_end: 0.02
31
+ # beta_schedule is important
32
+ # this is the best we found
33
+ beta_schedule: squaredcos_cap_v2
34
+ clip_sample: True
35
+ set_alpha_to_one: True
36
+ steps_offset: 0
37
+ prediction_type: epsilon # or sample
38
+
39
+ horizon: ${horizon}
40
+ n_action_steps: ${eval:'${n_action_steps}+${n_latency_steps}'}
41
+ n_obs_steps: ${n_obs_steps}
42
+ num_inference_steps: 8
43
+
44
+ crop_shape: [216, 288] # ch, cw 320x240 90%
45
+ obs_encoder_group_norm: True
46
+ eval_fixed_crop: True
47
+
48
+ n_layer: 8
49
+ n_cond_layers: 0 # >0: use transformer encoder for cond, otherwise use MLP
50
+ n_head: 4
51
+ n_emb: 256
52
+ p_drop_emb: 0.0
53
+ p_drop_attn: 0.3
54
+ causal_attn: True
55
+ time_as_cond: True # if false, use BERT like encoder only arch, time as input
56
+ obs_as_cond: ${obs_as_cond}
57
+
58
+ # scheduler.step params
59
+ # predict_epsilon: True
60
+
61
+ ema:
62
+ _target_: diffusion_policy.model.diffusion.ema_model.EMAModel
63
+ update_after_step: 0
64
+ inv_gamma: 1.0
65
+ power: 0.75
66
+ min_value: 0.0
67
+ max_value: 0.9999
68
+
69
+ dataloader:
70
+ batch_size: 64
71
+ num_workers: 8
72
+ shuffle: True
73
+ pin_memory: True
74
+ persistent_workers: True
75
+
76
+ val_dataloader:
77
+ batch_size: 64
78
+ num_workers: 8
79
+ shuffle: False
80
+ pin_memory: True
81
+ persistent_workers: True
82
+
83
+ optimizer:
84
+ transformer_weight_decay: 1.0e-3
85
+ obs_encoder_weight_decay: 1.0e-6
86
+ learning_rate: 1.0e-4
87
+ betas: [0.9, 0.95]
88
+
89
+ training:
90
+ device: "cuda:0"
91
+ seed: 42
92
+ debug: False
93
+ resume: True
94
+ # optimization
95
+ lr_scheduler: cosine
96
+ # Transformer needs LR warmup
97
+ lr_warmup_steps: 500
98
+ num_epochs: 600
99
+ gradient_accumulate_every: 1
100
+ # EMA destroys performance when used with BatchNorm
101
+ # replace BatchNorm with GroupNorm.
102
+ use_ema: True
103
+ # training loop control
104
+ # in epochs
105
+ rollout_every: 50
106
+ checkpoint_every: 50
107
+ val_every: 1
108
+ sample_every: 5
109
+ # steps per epoch
110
+ max_train_steps: null
111
+ max_val_steps: null
112
+ # misc
113
+ tqdm_interval_sec: 1.0
114
+
115
+ logging:
116
+ project: diffusion_policy_debug
117
+ resume: True
118
+ mode: online
119
+ name: ${now:%Y.%m.%d-%H.%M.%S}_${name}_${task_name}
120
+ tags: ["${name}", "${task_name}", "${exp_name}"]
121
+ id: null
122
+ group: null
123
+
124
+ checkpoint:
125
+ topk:
126
+ monitor_key: train_loss
127
+ mode: min
128
+ k: 5
129
+ format_str: 'epoch={epoch:04d}-train_loss={train_loss:.3f}.ckpt'
130
+ save_last_ckpt: True
131
+ save_last_snapshot: False
132
+
133
+ multi_run:
134
+ run_dir: data/outputs/${now:%Y.%m.%d}/${now:%H.%M.%S}_${name}_${task_name}
135
+ wandb_name_base: ${now:%Y.%m.%d-%H.%M.%S}_${name}_${task_name}
136
+
137
+ hydra:
138
+ job:
139
+ override_dirname: ${name}
140
+ run:
141
+ dir: data/outputs/${now:%Y.%m.%d}/${now:%H.%M.%S}_${name}_${task_name}
142
+ sweep:
143
+ dir: data/outputs/${now:%Y.%m.%d}/${now:%H.%M.%S}_${name}_${task_name}
144
+ subdir: ${hydra.job.num}
@@ -0,0 +1,156 @@
1
+ defaults:
2
+ - _self_
3
+ - task: umi_teleop_image
4
+
5
+ name: train_diffusion_transformer_hybrid
6
+ _target_: diffusion_policy.workspace.train_diffusion_transformer_hybrid_workspace.TrainDiffusionTransformerHybridWorkspace
7
+
8
+ task_name: ${task.name}
9
+ shape_meta: ${task.shape_meta}
10
+ exp_name: "default"
11
+
12
+ horizon: 32
13
+ n_obs_steps: 2
14
+ n_action_steps: 30
15
+ n_latency_steps: 0
16
+ dataset_obs_steps: ${n_obs_steps}
17
+ past_action_visible: False
18
+ keypoint_visible_rate: 1.0
19
+ obs_as_cond: True
20
+
21
+ policy:
22
+ _target_: diffusion_policy.policy.diffusion_transformer_hybrid_image_policy.DiffusionTransformerHybridImagePolicy
23
+
24
+ shape_meta: ${shape_meta}
25
+
26
+ noise_scheduler:
27
+ _target_: diffusers.schedulers.scheduling_ddim.DDIMScheduler
28
+ num_train_timesteps: 50
29
+ beta_start: 0.0001
30
+ beta_end: 0.02
31
+ # beta_schedule is important
32
+ # this is the best we found
33
+ beta_schedule: squaredcos_cap_v2
34
+ clip_sample: True
35
+ set_alpha_to_one: True
36
+ steps_offset: 0
37
+ prediction_type: epsilon # or sample
38
+
39
+ horizon: ${horizon}
40
+ n_action_steps: ${eval:'${n_action_steps}+${n_latency_steps}'}
41
+ n_obs_steps: ${n_obs_steps}
42
+ num_inference_steps: 8
43
+
44
+ crop_shape: [216, 216] # ch, cw 320x240 90%
45
+ obs_encoder_group_norm: True
46
+ eval_fixed_crop: True
47
+
48
+ n_layer: 8
49
+ n_cond_layers: 0 # >0: use transformer encoder for cond, otherwise use MLP
50
+ n_head: 4
51
+ n_emb: 256
52
+ p_drop_emb: 0.0
53
+ p_drop_attn: 0.3
54
+ causal_attn: True
55
+ time_as_cond: True # if false, use BERT like encoder only arch, time as input
56
+ obs_as_cond: ${obs_as_cond}
57
+
58
+ transforms:
59
+ - _target_: torchvision.transforms.RandomRotation
60
+ degrees:
61
+ - -5.0
62
+ - 5.0
63
+ expand: false
64
+ - _target_: torchvision.transforms.ColorJitter
65
+ brightness: 0.2
66
+ contrast: 0.5
67
+ saturation: 0.2
68
+ hue: 0.2
69
+
70
+ # scheduler.step params
71
+ # predict_epsilon: True
72
+
73
+ ema:
74
+ _target_: diffusion_policy.model.diffusion.ema_model.EMAModel
75
+ update_after_step: 0
76
+ inv_gamma: 1.0
77
+ power: 0.75
78
+ min_value: 0.0
79
+ max_value: 0.9999
80
+
81
+ dataloader:
82
+ batch_size: 128
83
+ num_workers: 12
84
+ shuffle: True
85
+ pin_memory: True
86
+ persistent_workers: True
87
+
88
+ val_dataloader:
89
+ batch_size: 128
90
+ num_workers: 12
91
+ shuffle: False
92
+ pin_memory: True
93
+ persistent_workers: True
94
+
95
+ optimizer:
96
+ transformer_weight_decay: 1.0e-3
97
+ obs_encoder_weight_decay: 1.0e-6
98
+ learning_rate: 5.0e-5
99
+ betas: [0.9, 0.95]
100
+
101
+ training:
102
+ device: "cuda:0"
103
+ seed: 42
104
+ debug: False
105
+ resume: True
106
+ # optimization
107
+ lr_scheduler: cosine
108
+ # Transformer needs LR warmup
109
+ lr_warmup_steps: 500
110
+ num_epochs: 1500
111
+ gradient_accumulate_every: 1
112
+ # EMA destroys performance when used with BatchNorm
113
+ # replace BatchNorm with GroupNorm.
114
+ use_ema: True
115
+ # training loop control
116
+ # in epochs
117
+ rollout_every: 50
118
+ checkpoint_every: 50
119
+ val_every: 1
120
+ sample_every: 5
121
+ # steps per epoch
122
+ max_train_steps: null
123
+ max_val_steps: null
124
+ # misc
125
+ tqdm_interval_sec: 1.0
126
+
127
+ logging:
128
+ project: umi
129
+ resume: True
130
+ mode: online
131
+ name: ${now:%Y.%m.%d-%H.%M.%S}_${name}_${task_name}
132
+ tags: ["${name}", "${task_name}", "${exp_name}"]
133
+ id: null
134
+ group: null
135
+
136
+ checkpoint:
137
+ topk:
138
+ monitor_key: train_loss
139
+ mode: min
140
+ k: 5
141
+ format_str: 'epoch={epoch:04d}-train_loss={train_loss:.3f}.ckpt'
142
+ save_last_ckpt: True
143
+ save_last_snapshot: False
144
+
145
+ multi_run:
146
+ run_dir: data/outputs/${now:%Y.%m.%d}/${now:%H.%M.%S}_${name}_${task_name}
147
+ wandb_name_base: ${now:%Y.%m.%d-%H.%M.%S}_${name}_${task_name}
148
+
149
+ hydra:
150
+ job:
151
+ override_dirname: ${name}
152
+ run:
153
+ dir: data/outputs/${now:%Y.%m.%d}/${now:%H.%M.%S}_${name}_${task_name}
154
+ sweep:
155
+ dir: data/outputs/${now:%Y.%m.%d}/${now:%H.%M.%S}_${name}_${task_name}
156
+ subdir: ${hydra.job.num}
@@ -0,0 +1,140 @@
1
+ defaults:
2
+ - _self_
3
+ - task: lift_image_abs
4
+
5
+ name: train_diffusion_unet_hybrid
6
+ _target_: diffusion_policy.workspace.train_diffusion_unet_hybrid_workspace.TrainDiffusionUnetHybridWorkspace
7
+
8
+ task_name: ${task.name}
9
+ shape_meta: ${task.shape_meta}
10
+ exp_name: "default"
11
+
12
+ horizon: 16
13
+ n_obs_steps: 2
14
+ n_action_steps: 8
15
+ n_latency_steps: 0
16
+ dataset_obs_steps: ${n_obs_steps}
17
+ past_action_visible: False
18
+ keypoint_visible_rate: 1.0
19
+ obs_as_global_cond: True
20
+
21
+ policy:
22
+ _target_: diffusion_policy.policy.diffusion_unet_hybrid_image_policy.DiffusionUnetHybridImagePolicy
23
+
24
+ shape_meta: ${shape_meta}
25
+
26
+ noise_scheduler:
27
+ _target_: diffusers.schedulers.scheduling_ddim.DDIMScheduler
28
+ num_train_timesteps: 100
29
+ beta_start: 0.0001
30
+ beta_end: 0.02
31
+ # beta_schedule is important
32
+ # this is the best we found
33
+ beta_schedule: squaredcos_cap_v2
34
+ clip_sample: True
35
+ set_alpha_to_one: True
36
+ steps_offset: 0
37
+ prediction_type: epsilon # or sample
38
+
39
+ horizon: ${horizon}
40
+ n_action_steps: ${eval:'${n_action_steps}+${n_latency_steps}'}
41
+ n_obs_steps: ${n_obs_steps}
42
+ num_inference_steps: 8
43
+ obs_as_global_cond: ${obs_as_global_cond}
44
+ # crop_shape: [76, 76]
45
+ crop_shape: null
46
+ diffusion_step_embed_dim: 128
47
+ down_dims: [256,512,1024]
48
+ kernel_size: 5
49
+ n_groups: 8
50
+ cond_predict_scale: True
51
+ obs_encoder_group_norm: True
52
+ eval_fixed_crop: True
53
+
54
+ # scheduler.step params
55
+ # predict_epsilon: True
56
+
57
+ ema:
58
+ _target_: diffusion_policy.model.diffusion.ema_model.EMAModel
59
+ update_after_step: 0
60
+ inv_gamma: 1.0
61
+ power: 0.75
62
+ min_value: 0.0
63
+ max_value: 0.9999
64
+
65
+ dataloader:
66
+ batch_size: 64
67
+ num_workers: 8
68
+ shuffle: True
69
+ pin_memory: True
70
+ persistent_workers: False
71
+
72
+ val_dataloader:
73
+ batch_size: 64
74
+ num_workers: 8
75
+ shuffle: False
76
+ pin_memory: True
77
+ persistent_workers: False
78
+
79
+ optimizer:
80
+ _target_: torch.optim.AdamW
81
+ lr: 1.0e-4
82
+ betas: [0.95, 0.999]
83
+ eps: 1.0e-8
84
+ weight_decay: 1.0e-6
85
+
86
+ training:
87
+ device: "cuda:0"
88
+ seed: 42
89
+ debug: False
90
+ resume: True
91
+ # optimization
92
+ lr_scheduler: cosine
93
+ lr_warmup_steps: 500
94
+ num_epochs: 3000
95
+ gradient_accumulate_every: 1
96
+ # EMA destroys performance when used with BatchNorm
97
+ # replace BatchNorm with GroupNorm.
98
+ use_ema: True
99
+ # training loop control
100
+ # in epochs
101
+ rollout_every: 50
102
+ checkpoint_every: 50
103
+ val_every: 1
104
+ sample_every: 5
105
+ # steps per epoch
106
+ max_train_steps: null
107
+ max_val_steps: null
108
+ # misc
109
+ tqdm_interval_sec: 1.0
110
+
111
+ logging:
112
+ project: diffusion_policy_debug
113
+ resume: True
114
+ mode: online
115
+ name: ${now:%Y.%m.%d-%H.%M.%S}_${name}_${task_name}
116
+ tags: ["${name}", "${task_name}", "${exp_name}"]
117
+ id: null
118
+ group: null
119
+
120
+ checkpoint:
121
+ topk:
122
+ monitor_key: test_mean_score
123
+ mode: max
124
+ k: 5
125
+ format_str: 'epoch={epoch:04d}-test_mean_score={test_mean_score:.3f}.ckpt'
126
+ save_last_ckpt: True
127
+ save_last_snapshot: False
128
+
129
+ multi_run:
130
+ run_dir: data/outputs/${now:%Y.%m.%d}/${now:%H.%M.%S}_${name}_${task_name}
131
+ wandb_name_base: ${now:%Y.%m.%d-%H.%M.%S}_${name}_${task_name}
132
+
133
+ hydra:
134
+ job:
135
+ override_dirname: ${name}
136
+ run:
137
+ dir: data/outputs/${now:%Y.%m.%d}/${now:%H.%M.%S}_${name}_${task_name}
138
+ sweep:
139
+ dir: data/outputs/${now:%Y.%m.%d}/${now:%H.%M.%S}_${name}_${task_name}
140
+ subdir: ${hydra.job.num}
@@ -0,0 +1,146 @@
1
+ defaults:
2
+ - _self_
3
+ - task: pusht_lowdim
4
+
5
+ name: train_diffusion_unet_lowdim
6
+ _target_: diffusion_policy.workspace.train_diffusion_unet_lowdim_workspace.TrainDiffusionUnetLowdimWorkspace
7
+
8
+ obs_dim: ${task.obs_dim}
9
+ action_dim: ${task.action_dim}
10
+ keypoint_dim: ${task.keypoint_dim}
11
+ task_name: ${task.name}
12
+ exp_name: "default"
13
+
14
+ horizon: 16
15
+ n_obs_steps: 2
16
+ n_action_steps: 8
17
+ n_latency_steps: 0
18
+ past_action_visible: False
19
+ keypoint_visible_rate: 1.0
20
+ obs_as_local_cond: False
21
+ obs_as_global_cond: False
22
+ pred_action_steps_only: False
23
+
24
+ policy:
25
+ _target_: diffusion_policy.policy.diffusion_unet_lowdim_policy.DiffusionUnetLowdimPolicy
26
+
27
+ model:
28
+ _target_: diffusion_policy.model.diffusion.conditional_unet1d.ConditionalUnet1D
29
+ input_dim: "${eval: ${task.action_dim} if ${obs_as_local_cond} or ${obs_as_global_cond} else ${task.obs_dim} + ${task.action_dim}}"
30
+ local_cond_dim: "${eval: ${task.obs_dim} if ${obs_as_local_cond} else None}"
31
+ global_cond_dim: "${eval: ${task.obs_dim}*${n_obs_steps} if ${obs_as_global_cond} else None}"
32
+ diffusion_step_embed_dim: 256
33
+ down_dims: [256, 512, 1024]
34
+ kernel_size: 5
35
+ n_groups: 8
36
+ cond_predict_scale: True
37
+
38
+ noise_scheduler:
39
+ _target_: diffusers.schedulers.scheduling_ddim.DDIMScheduler
40
+ num_train_timesteps: 100
41
+ beta_start: 0.0001
42
+ beta_end: 0.02
43
+ # beta_schedule is important
44
+ # this is the best we found
45
+ beta_schedule: squaredcos_cap_v2
46
+ clip_sample: True
47
+ set_alpha_to_one: True
48
+ steps_offset: 0
49
+ prediction_type: epsilon # or sample
50
+
51
+ horizon: ${horizon}
52
+ obs_dim: ${obs_dim}
53
+ action_dim: ${action_dim}
54
+ n_action_steps: ${eval:'${n_action_steps}+${n_latency_steps}'}
55
+ n_obs_steps: ${n_obs_steps}
56
+ num_inference_steps: 8
57
+ obs_as_local_cond: ${obs_as_local_cond}
58
+ obs_as_global_cond: ${obs_as_global_cond}
59
+ pred_action_steps_only: ${pred_action_steps_only}
60
+ oa_step_convention: True
61
+
62
+ # scheduler.step params
63
+ # predict_epsilon: True
64
+
65
+ ema:
66
+ _target_: diffusion_policy.model.diffusion.ema_model.EMAModel
67
+ update_after_step: 0
68
+ inv_gamma: 1.0
69
+ power: 0.75
70
+ min_value: 0.0
71
+ max_value: 0.9999
72
+
73
+ dataloader:
74
+ batch_size: 256
75
+ num_workers: 1
76
+ shuffle: True
77
+ pin_memory: True
78
+ persistent_workers: False
79
+
80
+ val_dataloader:
81
+ batch_size: 256
82
+ num_workers: 1
83
+ shuffle: False
84
+ pin_memory: True
85
+ persistent_workers: False
86
+
87
+ optimizer:
88
+ _target_: torch.optim.AdamW
89
+ lr: 1.0e-4
90
+ betas: [0.95, 0.999]
91
+ eps: 1.0e-8
92
+ weight_decay: 1.0e-6
93
+
94
+ training:
95
+ device: "cuda:0"
96
+ seed: 42
97
+ debug: False
98
+ resume: True
99
+ # optimization
100
+ lr_scheduler: cosine
101
+ lr_warmup_steps: 500
102
+ num_epochs: 8000
103
+ gradient_accumulate_every: 1
104
+ use_ema: True
105
+ # training loop control
106
+ # in epochs
107
+ rollout_every: 50
108
+ checkpoint_every: 50
109
+ val_every: 1
110
+ sample_every: 5
111
+ # steps per epoch
112
+ max_train_steps: null
113
+ max_val_steps: null
114
+ # misc
115
+ tqdm_interval_sec: 1.0
116
+
117
+ logging:
118
+ project: diffusion_policy_debug
119
+ resume: True
120
+ mode: online
121
+ name: ${now:%Y.%m.%d-%H.%M.%S}_${name}_${task_name}
122
+ tags: ["${name}", "${task_name}", "${exp_name}"]
123
+ id: null
124
+ group: null
125
+
126
+ checkpoint:
127
+ topk:
128
+ monitor_key: test_mean_score
129
+ mode: max
130
+ k: 5
131
+ format_str: 'epoch={epoch:04d}-test_mean_score={test_mean_score:.3f}.ckpt'
132
+ save_last_ckpt: True
133
+ save_last_snapshot: False
134
+
135
+ multi_run:
136
+ run_dir: data/outputs/${now:%Y.%m.%d}/${now:%H.%M.%S}_${name}_${task_name}
137
+ wandb_name_base: ${now:%Y.%m.%d-%H.%M.%S}_${name}_${task_name}
138
+
139
+ hydra:
140
+ job:
141
+ override_dirname: ${name}
142
+ run:
143
+ dir: data/outputs/${now:%Y.%m.%d}/${now:%H.%M.%S}_${name}_${task_name}
144
+ sweep:
145
+ dir: data/outputs/${now:%Y.%m.%d}/${now:%H.%M.%S}_${name}_${task_name}
146
+ subdir: ${hydra.job.num}
@@ -0,0 +1,137 @@
1
+ defaults:
2
+ - _self_
3
+ - task: lift_image_abs
4
+
5
+ name: train_diffusion_unet_hybrid
6
+ _target_: diffusion_policy.workspace.train_diffusion_unet_hybrid_workspace.TrainDiffusionUnetHybridWorkspace
7
+
8
+ task_name: ${task.name}
9
+ shape_meta: ${task.shape_meta}
10
+ exp_name: "default"
11
+
12
+ horizon: 16
13
+ n_obs_steps: 2
14
+ n_action_steps: 8
15
+ n_latency_steps: 0
16
+ dataset_obs_steps: ${n_obs_steps}
17
+ past_action_visible: False
18
+ keypoint_visible_rate: 1.0
19
+ obs_as_global_cond: True
20
+
21
+ policy:
22
+ _target_: diffusion_policy.policy.diffusion_unet_hybrid_image_policy.DiffusionUnetHybridImagePolicy
23
+
24
+ shape_meta: ${shape_meta}
25
+
26
+ noise_scheduler:
27
+ _target_: diffusers.schedulers.scheduling_ddpm.DDPMScheduler
28
+ num_train_timesteps: 100
29
+ beta_start: 0.0001
30
+ beta_end: 0.02
31
+ beta_schedule: squaredcos_cap_v2
32
+ variance_type: fixed_small # Yilun's paper uses fixed_small_log instead, but easy to cause Nan
33
+ clip_sample: True # required when predict_epsilon=False
34
+ prediction_type: epsilon # or sample
35
+
36
+ horizon: ${horizon}
37
+ n_action_steps: ${eval:'${n_action_steps}+${n_latency_steps}'}
38
+ n_obs_steps: ${n_obs_steps}
39
+ num_inference_steps: 100
40
+ obs_as_global_cond: ${obs_as_global_cond}
41
+ crop_shape: [76, 76]
42
+ # crop_shape: null
43
+ diffusion_step_embed_dim: 128
44
+ down_dims: [512, 1024, 2048]
45
+ kernel_size: 5
46
+ n_groups: 8
47
+ cond_predict_scale: True
48
+ obs_encoder_group_norm: True
49
+ eval_fixed_crop: True
50
+
51
+ # scheduler.step params
52
+ # predict_epsilon: True
53
+
54
+ ema:
55
+ _target_: diffusion_policy.model.diffusion.ema_model.EMAModel
56
+ update_after_step: 0
57
+ inv_gamma: 1.0
58
+ power: 0.75
59
+ min_value: 0.0
60
+ max_value: 0.9999
61
+
62
+ dataloader:
63
+ batch_size: 64
64
+ num_workers: 8
65
+ shuffle: True
66
+ pin_memory: True
67
+ persistent_workers: False
68
+
69
+ val_dataloader:
70
+ batch_size: 64
71
+ num_workers: 8
72
+ shuffle: False
73
+ pin_memory: True
74
+ persistent_workers: False
75
+
76
+ optimizer:
77
+ _target_: torch.optim.AdamW
78
+ lr: 1.0e-4
79
+ betas: [0.95, 0.999]
80
+ eps: 1.0e-8
81
+ weight_decay: 1.0e-6
82
+
83
+ training:
84
+ device: "cuda:0"
85
+ seed: 42
86
+ debug: False
87
+ resume: True
88
+ # optimization
89
+ lr_scheduler: cosine
90
+ lr_warmup_steps: 500
91
+ num_epochs: 3050
92
+ gradient_accumulate_every: 1
93
+ # EMA destroys performance when used with BatchNorm
94
+ # replace BatchNorm with GroupNorm.
95
+ use_ema: True
96
+ # training loop control
97
+ # in epochs
98
+ rollout_every: 50
99
+ checkpoint_every: 50
100
+ val_every: 1
101
+ sample_every: 5
102
+ # steps per epoch
103
+ max_train_steps: null
104
+ max_val_steps: null
105
+ # misc
106
+ tqdm_interval_sec: 1.0
107
+
108
+ logging:
109
+ project: diffusion_policy_debug
110
+ resume: True
111
+ mode: online
112
+ name: ${now:%Y.%m.%d-%H.%M.%S}_${name}_${task_name}
113
+ tags: ["${name}", "${task_name}", "${exp_name}"]
114
+ id: null
115
+ group: null
116
+
117
+ checkpoint:
118
+ topk:
119
+ monitor_key: test_mean_score
120
+ mode: max
121
+ k: 5
122
+ format_str: 'epoch={epoch:04d}-test_mean_score={test_mean_score:.3f}.ckpt'
123
+ save_last_ckpt: True
124
+ save_last_snapshot: False
125
+
126
+ multi_run:
127
+ run_dir: data/outputs/${now:%Y.%m.%d}/${now:%H.%M.%S}_${name}_${task_name}
128
+ wandb_name_base: ${now:%Y.%m.%d-%H.%M.%S}_${name}_${task_name}
129
+
130
+ hydra:
131
+ job:
132
+ override_dirname: ${name}
133
+ run:
134
+ dir: data/outputs/${now:%Y.%m.%d}/${now:%H.%M.%S}_${name}_${task_name}
135
+ sweep:
136
+ dir: data/outputs/${now:%Y.%m.%d}/${now:%H.%M.%S}_${name}_${task_name}
137
+ subdir: ${hydra.job.num}