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,153 @@
1
+ defaults:
2
+ - _self_
3
+ - task: umi_teleop_image
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: 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_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: 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
+ obs_as_global_cond: ${obs_as_global_cond}
44
+ # crop_shape: [76, 76] # 84x84 90%
45
+ crop_shape: [216, 216] # ch, cw 320x240 90%
46
+ # crop_shape: null
47
+ diffusion_step_embed_dim: 128
48
+ down_dims: [256,512,1024]
49
+ kernel_size: 5
50
+ n_groups: 8
51
+ cond_predict_scale: True
52
+ obs_encoder_group_norm: True
53
+ eval_fixed_crop: True
54
+
55
+ transforms:
56
+ - _target_: torchvision.transforms.RandomRotation
57
+ degrees:
58
+ - -5.0
59
+ - 5.0
60
+ expand: false
61
+ - _target_: torchvision.transforms.ColorJitter
62
+ brightness: 0.2
63
+ contrast: 0.5
64
+ saturation: 0.2
65
+ hue: 0.2
66
+
67
+ # scheduler.step params
68
+ # predict_epsilon: True
69
+
70
+ ema:
71
+ _target_: diffusion_policy.model.diffusion.ema_model.EMAModel
72
+ update_after_step: 0
73
+ inv_gamma: 1.0
74
+ power: 0.75
75
+ min_value: 0.0
76
+ max_value: 0.9999
77
+
78
+ dataloader:
79
+ batch_size: 128
80
+ num_workers: 12
81
+ shuffle: True
82
+ pin_memory: True
83
+ persistent_workers: True
84
+
85
+ val_dataloader:
86
+ batch_size: 128
87
+ num_workers: 12
88
+ shuffle: False
89
+ pin_memory: True
90
+ persistent_workers: True
91
+
92
+ optimizer:
93
+ _target_: torch.optim.AdamW
94
+ lr: 1.0e-4
95
+ betas: [0.95, 0.999]
96
+ eps: 1.0e-8
97
+ weight_decay: 1.0e-6
98
+
99
+ training:
100
+ device: "cuda:0"
101
+ seed: 42
102
+ debug: False
103
+ resume: True
104
+ # optimization
105
+ lr_scheduler: cosine
106
+ lr_warmup_steps: 500
107
+ num_epochs: 1500
108
+ gradient_accumulate_every: 1
109
+ # EMA destroys performance when used with BatchNorm
110
+ # replace BatchNorm with GroupNorm.
111
+ use_ema: True
112
+ # training loop control
113
+ # in epochs
114
+ rollout_every: 50
115
+ checkpoint_every: 50
116
+ val_every: 1
117
+ sample_every: 5
118
+ # steps per epoch
119
+ max_train_steps: null
120
+ max_val_steps: null
121
+ # misc
122
+ tqdm_interval_sec: 1.0
123
+
124
+ logging:
125
+ project: umi
126
+ resume: True
127
+ mode: online
128
+ name: ${now:%Y.%m.%d-%H.%M.%S}_${name}_${task_name}
129
+ tags: ["${name}", "${task_name}", "${exp_name}"]
130
+ id: null
131
+ group: null
132
+
133
+ checkpoint:
134
+ topk:
135
+ monitor_key: train_loss
136
+ mode: min
137
+ k: 5
138
+ format_str: 'epoch={epoch:04d}-train_loss={train_loss:.3f}.ckpt'
139
+ save_last_ckpt: True
140
+ save_last_snapshot: False
141
+
142
+ multi_run:
143
+ run_dir: data/outputs/${now:%Y.%m.%d}/${now:%H.%M.%S}_${name}_${task_name}
144
+ wandb_name_base: ${now:%Y.%m.%d-%H.%M.%S}_${name}_${task_name}
145
+
146
+ hydra:
147
+ job:
148
+ override_dirname: ${name}
149
+ run:
150
+ dir: data/outputs/${now:%Y.%m.%d}/${now:%H.%M.%S}_${name}_${task_name}
151
+ sweep:
152
+ dir: data/outputs/${now:%Y.%m.%d}/${now:%H.%M.%S}_${name}_${task_name}
153
+ subdir: ${hydra.job.num}
@@ -0,0 +1,145 @@
1
+ defaults:
2
+ - _self_
3
+ - task: umi
4
+
5
+ name: train_diffusion_unet_umi_timm
6
+ _target_: diffusion_policy.workspace.train_diffusion_unet_image_workspace.TrainDiffusionUnetImageWorkspace
7
+
8
+ task_name: ${task.name}
9
+ shape_meta: ${task.shape_meta}
10
+ exp_name: "default"
11
+
12
+ policy:
13
+ _target_: diffusion_policy.policy.diffusion_unet_timm_policy.DiffusionUnetTimmPolicy
14
+
15
+ shape_meta: ${shape_meta}
16
+
17
+ noise_scheduler:
18
+ _target_: diffusers.schedulers.scheduling_ddpm.DDPMScheduler
19
+ num_train_timesteps: 100
20
+ beta_start: 0.0001
21
+ beta_end: 0.02
22
+ beta_schedule: squaredcos_cap_v2
23
+ variance_type: fixed_small # Yilun's paper uses fixed_small_log instead, but easy to cause Nan
24
+ clip_sample: True # required when predict_epsilon=False
25
+ prediction_type: epsilon # or sample
26
+
27
+ obs_encoder:
28
+ _target_: diffusion_policy.model.vision.timm_obs_encoder.TimmObsEncoder
29
+ shape_meta: ${shape_meta}
30
+ model_name: 'resnet18'
31
+ # model_name: 'vit_base_patch16_224'
32
+ pretrained: False
33
+ global_pool: 'avg'
34
+ transforms:
35
+ - _target_: torchvision.transforms.Resize
36
+ size: 224
37
+ antialias: True
38
+ - _target_: torchvision.transforms.RandomRotation
39
+ degrees:
40
+ - -5.0
41
+ - 5.0
42
+ expand: false
43
+ - _target_: torchvision.transforms.ColorJitter
44
+ brightness: 0.2
45
+ contrast: 0.5
46
+ saturation: 0.2
47
+ hue: 0.2
48
+
49
+ use_group_norm: True
50
+ share_rgb_model: False
51
+ imagenet_norm: True
52
+
53
+ num_inference_steps: 100
54
+ obs_as_global_cond: True
55
+ diffusion_step_embed_dim: 128
56
+ down_dims: [512, 1024, 2048]
57
+ kernel_size: 5
58
+ n_groups: 8
59
+ cond_predict_scale: 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: 4
72
+ shuffle: True
73
+ pin_memory: True
74
+ persistent_workers: False
75
+
76
+ val_dataloader:
77
+ batch_size: 64
78
+ num_workers: 4
79
+ shuffle: False
80
+ pin_memory: True
81
+ persistent_workers: False
82
+
83
+ optimizer:
84
+ _target_: torch.optim.AdamW
85
+ lr: 1.0e-4
86
+ betas: [0.95, 0.999]
87
+ eps: 1.0e-8
88
+ weight_decay: 1.0e-6
89
+
90
+ training:
91
+ device: "cuda:0"
92
+ seed: 42
93
+ debug: False
94
+ resume: True
95
+ # optimization
96
+ lr_scheduler: cosine
97
+ lr_warmup_steps: 500
98
+ num_epochs: 8000
99
+ gradient_accumulate_every: 1
100
+ # EMA destroys performance when used with BatchNorm
101
+ # replace BatchNorm with GroupNorm.
102
+ use_ema: True
103
+ freeze_encoder: False
104
+ # training loop control
105
+ # in epochs
106
+ rollout_every: 50
107
+ checkpoint_every: 50
108
+ val_every: 1
109
+ sample_every: 5
110
+ # steps per epoch
111
+ max_train_steps: null
112
+ max_val_steps: null
113
+ # misc
114
+ tqdm_interval_sec: 1.0
115
+
116
+ logging:
117
+ project: umi
118
+ resume: True
119
+ mode: online
120
+ name: ${now:%Y.%m.%d-%H.%M.%S}_${name}_${task_name}
121
+ tags: ["${name}", "${task_name}", "${exp_name}"]
122
+ id: null
123
+ group: null
124
+
125
+ checkpoint:
126
+ topk:
127
+ monitor_key: train_loss
128
+ mode: min
129
+ k: 5
130
+ format_str: 'epoch={epoch:04d}-train_loss={train_loss:.3f}.ckpt'
131
+ save_last_ckpt: True
132
+ save_last_snapshot: False
133
+
134
+ multi_run:
135
+ run_dir: data/outputs/${now:%Y.%m.%d}/${now:%H.%M.%S}_${name}_${task_name}
136
+ wandb_name_base: ${now:%Y.%m.%d-%H.%M.%S}_${name}_${task_name}
137
+
138
+ hydra:
139
+ job:
140
+ override_dirname: ${name}
141
+ run:
142
+ dir: data/outputs/${now:%Y.%m.%d}/${now:%H.%M.%S}_${name}_${task_name}
143
+ sweep:
144
+ dir: data/outputs/${now:%Y.%m.%d}/${now:%H.%M.%S}_${name}_${task_name}
145
+ subdir: ${hydra.job.num}
@@ -0,0 +1,150 @@
1
+ defaults:
2
+ - _self_
3
+ - task: umi_teleop_image
4
+
5
+ name: train_diffusion_unet_timm
6
+ _target_: diffusion_policy.workspace.train_diffusion_unet_image_workspace.TrainDiffusionUnetImageWorkspace
7
+
8
+ task_name: ${task.name}
9
+ shape_meta: ${task.shape_meta}
10
+ exp_name: "default"
11
+
12
+ obs_as_global_cond: True
13
+
14
+ policy:
15
+ _target_: diffusion_policy.policy.diffusion_unet_timm_policy.DiffusionUnetTimmPolicy
16
+
17
+ shape_meta: ${shape_meta}
18
+
19
+ noise_scheduler:
20
+ _target_: diffusers.schedulers.scheduling_ddim.DDIMScheduler
21
+ num_train_timesteps: 50
22
+ beta_start: 0.0001
23
+ beta_end: 0.02
24
+ # beta_schedule is important
25
+ # this is the best we found
26
+ beta_schedule: squaredcos_cap_v2
27
+ clip_sample: True
28
+ set_alpha_to_one: True
29
+ steps_offset: 0
30
+ prediction_type: epsilon # or sample
31
+
32
+ obs_encoder:
33
+ _target_: diffusion_policy.model.vision.timm_obs_encoder.TimmObsEncoder
34
+ shape_meta: ${shape_meta}
35
+ model_name: 'resnet18'
36
+ # model_name: 'vit_base_patch16_224'
37
+ pretrained: False
38
+ global_pool: 'avg'
39
+ transforms:
40
+ - _target_: torchvision.transforms.Resize
41
+ size: 224
42
+ antialias: True
43
+ - _target_: torchvision.transforms.RandomRotation
44
+ degrees:
45
+ - -5.0
46
+ - 5.0
47
+ expand: false
48
+ - _target_: torchvision.transforms.ColorJitter
49
+ brightness: 0.2
50
+ contrast: 0.5
51
+ saturation: 0.2
52
+ hue: 0.2
53
+
54
+ use_group_norm: True
55
+ share_rgb_model: False
56
+ imagenet_norm: True
57
+
58
+ obs_as_global_cond: ${obs_as_global_cond}
59
+ diffusion_step_embed_dim: 128
60
+ down_dims: [256,512,1024]
61
+ kernel_size: 5
62
+ n_groups: 8
63
+ cond_predict_scale: True
64
+ obs_encoder_group_norm: True
65
+ eval_fixed_crop: True
66
+
67
+ ema:
68
+ _target_: diffusion_policy.model.diffusion.ema_model.EMAModel
69
+ update_after_step: 0
70
+ inv_gamma: 1.0
71
+ power: 0.75
72
+ min_value: 0.0
73
+ max_value: 0.9999
74
+
75
+ dataloader:
76
+ batch_size: 128
77
+ num_workers: 12
78
+ shuffle: True
79
+ pin_memory: True
80
+ persistent_workers: True
81
+
82
+ val_dataloader:
83
+ batch_size: 128
84
+ num_workers: 12
85
+ shuffle: False
86
+ pin_memory: True
87
+ persistent_workers: True
88
+
89
+ optimizer:
90
+ _target_: torch.optim.AdamW
91
+ lr: 1.0e-4
92
+ betas: [0.95, 0.999]
93
+ eps: 1.0e-8
94
+ weight_decay: 1.0e-6
95
+
96
+ training:
97
+ device: "cuda:0"
98
+ seed: 42
99
+ debug: False
100
+ resume: True
101
+ # optimization
102
+ lr_scheduler: cosine
103
+ lr_warmup_steps: 500
104
+ num_epochs: 1500
105
+ gradient_accumulate_every: 1
106
+ # EMA destroys performance when used with BatchNorm
107
+ # replace BatchNorm with GroupNorm.
108
+ use_ema: True
109
+ # training loop control
110
+ # in epochs
111
+ rollout_every: 50
112
+ checkpoint_every: 50
113
+ val_every: 1
114
+ sample_every: 5
115
+ # steps per epoch
116
+ max_train_steps: null
117
+ max_val_steps: null
118
+ # misc
119
+ tqdm_interval_sec: 1.0
120
+
121
+ logging:
122
+ project: umi
123
+ resume: True
124
+ mode: online
125
+ name: ${now:%Y.%m.%d-%H.%M.%S}_${name}_${task_name}
126
+ tags: ["${name}", "${task_name}", "${exp_name}"]
127
+ id: null
128
+ group: null
129
+
130
+ checkpoint:
131
+ topk:
132
+ monitor_key: train_loss
133
+ mode: min
134
+ k: 5
135
+ format_str: 'epoch={epoch:04d}-train_loss={train_loss:.3f}.ckpt'
136
+ save_last_ckpt: True
137
+ save_last_snapshot: False
138
+
139
+ multi_run:
140
+ run_dir: data/outputs/${now:%Y.%m.%d}/${now:%H.%M.%S}_${name}_${task_name}
141
+ wandb_name_base: ${now:%Y.%m.%d-%H.%M.%S}_${name}_${task_name}
142
+
143
+ hydra:
144
+ job:
145
+ override_dirname: ${name}
146
+ run:
147
+ dir: data/outputs/${now:%Y.%m.%d}/${now:%H.%M.%S}_${name}_${task_name}
148
+ sweep:
149
+ dir: data/outputs/${now:%Y.%m.%d}/${now:%H.%M.%S}_${name}_${task_name}
150
+ subdir: ${hydra.job.num}
@@ -0,0 +1,128 @@
1
+ defaults:
2
+ - _self_
3
+ - task: lift_image_abs
4
+
5
+ name: train_diffusion_unet_video
6
+ _target_: diffusion_policy.workspace.train_diffusion_unet_video_workspace.TrainDiffusionUnetVideoWorkspace
7
+
8
+ task_name: ${task.name}
9
+ shape_meta: ${task.shape_meta}
10
+ exp_name: "default"
11
+
12
+ horizon: 16
13
+ n_obs_steps: 4
14
+ n_action_steps: 8
15
+ past_action_visible: False
16
+ keypoint_visible_rate: 1.0
17
+ lowdim_as_global_cond: True
18
+
19
+ policy:
20
+ _target_: diffusion_policy.policy.diffusion_unet_video_policy.DiffusionUnetVideoPolicy
21
+
22
+ shape_meta: ${shape_meta}
23
+
24
+ noise_scheduler:
25
+ _target_: diffusers.schedulers.scheduling_ddpm.DDPMScheduler
26
+ num_train_timesteps: 100
27
+ beta_start: 0.0001
28
+ beta_end: 0.02
29
+ beta_schedule: squaredcos_cap_v2
30
+ variance_type: fixed_small # Yilun's paper uses fixed_small_log instead, but easy to cause Nan
31
+ clip_sample: True # required when predict_epsilon=False
32
+ prediction_type: epsilon # or sample
33
+
34
+ rgb_net:
35
+ _target_: diffusion_policy.model.obs_encoder.video_core.VideoCore
36
+
37
+ backbone:
38
+ _target_: diffusion_policy.model.obs_encoder.video_core.VideoResNet
39
+
40
+ norm_groups: 8
41
+ input_channel: 3
42
+ model_depth: 50 # ResNet 50 (18,34 not yet available)
43
+
44
+ pool:
45
+ _target_: diffusion_policy.model.ibc.global_avgpool.GlobalAvgpool
46
+
47
+ dim: [2,3,4]
48
+
49
+ horizon: ${horizon}
50
+ n_action_steps: ${n_action_steps}
51
+ n_obs_steps: ${n_obs_steps}
52
+ num_inference_steps: 100
53
+ lowdim_as_global_cond: ${lowdim_as_global_cond}
54
+ diffusion_step_embed_dim: 128
55
+ down_dims: [512, 1024, 2048]
56
+ kernel_size: 5
57
+ n_groups: 8
58
+ cond_predict_scale: True
59
+
60
+ # TemporalAggregator Parameters
61
+ channel_mults: [1,1]
62
+ n_blocks_per_level: 1
63
+ ta_kernel_size: 3
64
+ ta_n_groups: 1
65
+
66
+ # scheduler.step params
67
+ # predict_epsilon: True
68
+
69
+ ema:
70
+ _target_: diffusion_policy.model.diffusion.ema_model.EMAModel
71
+ update_after_step: 0
72
+ inv_gamma: 1.0
73
+ power: 0.75
74
+ min_value: 0.0
75
+ max_value: 0.9999
76
+
77
+ dataloader:
78
+ batch_size: 32
79
+ num_workers: 1
80
+ shuffle: True
81
+ pin_memory: True
82
+
83
+ optimizer:
84
+ _target_: torch.optim.AdamW
85
+ lr: 0.0001 # 1e-4
86
+ betas: [0.95, 0.999]
87
+ eps: 0.00000001 # 1e-8
88
+ weight_decay: 0.000001 # 1e-6
89
+
90
+ training:
91
+ device: "cuda:0"
92
+ lr_scheduler: cosine
93
+ lr_warmup_steps: 500
94
+ num_epochs: 1500
95
+ gradient_accumulate_every: 1
96
+ eval_every: 5000
97
+ eval_first: False
98
+ val_every: 300
99
+ use_ema: False
100
+ tqdm_interval_sec: 1.0
101
+ seed: 42
102
+
103
+ logging:
104
+ project: diffusion_policy_debug
105
+ resume: True
106
+ mode: online
107
+ name: ${now:%Y.%m.%d-%H.%M.%S}_${name}_${task_name}
108
+ tags: ["${name}", "${task_name}", "${exp_name}"]
109
+ id: null
110
+ group: null
111
+
112
+ checkpoint:
113
+ topk:
114
+ monitor_key: test_score
115
+ mode: max
116
+ k: 5
117
+ format_str: 'epoch={epoch:03d}-test_score={test_score:.3f}.ckpt'
118
+ save_last_ckpt: False
119
+ save_last_snapshot: False
120
+
121
+ hydra:
122
+ job:
123
+ override_dirname: ${name}
124
+ run:
125
+ dir: data/outputs/${now:%Y.%m.%d}/${now:%H.%M.%S}_${name}_${task_name}
126
+ sweep:
127
+ dir: data/outputs/${now:%Y.%m.%d}/${now:%H.%M.%S}_${name}_${task_name}
128
+ subdir: ${hydra.job.num}
@@ -0,0 +1,111 @@
1
+ defaults:
2
+ - _self_
3
+ - task: pusht_image
4
+
5
+ name: train_ibc_dfo_hybrid
6
+ _target_: diffusion_policy.workspace.train_ibc_dfo_hybrid_workspace.TrainIbcDfoHybridWorkspace
7
+
8
+ task_name: ${task.name}
9
+ shape_meta: ${task.shape_meta}
10
+ exp_name: "default"
11
+
12
+ horizon: 2
13
+ n_obs_steps: 2
14
+ n_action_steps: 1
15
+ n_latency_steps: 0
16
+ dataset_obs_steps: ${n_obs_steps}
17
+ past_action_visible: False
18
+ keypoint_visible_rate: 1.0
19
+
20
+ policy:
21
+ _target_: diffusion_policy.policy.ibc_dfo_hybrid_image_policy.IbcDfoHybridImagePolicy
22
+
23
+ shape_meta: ${shape_meta}
24
+
25
+ horizon: ${horizon}
26
+ n_action_steps: ${eval:'${n_action_steps}+${n_latency_steps}'}
27
+ n_obs_steps: ${n_obs_steps}
28
+ dropout: 0.1
29
+ train_n_neg: 1024
30
+ pred_n_iter: 5
31
+ pred_n_samples: 1024
32
+ kevin_inference: False
33
+ andy_train: False
34
+ obs_encoder_group_norm: True
35
+ eval_fixed_crop: True
36
+ crop_shape: [84, 84]
37
+
38
+ dataloader:
39
+ batch_size: 128
40
+ num_workers: 8
41
+ shuffle: True
42
+ pin_memory: True
43
+ persistent_workers: False
44
+
45
+ val_dataloader:
46
+ batch_size: 128
47
+ num_workers: 8
48
+ shuffle: False
49
+ pin_memory: True
50
+ persistent_workers: False
51
+
52
+ optimizer:
53
+ _target_: torch.optim.AdamW
54
+ lr: 1.0e-4
55
+ betas: [0.95, 0.999]
56
+ eps: 1.0e-8
57
+ weight_decay: 1.0e-6
58
+
59
+ training:
60
+ device: "cuda:0"
61
+ seed: 42
62
+ debug: False
63
+ resume: True
64
+ # optimization
65
+ lr_scheduler: cosine
66
+ lr_warmup_steps: 500
67
+ num_epochs: 3050
68
+ gradient_accumulate_every: 1
69
+ # training loop control
70
+ # in epochs
71
+ rollout_every: 50
72
+ checkpoint_every: 50
73
+ val_every: 1
74
+ sample_every: 5
75
+ sample_max_batch: 128
76
+ # steps per epoch
77
+ max_train_steps: null
78
+ max_val_steps: null
79
+ # misc
80
+ tqdm_interval_sec: 1.0
81
+
82
+ logging:
83
+ project: diffusion_policy_debug
84
+ resume: True
85
+ mode: online
86
+ name: ${now:%Y.%m.%d-%H.%M.%S}_${name}_${task_name}
87
+ tags: ["${name}", "${task_name}", "${exp_name}"]
88
+ id: null
89
+ group: null
90
+
91
+ checkpoint:
92
+ topk:
93
+ monitor_key: test_mean_score
94
+ mode: max
95
+ k: 5
96
+ format_str: 'epoch={epoch:04d}-test_mean_score={test_mean_score:.3f}.ckpt'
97
+ save_last_ckpt: True
98
+ save_last_snapshot: False
99
+
100
+ multi_run:
101
+ run_dir: data/outputs/${now:%Y.%m.%d}/${now:%H.%M.%S}_${name}_${task_name}
102
+ wandb_name_base: ${now:%Y.%m.%d-%H.%M.%S}_${name}_${task_name}
103
+
104
+ hydra:
105
+ job:
106
+ override_dirname: ${name}
107
+ run:
108
+ dir: data/outputs/${now:%Y.%m.%d}/${now:%H.%M.%S}_${name}_${task_name}
109
+ sweep:
110
+ dir: data/outputs/${now:%Y.%m.%d}/${now:%H.%M.%S}_${name}_${task_name}
111
+ subdir: ${hydra.job.num}