delinqu commited on
Commit
8cbc8de
·
verified ·
1 Parent(s): 985151c

Upload folder using huggingface_hub

Browse files
.gitattributes CHANGED
@@ -33,3 +33,4 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
33
  *.zip filter=lfs diff=lfs merge=lfs -text
34
  *.zst filter=lfs diff=lfs merge=lfs -text
35
  *tfevents* filter=lfs diff=lfs merge=lfs -text
 
 
33
  *.zip filter=lfs diff=lfs merge=lfs -text
34
  *.zst filter=lfs diff=lfs merge=lfs -text
35
  *tfevents* filter=lfs diff=lfs merge=lfs -text
36
+ tokenizer.json filter=lfs diff=lfs merge=lfs -text
action_tokenizer.py ADDED
@@ -0,0 +1,445 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # MIT License
2
+ # Copyright (c) 2025 IPEC at Shanghai AI Laboratory
3
+ # Permission is hereby granted, free of charge, to use, copy, modify, merge, publish,
4
+ # distribute, sublicense, and/or sell copies of the Software, subject to the following conditions:
5
+ # The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
6
+ # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND.
7
+ # coding=utf-8
8
+
9
+ """
10
+ action_tokenizer.py
11
+ Extension class; wraps base LLM/VLM tokenizer with logic to discretize and tokenize continuous robot actions.
12
+ """
13
+ from typing import List, Union, Dict, Tuple, Optional
14
+ import numpy as np
15
+ from transformers import PreTrainedTokenizerBase
16
+ from pathlib import Path
17
+ import json
18
+ from scipy.stats import norm
19
+ import torch
20
+
21
+ ACTION_TOKEN = '<ACTION{:05d}>'
22
+
23
+ """Spatial Tokenizer"""
24
+ class ActionTokenizer:
25
+ def __init__(
26
+ self,
27
+ tokenizer: PreTrainedTokenizerBase,
28
+ num_bins: int = 256,
29
+ min_action: int = -1,
30
+ max_action: int = 1,
31
+ ):
32
+ self._vocab_size = num_bins
33
+ self.tokenizer = tokenizer
34
+ self.min_action, self.max_action = min_action, max_action
35
+ self.bin_centers = np.linspace(min_action, max_action, num_bins)
36
+
37
+ # add special action tokens to language tokenizer
38
+ token_list = [ACTION_TOKEN.format(i) for i in range(self._vocab_size)]
39
+ self.token_array = np.array(token_list)
40
+
41
+ num_new_tokens = self.tokenizer.add_tokens(token_list, special_tokens=True)
42
+ print(f"Add {num_new_tokens} TRANSLATION TOKENS, tokenizer vocab size {self.tokenizer.vocab_size} / {len(tokenizer)}")
43
+
44
+ self.action_token_begin_idx = self.token_start_idx = self.tokenizer.convert_tokens_to_ids(self.token_array[0])
45
+ self.token_end_idx = self.tokenizer.convert_tokens_to_ids(self.token_array[-1])
46
+
47
+ def __call__(self, action: np.ndarray) -> List[str]:
48
+ """Discretize continuous actions to tokens.
49
+ action: np.ndarray, (n, 7), continuous actions in Cartesian or Spherical coordinates.
50
+ return: np.ndarray, (n, 7), tokens.
51
+ """
52
+ action = np.clip(action, a_min=float(self.min_action), a_max=float(self.max_action))
53
+ ids = np.digitize(action, self.bin_centers, right=True) # [0, 255]
54
+ return self.token_array[ids]
55
+
56
+ def decode_token_ids_to_actions(self, action_token_id: np.ndarray) -> np.ndarray:
57
+ """decode token ids to continuous actions.
58
+ action_token_id: np.ndarray, (n, 7), token ids.
59
+ return: np.ndarray, (n, 7), continuous actions
60
+ """
61
+ ids = action_token_id - self.action_token_begin_idx
62
+ ids = np.clip(ids, a_min=0, a_max=self._vocab_size - 1)
63
+ return self.bin_centers[ids]
64
+
65
+ @property
66
+ def vocab_size(self) -> int:
67
+ return self._vocab_size
68
+
69
+ """Spatial Tokenizer"""
70
+ class TranslationTokenizer:
71
+ def __init__(
72
+ self,
73
+ tokenizer: PreTrainedTokenizerBase,
74
+ num_bins: Dict,
75
+ bin_policy: Optional[Dict] = None,
76
+ use_spherical: bool = True,
77
+ ):
78
+ self.tokenizer = tokenizer
79
+ self.num_theta_bins = num_bins["theta_bins"]
80
+ self.num_phi_bins = num_bins["phi_bins"]
81
+ self.num_r_bins = num_bins["r_bins"]
82
+ self.use_spherical = use_spherical
83
+
84
+ # for indexing
85
+ self.NP = self.num_phi_bins * self.num_r_bins
86
+
87
+ # add special action tokens to language tokenizer
88
+ self._vocab_size = self.num_theta_bins * self.num_phi_bins * self.num_r_bins
89
+ token_list = [ACTION_TOKEN.format(i) for i in range(self._vocab_size)]
90
+ self.token_array = np.array(token_list)
91
+
92
+ num_new_tokens = self.tokenizer.add_tokens(token_list, special_tokens=True)
93
+ print(f"Add {num_new_tokens} TRANSLATION TOKENS, tokenizer vocab size {self.tokenizer.vocab_size} / {len(tokenizer)}")
94
+
95
+ self.token_start_idx = self.tokenizer.convert_tokens_to_ids(self.token_array[0])
96
+ self.token_end_idx = self.tokenizer.convert_tokens_to_ids(self.token_array[-1])
97
+ self.set_bins(bin_policy)
98
+
99
+ def set_bins(self, bin_policy):
100
+ self.theta_bins = np.array(bin_policy["theta_bins"])
101
+ self.phi_bins = np.array(bin_policy["phi_bins"])
102
+ self.r_bins = np.array(bin_policy["r_bins"])
103
+
104
+ def cartesian_to_spherical(self, x, y, z):
105
+ theta = np.arctan2(np.sqrt(x**2 + y**2), z) # polar angle
106
+ phi = np.arctan2(y, x) # azimuthal angle
107
+ r = np.sqrt(x**2 + y**2 + z**2)
108
+ return theta, phi, r
109
+
110
+ def spherical_to_cartesian(self, theta, phi, r):
111
+ x = r * np.sin(theta) * np.cos(phi)
112
+ y = r * np.sin(theta) * np.sin(phi)
113
+ z = r * np.cos(theta)
114
+ return x, y, z
115
+
116
+ def __call__(self, action: np.ndarray) -> List[str]:
117
+ """Discretize continuous actions to tokens.
118
+ action: np.ndarray, (n, 3), continuous actions in Cartesian or Spherical coordinates.
119
+ return: np.ndarray, (n,), tokens.
120
+ """
121
+ if self.use_spherical:
122
+ theta, phi, r = self.cartesian_to_spherical(action[:, 0], action[:, 1], action[:, 2])
123
+ else:
124
+ theta, phi, r = action[:, 0], action[:, 1], action[:, 2]
125
+
126
+ disc_theta = np.digitize(theta, self.theta_bins[1:-1]) # b
127
+ disc_phi = np.digitize(phi, self.phi_bins[1:-1])
128
+ disc_r = np.digitize(r, self.r_bins[1:-1])
129
+ ids = disc_theta * self.NP + disc_phi * self.num_r_bins + disc_r
130
+ return self.token_array[ids]
131
+
132
+ def decode_token_ids_to_actions(self, action_token_id: np.ndarray) -> np.ndarray:
133
+ """decode token ids to continuous actions.
134
+ action_token_id: np.ndarray, (n,), token ids.
135
+ return: np.ndarray, (n, 3), continuous actions
136
+ """
137
+ action_token_id = np.clip(action_token_id, self.token_start_idx, self.token_end_idx)
138
+ ids = action_token_id - self.token_start_idx
139
+ disc_theta, disc_phi, disc_r = ids // self.NP, (ids % self.NP) // self.num_r_bins, ids % self.num_r_bins
140
+
141
+ theta = 0.5 * (self.theta_bins[disc_theta] + self.theta_bins[disc_theta + 1])
142
+ phi = 0.5 * (self.phi_bins[disc_phi] + self.phi_bins[disc_phi + 1])
143
+ r = 0.5 * (self.r_bins[disc_r] + self.r_bins[disc_r + 1])
144
+
145
+ # clip action to [-1, 1], due to the spherical coordinate action space is the circumscribed sphere of the Cartesian action space.
146
+ x, y, z = self.spherical_to_cartesian(theta, phi, r) if self.use_spherical else (theta, phi, r)
147
+ x, y, z = np.clip([x, y, z], -1, 1)
148
+ return np.stack((x, y, z), axis=1)
149
+
150
+ @property
151
+ def vocab_size(self) -> int:
152
+ return self._vocab_size
153
+
154
+ class RotationTokenizer:
155
+ def __init__(
156
+ self,
157
+ tokenizer: PreTrainedTokenizerBase,
158
+ num_bins: Dict,
159
+ bin_policy: Optional[Dict] = None,
160
+ array_begin_idx=None,
161
+ ):
162
+ self.tokenizer = tokenizer
163
+ self.num_roll_bins = num_bins["roll_bins"] # M
164
+ self.num_pitch_bins = num_bins["pitch_bins"] # N
165
+ self.num_yaw_bins = num_bins["yaw_bins"] # P
166
+ self.array_begin_idx = array_begin_idx
167
+
168
+ # for indexing
169
+ self.NP = self.num_pitch_bins * self.num_yaw_bins
170
+
171
+ # add special action tokens to language tokenizer
172
+ self._vocab_size = self.num_roll_bins * self.num_pitch_bins * self.num_yaw_bins
173
+ token_list = [ACTION_TOKEN.format(i + self.array_begin_idx) for i in range(self._vocab_size)]
174
+ self.token_array = np.array(token_list)
175
+
176
+ num_new_tokens = self.tokenizer.add_tokens(token_list, special_tokens=True)
177
+ print(f"Add {num_new_tokens} ROTATION TOKENS to tokenizer, tokenizer vocab size {self.tokenizer.vocab_size} / {len(tokenizer)}")
178
+
179
+ self.token_start_idx = self.tokenizer.convert_tokens_to_ids(self.token_array[0])
180
+ self.token_end_idx = self.tokenizer.convert_tokens_to_ids(self.token_array[-1])
181
+ self.set_bins(bin_policy)
182
+
183
+ def set_bins(self, bin_policy):
184
+ self.roll_bins = np.array(bin_policy["roll_bins"])
185
+ self.pitch_bins = np.array(bin_policy["pitch_bins"])
186
+ self.yaw_bins = np.array(bin_policy["yaw_bins"])
187
+
188
+ def __call__(self, action: np.ndarray) -> List[str]:
189
+ """Discretize continuous actions to tokens.
190
+ action: np.ndarray, (n, 3), continuous actions in Cartesian or Spherical coordinates.
191
+ return: np.ndarray, (n,), tokens.
192
+ """
193
+ roll, pitch, yaw = action[:, 0], action[:, 1], action[:, 2]
194
+ disc_roll = np.clip(np.digitize(roll, self.roll_bins) - 1, 0, self.num_roll_bins - 1)
195
+ disc_pitch = np.clip(np.digitize(pitch, self.pitch_bins) - 1, 0, self.num_pitch_bins - 1)
196
+ disc_yaw = np.clip(np.digitize(yaw, self.yaw_bins) - 1, 0, self.num_yaw_bins - 1)
197
+
198
+ ids = disc_roll * self.NP + disc_pitch * self.num_yaw_bins + disc_yaw
199
+ return self.token_array[ids]
200
+
201
+ def decode_token_ids_to_actions(self, action_token_id: Union[np.int64, np.ndarray]) -> np.ndarray:
202
+ """decode token ids to continuous actions.
203
+ action_token_id: np.ndarray, (n,), token ids.
204
+ return: np.ndarray, (n, 3), continuous actions
205
+ """
206
+ action_token_id = np.clip(action_token_id, a_min=self.token_start_idx, a_max=self.token_end_idx)
207
+ ids = action_token_id - self.token_start_idx
208
+ disc_roll, disc_pitch, disc_yaw = ids // self.NP, (ids % self.NP) // self.num_yaw_bins, ids % self.num_yaw_bins
209
+
210
+ roll = 0.5 * (self.roll_bins[disc_roll] + self.roll_bins[disc_roll + 1])
211
+ pitch = 0.5 * (self.pitch_bins[disc_pitch] + self.pitch_bins[disc_pitch + 1])
212
+ yaw = 0.5 * (self.yaw_bins[disc_yaw] + self.yaw_bins[disc_yaw + 1])
213
+ return np.stack((roll, pitch, yaw), axis=1)
214
+
215
+ @property
216
+ def vocab_size(self) -> int:
217
+ return self._vocab_size
218
+
219
+ class GripperTokenzier:
220
+ def __init__(
221
+ self,
222
+ tokenizer: PreTrainedTokenizerBase,
223
+ num_bins: int = 2,
224
+ array_begin_idx = None,
225
+ ) -> None:
226
+ self.tokenizer = tokenizer
227
+ self.num_bins = num_bins
228
+ self.array_begin_idx = array_begin_idx
229
+ token_list = [ACTION_TOKEN.format(i + self.array_begin_idx) for i in range(self.num_bins)]
230
+ self.token_array = np.array(token_list)
231
+
232
+ num_new_tokens = self.tokenizer.add_tokens(token_list, special_tokens=True)
233
+ print(f"Add {num_new_tokens} GRIPPER TOKENS to tokenizer, tokenizer vocab size {self.tokenizer.vocab_size} / {len(tokenizer)}")
234
+
235
+ self.token_start_idx = self.tokenizer.convert_tokens_to_ids(self.token_array[0])
236
+ self.token_end_idx = self.tokenizer.convert_tokens_to_ids(self.token_array[-1])
237
+
238
+ def __call__(self, action: np.ndarray) -> List[str]:
239
+ """Discretize continuous actions to tokens.
240
+ action: np.ndarray, (n,), continuous actions in Cartesian or Spherical coordinates.
241
+ return: np.ndarray, (n,), tokens.
242
+ """
243
+ ids = np.where(action >= 0.5, 1, 0)
244
+ return self.token_array[ids]
245
+
246
+ def decode_token_ids_to_actions(self, action_token_id: np.ndarray) -> np.ndarray:
247
+ """decode token ids to continuous actions.
248
+ action_token_id: np.ndarray, (n,), token ids.
249
+ return: np.ndarray, (n, 1), continuous actions
250
+ """
251
+ action_token_id = np.clip(action_token_id, self.token_start_idx, self.token_end_idx)
252
+ ids = action_token_id - self.token_start_idx
253
+ actions = np.where(ids == 0, 0., 1.)
254
+ return actions[:, None]
255
+
256
+ @property
257
+ def vocab_size(self) -> int:
258
+ return self.num_bins
259
+
260
+ class SphericalCoordinateActionTokenizer:
261
+ range_bins = {
262
+ "translation": {
263
+ "theta_bins": (0.0, np.pi),
264
+ "phi_bins": (-np.pi, np.pi),
265
+ "r_bins": (0.0, np.sqrt(3)),
266
+ },
267
+ "rotation": {
268
+ "roll_bins": (-1.0, 1.0),
269
+ "pitch_bins": (-1.0, 1.0),
270
+ "yaw_bins": (-1.0, 1.0),
271
+ },
272
+ }
273
+ def __init__(
274
+ self,
275
+ tokenizer: PreTrainedTokenizerBase,
276
+ num_bins: Dict,
277
+ gs_params: Dict = None,
278
+ bin_policy: Dict = None,
279
+ use_spherical: bool = True,
280
+ min_sigma: float = 0.0,
281
+ min_action: float = -1.0,
282
+ max_action: float = 1.0,
283
+ ):
284
+ """set bin_policy if exist, otherwise, caculate bin_policy from gs_params.(unifrom if None Gaussian)
285
+ gs_params: Optional[Dict],
286
+ bin_policy: Optional[Dict],
287
+ """
288
+ self.tokenizer = tokenizer
289
+ self.min_action, self.max_action = min_action, max_action
290
+ self.num_bins = num_bins
291
+ self.min_sigma = min_sigma
292
+
293
+ # set bin policy
294
+ self.bin_policy = bin_policy if bin_policy else self.get_bin_policy(gs_params, self.min_sigma)
295
+
296
+ self.translation_tokenizer = TranslationTokenizer(
297
+ self.tokenizer,
298
+ self.num_bins["translation"],
299
+ self.bin_policy["translation"],
300
+ use_spherical=use_spherical
301
+ )
302
+
303
+ self.rotation_tokenizer = RotationTokenizer(
304
+ self.tokenizer,
305
+ self.num_bins["rotation"],
306
+ self.bin_policy["rotation"],
307
+ array_begin_idx=self.translation_tokenizer.vocab_size,
308
+ )
309
+
310
+ self.gripper_tokenizer = GripperTokenzier(
311
+ self.tokenizer,
312
+ self.num_bins["gripper"],
313
+ array_begin_idx=self.translation_tokenizer.vocab_size + self.rotation_tokenizer.vocab_size
314
+ )
315
+ self._vocab_size = self.translation_tokenizer.vocab_size + self.rotation_tokenizer.vocab_size + self.gripper_tokenizer.vocab_size
316
+
317
+ def __call__(self, action: np.ndarray) -> List[str]:
318
+ """Discretize continuous actions to tokens.
319
+ action: np.ndarray, (n, 7), continuous actions in Cartesian coordinates.
320
+ return: np.ndarray, (n, 3), tokens.
321
+ """
322
+ if len(action.shape) == 1:
323
+ assert action.shape[0] == 7, f"action dim mismatch, got action shape: {action.shape}"
324
+ action = action.reshape(1, 7)
325
+ assert action.shape[1] == 7, f"action dim mismatch, got action shape: {action.shape}"
326
+
327
+ action = np.clip(action, a_min=self.min_action, a_max=self.max_action)
328
+ trans_tokens = self.translation_tokenizer(action[:, :3]) # (n,)
329
+ rot_tokens = self.rotation_tokenizer(action[:, 3:6]) # (n,)
330
+ grip_tokens = self.gripper_tokenizer(action[:, 6]) # (n,)
331
+ return np.stack((trans_tokens, rot_tokens, grip_tokens), axis=1) # (n, 3)
332
+
333
+ def decode_token_ids_to_actions(self, action_token_ids: np.ndarray) -> np.ndarray:
334
+ """decode token ids to continuous actions.
335
+ action_token_ids: np.ndarray, (n, 3), token ids.
336
+ """
337
+ if len(action_token_ids.shape) == 1:
338
+ assert action_token_ids.shape[0] == 3, f"action token id numbers mismatich, need 3 got {action_token_ids.shape[0]}"
339
+ action_token_ids = action_token_ids.reshape(1, 3)
340
+ assert action_token_ids.shape[1] == 3, f"token id numbers mismatich, need 3 got {action_token_ids.shape[1]}"
341
+
342
+ trans_action = self.translation_tokenizer.decode_token_ids_to_actions(action_token_ids[:, 0]) # (n, 3)
343
+ rot_action = self.rotation_tokenizer.decode_token_ids_to_actions(action_token_ids[:, 1]) # (n, 3)
344
+ grip_action = self.gripper_tokenizer.decode_token_ids_to_actions(action_token_ids[:, 2]) # (n, 1)
345
+ return np.concatenate((trans_action, rot_action, grip_action), axis=1) # (n, 7)
346
+
347
+ @property
348
+ def vocab_size(self) -> int:
349
+ return self._vocab_size
350
+
351
+ @property
352
+ def action_token_begin_idx(self) -> int:
353
+ return self.translation_tokenizer.token_start_idx
354
+
355
+ def get_bin_policy(self, gs_params=None, min_sigma=0.0):
356
+ bin_policy = {
357
+ "translation": {"theta_bins": None, "phi_bins": None, "r_bins": None},
358
+ "rotation": {"roll_bins": None, "pitch_bins": None, "yaw_bins": None}
359
+ }
360
+ if gs_params is None:
361
+ for bin_type in self.range_bins.keys():
362
+ for bin_key in self.range_bins[bin_type].keys():
363
+ bin_policy[bin_type][bin_key] = np.linspace(*self.range_bins[bin_type][bin_key], self.num_bins[bin_type][bin_key] + 1)
364
+ print(f"use unifrom bin grids ... \n{bin_policy}")
365
+ else:
366
+ for bin_type in self.range_bins.keys():
367
+ for bin_key in self.range_bins[bin_type].keys():
368
+ mu = gs_params[bin_key.split("_")[0].lower()]["mu"]
369
+ sigma = max(gs_params[bin_key.split("_")[0].lower()]["sigma"], min_sigma)
370
+ bin_bound_prob = np.linspace(
371
+ norm.cdf(self.range_bins[bin_type][bin_key][0], loc=mu, scale=sigma),
372
+ norm.cdf(self.range_bins[bin_type][bin_key][1], loc=mu, scale=sigma),
373
+ self.num_bins[bin_type][bin_key] + 1,
374
+ )
375
+ bin_boundary = norm.ppf(bin_bound_prob, loc=mu, scale=sigma)
376
+ bin_policy[bin_type][bin_key] = np.clip(
377
+ bin_boundary,
378
+ self.range_bins[bin_type][bin_key][0],
379
+ self.range_bins[bin_type][bin_key][1],
380
+ ).tolist() # for serialize
381
+ print(f"caculate bin grids from gaussians \n{bin_policy}")
382
+ return bin_policy
383
+
384
+ def get_norm_meshgrid(self, bin_policy):
385
+ grids = []
386
+ policy = {k1: {k2: np.array(v2) for k2, v2 in v1.items()} for k1, v1 in bin_policy.items()}
387
+ # NOTE: use unify k,v order of range_bins (tpr, rpy)
388
+ for bin_type in self.range_bins.keys():
389
+ bounds = []
390
+ for bin_key in self.range_bins[bin_type].keys():
391
+ minb, maxb = self.range_bins[bin_type][bin_key][0], self.range_bins[bin_type][bin_key][1]
392
+ bin_boundary = policy[bin_type][bin_key]
393
+ bin_center = (bin_boundary[:-1] + bin_boundary[1:]) / 2
394
+ bin_center = np.concatenate([np.array([minb]),bin_center,np.array([maxb])]) # padding
395
+ bin_center = (bin_center - minb) / (maxb - minb) # nomalize (m, n, k)
396
+ bounds.append(bin_center)
397
+ # generate grids
398
+ grid_x, grid_y, grid_z = np.meshgrid(*bounds)
399
+ grids += [np.stack([grid_x, grid_y, grid_z], -1).reshape(-1, 3)]
400
+ return grids[0], grids[1] # (N, 3)
401
+
402
+ def spatial_embedding_adaption(self, gs_params, embeddings: torch.nn.Embedding, min_sigma=0.0, adpt_feature=False):
403
+ """
404
+ gs_params0, gs_params1: Dict
405
+ embeddings: tensor (S,E)
406
+ """
407
+ from scipy.interpolate import griddata
408
+ # __import__("ipdb").set_trace()
409
+
410
+ new_policy = self.get_bin_policy(gs_params, min_sigma=min_sigma)
411
+ trans_grids0, rot_grids0 = self.get_norm_meshgrid(self.bin_policy)
412
+ trans_grids1, rot_grids1 = self.get_norm_meshgrid(new_policy)
413
+
414
+ print("🔥 overwrite bin policy and tokenizer bins ...")
415
+ self.bin_policy = new_policy
416
+ self.min_sigma = min_sigma
417
+ self.translation_tokenizer.set_bins(new_policy["translation"])
418
+ self.rotation_tokenizer.set_bins(new_policy["rotation"])
419
+
420
+ if adpt_feature:
421
+ emb_data = embeddings.weight.data # (S, e)
422
+ _, E = emb_data.shape
423
+
424
+ # translation
425
+ m, n, k = (self.num_bins["translation"][k] for k in ["theta_bins", "phi_bins", "r_bins"])
426
+ N = m*n*k
427
+ trans_emb_data = emb_data[:N,].reshape(m, n, k, -1).permute(3, 0, 1, 2) # (e, m, n, k)
428
+ pad_emb = torch.nn.functional.pad(trans_emb_data, (1, 1, 1, 1, 1, 1), "replicate").permute(1, 2, 3, 0).reshape(-1, E)
429
+ adpt_trans_emb = griddata(trans_grids0, pad_emb.float(), trans_grids1, method='linear')
430
+ adpt_trans_emb = adpt_trans_emb.reshape(m+2, n+2, k+2, E)[1:-1, 1:-1, 1:-1,]
431
+
432
+ # rotation
433
+ m1, n1, k1 = (self.num_bins["rotation"][k] for k in ["roll_bins", "pitch_bins", "yaw_bins"])
434
+ M = m1*n1*k1
435
+ rot_emb_data = emb_data[N : N + M,].reshape(m1, n1, k1, -1).permute(3, 0, 1, 2) # (e, m, n, k)
436
+ pad_emb = torch.nn.functional.pad(rot_emb_data, (1, 1, 1, 1, 1, 1), "replicate").permute(1, 2, 3, 0).reshape(-1, E)
437
+ adpt_rot_emb = griddata(rot_grids0, pad_emb.float(), rot_grids1, method='linear')
438
+ adpt_rot_emb = adpt_rot_emb.reshape(m1+2, n1+2, k1+2, E)[1:-1, 1:-1, 1:-1,]
439
+
440
+ # set data
441
+ device, dtype = embeddings.weight.data.device, embeddings.weight.data.dtype
442
+ embeddings.weight.data[:N] = torch.Tensor(adpt_trans_emb.reshape(-1, E), device=device).to(dtype)
443
+ embeddings.weight.data[N:N+M] = torch.Tensor(adpt_rot_emb.reshape(-1, E), device=device).to(dtype)
444
+ print("🚀 DONE! adapt spatial embedding to new gaussian distributation finished.")
445
+ print(embeddings.weight.data)
config.json ADDED
@@ -0,0 +1,318 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "_vocab_size": 265347,
3
+ "action_token_begin_idx": 257153,
4
+ "architectures": [
5
+ "SpatialVLAForConditionalGeneration"
6
+ ],
7
+ "auto_map": {
8
+ "AutoConfig": "configuration_spatialvla.SpatialVLAConfig",
9
+ "AutoModel": "modeling_spatialvla.SpatialVLAForConditionalGeneration"
10
+ },
11
+ "bos_token_id": 2,
12
+ "ego3d_patch_reso": 2,
13
+ "eos_token_id": 1,
14
+ "hidden_size": 2048,
15
+ "image_token_index": 257152,
16
+ "model_type": "spatialvla",
17
+ "n_freqs": 8,
18
+ "num_hidden_layers": 26,
19
+ "pad_token_id": 0,
20
+ "projection_dim": 2304,
21
+ "spatial_token_num": 8194,
22
+ "text_config": {
23
+ "architectures": [
24
+ "Gemma2ForCausalLM"
25
+ ],
26
+ "eos_token_id": [
27
+ 1,
28
+ 107
29
+ ],
30
+ "hidden_act": "gelu_pytorch_tanh",
31
+ "hidden_size": 2304,
32
+ "intermediate_size": 9216,
33
+ "model_type": "gemma2",
34
+ "num_hidden_layers": 26,
35
+ "num_image_tokens": 256,
36
+ "num_key_value_heads": 4,
37
+ "tie_word_embeddings": false,
38
+ "torch_dtype": "bfloat16",
39
+ "vocab_size": 265347
40
+ },
41
+ "torch_dtype": "bfloat16",
42
+ "transformers_version": "4.47.0",
43
+ "use_spatial_token": true,
44
+ "use_vision_zoe": true,
45
+ "vision_config": {
46
+ "hidden_size": 1152,
47
+ "intermediate_size": 4304,
48
+ "model_type": "siglip_vision_model",
49
+ "num_attention_heads": 16,
50
+ "num_hidden_layers": 27,
51
+ "num_image_tokens": 256,
52
+ "num_positions": 256,
53
+ "patch_size": 14,
54
+ "projection_dim": 2304,
55
+ "torch_dtype": "bfloat16",
56
+ "vision_use_head": false
57
+ },
58
+ "vision_zoe_config": {
59
+ "_attn_implementation_autoset": false,
60
+ "_name_or_path": "Intel/zoedepth-nyu-kitti",
61
+ "add_cross_attention": false,
62
+ "add_projection": false,
63
+ "architectures": [
64
+ "ZoeDepthForDepthEstimation"
65
+ ],
66
+ "attractor_alpha": 1000,
67
+ "attractor_gamma": 2,
68
+ "attractor_kind": "mean",
69
+ "backbone": null,
70
+ "backbone_config": {
71
+ "_attn_implementation_autoset": false,
72
+ "_name_or_path": "",
73
+ "add_cross_attention": false,
74
+ "add_fpn": false,
75
+ "architectures": null,
76
+ "attention_probs_dropout_prob": 0.0,
77
+ "auxiliary_channels": 256,
78
+ "auxiliary_concat_input": false,
79
+ "auxiliary_loss_weight": 0.4,
80
+ "auxiliary_num_convs": 1,
81
+ "bad_words_ids": null,
82
+ "begin_suppress_tokens": null,
83
+ "bos_token_id": null,
84
+ "chunk_size_feed_forward": 0,
85
+ "cross_attention_hidden_size": null,
86
+ "decoder_start_token_id": null,
87
+ "diversity_penalty": 0.0,
88
+ "do_sample": false,
89
+ "drop_path_rate": 0.1,
90
+ "early_stopping": false,
91
+ "encoder_no_repeat_ngram_size": 0,
92
+ "eos_token_id": null,
93
+ "exponential_decay_length_penalty": null,
94
+ "finetuning_task": null,
95
+ "forced_bos_token_id": null,
96
+ "forced_eos_token_id": null,
97
+ "hidden_act": "gelu",
98
+ "hidden_dropout_prob": 0.0,
99
+ "hidden_size": 1024,
100
+ "id2label": {
101
+ "0": "LABEL_0",
102
+ "1": "LABEL_1"
103
+ },
104
+ "image_size": 384,
105
+ "initializer_range": 0.02,
106
+ "intermediate_size": 4096,
107
+ "is_decoder": false,
108
+ "is_encoder_decoder": false,
109
+ "label2id": {
110
+ "LABEL_0": 0,
111
+ "LABEL_1": 1
112
+ },
113
+ "layer_norm_eps": 1e-12,
114
+ "layer_scale_init_value": 0.1,
115
+ "length_penalty": 1.0,
116
+ "max_length": 20,
117
+ "min_length": 0,
118
+ "model_type": "beit",
119
+ "no_repeat_ngram_size": 0,
120
+ "num_attention_heads": 16,
121
+ "num_beam_groups": 1,
122
+ "num_beams": 1,
123
+ "num_channels": 3,
124
+ "num_hidden_layers": 24,
125
+ "num_return_sequences": 1,
126
+ "out_features": [
127
+ "stage6",
128
+ "stage12",
129
+ "stage18",
130
+ "stage24"
131
+ ],
132
+ "out_indices": [
133
+ 6,
134
+ 12,
135
+ 18,
136
+ 24
137
+ ],
138
+ "output_attentions": false,
139
+ "output_hidden_states": false,
140
+ "output_scores": false,
141
+ "pad_token_id": null,
142
+ "patch_size": 16,
143
+ "pool_scales": [
144
+ 1,
145
+ 2,
146
+ 3,
147
+ 6
148
+ ],
149
+ "prefix": null,
150
+ "problem_type": null,
151
+ "pruned_heads": {},
152
+ "remove_invalid_values": false,
153
+ "repetition_penalty": 1.0,
154
+ "reshape_hidden_states": false,
155
+ "return_dict": true,
156
+ "return_dict_in_generate": false,
157
+ "semantic_loss_ignore_index": 255,
158
+ "sep_token_id": null,
159
+ "stage_names": [
160
+ "stem",
161
+ "stage1",
162
+ "stage2",
163
+ "stage3",
164
+ "stage4",
165
+ "stage5",
166
+ "stage6",
167
+ "stage7",
168
+ "stage8",
169
+ "stage9",
170
+ "stage10",
171
+ "stage11",
172
+ "stage12",
173
+ "stage13",
174
+ "stage14",
175
+ "stage15",
176
+ "stage16",
177
+ "stage17",
178
+ "stage18",
179
+ "stage19",
180
+ "stage20",
181
+ "stage21",
182
+ "stage22",
183
+ "stage23",
184
+ "stage24"
185
+ ],
186
+ "suppress_tokens": null,
187
+ "task_specific_params": null,
188
+ "temperature": 1.0,
189
+ "tf_legacy_loss": false,
190
+ "tie_encoder_decoder": false,
191
+ "tie_word_embeddings": true,
192
+ "tokenizer_class": null,
193
+ "top_k": 50,
194
+ "top_p": 1.0,
195
+ "torch_dtype": null,
196
+ "torchscript": false,
197
+ "typical_p": 1.0,
198
+ "use_absolute_position_embeddings": false,
199
+ "use_auxiliary_head": true,
200
+ "use_bfloat16": false,
201
+ "use_mask_token": false,
202
+ "use_mean_pooling": true,
203
+ "use_relative_position_bias": true,
204
+ "use_shared_relative_position_bias": false,
205
+ "vocab_size": 8192
206
+ },
207
+ "backbone_hidden_size": 1024,
208
+ "bad_words_ids": null,
209
+ "batch_norm_eps": 1e-05,
210
+ "begin_suppress_tokens": null,
211
+ "bin_centers_type": "softplus",
212
+ "bin_configurations": [
213
+ {
214
+ "max_depth": 10.0,
215
+ "min_depth": 0.001,
216
+ "n_bins": 64,
217
+ "name": "nyu"
218
+ },
219
+ {
220
+ "max_depth": 80.0,
221
+ "min_depth": 0.001,
222
+ "n_bins": 64,
223
+ "name": "kitti"
224
+ }
225
+ ],
226
+ "bin_embedding_dim": 128,
227
+ "bos_token_id": null,
228
+ "bottleneck_features": 256,
229
+ "chunk_size_feed_forward": 0,
230
+ "cross_attention_hidden_size": null,
231
+ "decoder_start_token_id": null,
232
+ "diversity_penalty": 0.0,
233
+ "do_sample": false,
234
+ "early_stopping": false,
235
+ "encoder_no_repeat_ngram_size": 0,
236
+ "eos_token_id": null,
237
+ "exponential_decay_length_penalty": null,
238
+ "finetuning_task": null,
239
+ "forced_bos_token_id": null,
240
+ "forced_eos_token_id": null,
241
+ "fusion_hidden_size": 256,
242
+ "head_in_index": -1,
243
+ "hidden_act": "gelu",
244
+ "id2label": {
245
+ "0": "LABEL_0",
246
+ "1": "LABEL_1"
247
+ },
248
+ "initializer_range": 0.02,
249
+ "is_decoder": false,
250
+ "is_encoder_decoder": false,
251
+ "label2id": {
252
+ "LABEL_0": 0,
253
+ "LABEL_1": 1
254
+ },
255
+ "length_penalty": 1.0,
256
+ "max_length": 20,
257
+ "max_temp": 50.0,
258
+ "min_length": 0,
259
+ "min_temp": 0.0212,
260
+ "model_type": "zoedepth",
261
+ "neck_hidden_sizes": [
262
+ 256,
263
+ 512,
264
+ 1024,
265
+ 1024
266
+ ],
267
+ "no_repeat_ngram_size": 0,
268
+ "num_attractors": [
269
+ 16,
270
+ 8,
271
+ 4,
272
+ 1
273
+ ],
274
+ "num_beam_groups": 1,
275
+ "num_beams": 1,
276
+ "num_patch_transformer_layers": 4,
277
+ "num_relative_features": 32,
278
+ "num_return_sequences": 1,
279
+ "output_attentions": false,
280
+ "output_hidden_states": false,
281
+ "output_scores": false,
282
+ "pad_token_id": null,
283
+ "patch_transformer_hidden_size": 128,
284
+ "patch_transformer_intermediate_size": 1024,
285
+ "patch_transformer_num_attention_heads": 4,
286
+ "prefix": null,
287
+ "problem_type": null,
288
+ "pruned_heads": {},
289
+ "readout_type": "project",
290
+ "reassemble_factors": [
291
+ 4,
292
+ 2,
293
+ 1,
294
+ 0.5
295
+ ],
296
+ "remove_invalid_values": false,
297
+ "repetition_penalty": 1.0,
298
+ "return_dict": true,
299
+ "return_dict_in_generate": false,
300
+ "sep_token_id": null,
301
+ "suppress_tokens": null,
302
+ "task_specific_params": null,
303
+ "temperature": 1.0,
304
+ "tf_legacy_loss": false,
305
+ "tie_encoder_decoder": false,
306
+ "tie_word_embeddings": true,
307
+ "tokenizer_class": null,
308
+ "top_k": 50,
309
+ "top_p": 1.0,
310
+ "torch_dtype": "bfloat16",
311
+ "torchscript": false,
312
+ "typical_p": 1.0,
313
+ "use_batch_norm_in_fusion_residual": false,
314
+ "use_bfloat16": false,
315
+ "use_bias_in_fusion_residual": null,
316
+ "use_pretrained_backbone": false
317
+ }
318
+ }
configuration_spatialvla.py ADDED
@@ -0,0 +1,171 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # MIT License
2
+ # Copyright (c) 2025 IPEC at Shanghai AI Laboratory
3
+ # Permission is hereby granted, free of charge, to use, copy, modify, merge, publish,
4
+ # distribute, sublicense, and/or sell copies of the Software, subject to the following conditions:
5
+ # The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
6
+ # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND.
7
+ # coding=utf-8
8
+
9
+ """PaliGemmamodel configuration"""
10
+
11
+ import warnings
12
+
13
+ from transformers.configuration_utils import PretrainedConfig
14
+ from transformers.utils import logging
15
+ from transformers import CONFIG_MAPPING, AutoConfig
16
+
17
+
18
+ logger = logging.get_logger(__name__)
19
+
20
+
21
+ class SpatialVLAConfig(PretrainedConfig):
22
+ r"""
23
+ This is the configuration class to store the configuration of a [`PaliGemmaForConditionalGeneration`]. It is used to instantiate an
24
+ PaliGemmamodel according to the specified arguments, defining the model architecture. Instantiating a configuration
25
+ with the defaults will yield a similar configuration to that of the PaliGemma-2B.
26
+
27
+ e.g. [paligemma-hf/paligemma-2b](https://huggingface.co/paligemma-hf/paligemma-2b)
28
+
29
+ Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
30
+ documentation from [`PretrainedConfig`] for more information.
31
+
32
+ Args:
33
+ vision_config (`PaliGemmaVisionConfig`, *optional*):
34
+ Custom vision config or dict
35
+ text_config (`Union[AutoConfig, dict]`, *optional*):
36
+ The config object of the text backbone. Can be any of `LlamaConfig` or `MistralConfig`.
37
+ ignore_index (`int`, *optional*, defaults to -100):
38
+ The ignore index for the loss function.
39
+ image_token_index (`int`, *optional*, defaults to 256000):
40
+ The image token index to encode the image prompt.
41
+ vocab_size (`int`, *optional*, defaults to 257152):
42
+ Vocabulary size of the PaliGemmamodel. Defines the number of different tokens that can be represented by the
43
+ `inputs_ids` passed when calling [`~PaliGemmaForConditionalGeneration`]
44
+ projection_dim (`int`, *optional*, defaults to 2048):
45
+ Dimension of the multimodal projection space.
46
+ hidden_size (`int`, *optional*, defaults to 2048):
47
+ Dimension of the hidden layer of the Language model.
48
+
49
+ Example:
50
+
51
+ ```python
52
+ >>> from transformers import PaliGemmaForConditionalGeneration, PaliGemmaConfig, SiglipVisionConfig, GemmaConfig
53
+
54
+ >>> # Initializing a Siglip-like vision config
55
+ >>> vision_config = SiglipVisionConfig()
56
+
57
+ >>> # Initializing a PaliGemma config
58
+ >>> text_config = GemmaConfig()
59
+
60
+ >>> # Initializing a PaliGemma paligemma-3b-224 style configuration
61
+ >>> configuration = PaliGemmaConfig(vision_config, text_config)
62
+
63
+ >>> # Initializing a model from the paligemma-3b-224 style configuration
64
+ >>> model = PaliGemmaForConditionalGeneration(configuration)
65
+
66
+ >>> # Accessing the model configuration
67
+ >>> configuration = model.config
68
+ ```"""
69
+
70
+ model_type = "spatialvla"
71
+ sub_configs = {"text_config": AutoConfig, "vision_config": AutoConfig, "vision_zoe_config": AutoConfig}
72
+
73
+ def __init__(
74
+ self,
75
+ vision_config=None,
76
+ text_config=None,
77
+ ignore_index=-100,
78
+ image_token_index=256000,
79
+ vocab_size=257152,
80
+ projection_dim=2048,
81
+ hidden_size=2048,
82
+ vision_zoe_config=None,
83
+ action_token_begin_idx=None,
84
+ spatial_token_num=259,
85
+ use_spatial_token=False,
86
+ ego3d_patch_reso=4,
87
+ n_freqs=8,
88
+ use_vision_zoe=True,
89
+ # wrap_lora=False,
90
+ **kwargs,
91
+ ):
92
+ self._ignore_index = ignore_index
93
+ self.image_token_index = image_token_index
94
+ self._vocab_size = vocab_size
95
+ self.projection_dim = projection_dim
96
+ self.hidden_size = hidden_size
97
+ self.vision_config = vision_config
98
+ self.is_encoder_decoder = False
99
+
100
+ if isinstance(self.vision_config, dict):
101
+ vision_config["model_type"] = (
102
+ vision_config["model_type"] if "model_type" in vision_config else "siglip_vision_model"
103
+ )
104
+ self.vision_config = CONFIG_MAPPING[vision_config["model_type"]](**vision_config)
105
+ elif vision_config is None:
106
+ self.vision_config = CONFIG_MAPPING["siglip_vision_model"](
107
+ intermediate_size=4096,
108
+ hidden_size=1152,
109
+ patch_size=14,
110
+ image_size=224,
111
+ num_hidden_layers=27,
112
+ num_attention_heads=16,
113
+ vocab_size=257152,
114
+ vision_use_head=False,
115
+ )
116
+
117
+ self.text_config = text_config
118
+ if isinstance(self.text_config, dict):
119
+ text_config["model_type"] = text_config["model_type"] if "model_type" in text_config else "gemma2"
120
+ self.text_config = CONFIG_MAPPING[text_config["model_type"]](**text_config)
121
+ elif text_config is None:
122
+ self.text_config = CONFIG_MAPPING["gemma2"](
123
+ hidden_size=2048,
124
+ num_hidden_layers=18,
125
+ intermediate_size=16384,
126
+ num_attention_heads=8,
127
+ num_key_value_heads=1,
128
+ is_encoder_decoder=False,
129
+ vocab_size=vocab_size,
130
+ )
131
+ self.text_config.num_image_tokens = (self.vision_config.image_size // self.vision_config.patch_size) ** 2
132
+ self.vision_config.projection_dim = projection_dim
133
+
134
+ # vision zoe config
135
+ self.vision_zoe_config = vision_zoe_config
136
+ if isinstance(self.vision_zoe_config, dict):
137
+ vision_zoe_config["model_type"] = vision_zoe_config["model_type"] if "model_type" in vision_zoe_config else "zoedepth"
138
+ self.vision_zoe_config = CONFIG_MAPPING[vision_zoe_config["model_type"]](**vision_zoe_config)
139
+ else:
140
+ print(f"🔥 init from default configurations ... {self.vision_zoe_config}")
141
+ # BUG: initializing zoe in default cause key error
142
+ # self.vision_zoe_config = CONFIG_MAPPING["zoedepth"]()
143
+ pass
144
+
145
+ # NOTE: additional attributes
146
+ self.action_token_begin_idx = action_token_begin_idx
147
+ self.spatial_token_num = spatial_token_num
148
+ self.use_spatial_token = use_spatial_token
149
+ self.ego3d_patch_reso = ego3d_patch_reso
150
+ self.n_freqs = n_freqs
151
+ self.use_vision_zoe = use_vision_zoe
152
+ # self.wrap_lora = wrap_lora
153
+
154
+ super().__init__(**kwargs)
155
+
156
+ @property
157
+ def ignore_index(self):
158
+ warnings.warn(
159
+ "The `ignore_index` attribute is deprecated and will be removed in v4.47.",
160
+ FutureWarning,
161
+ )
162
+ return self._ignore_index
163
+
164
+ @ignore_index.setter
165
+ def ignore_index(self, value):
166
+ self._ignore_index = value
167
+
168
+ def to_dict(self):
169
+ output = super().to_dict()
170
+ output.pop("_ignore_index", None)
171
+ return output
dataset_statistics.json ADDED
@@ -0,0 +1,3502 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "fractal20220817_data/0.1.0": {
3
+ "action": {
4
+ "mean": [
5
+ 0.006987507455050945,
6
+ 0.006265853065997362,
7
+ -0.012625162489712238,
8
+ 0.04333285242319107,
9
+ -0.005756276659667492,
10
+ 0.0009130403632298112,
11
+ 0.5354204773902893
12
+ ],
13
+ "std": [
14
+ 0.06921109557151794,
15
+ 0.05970889702439308,
16
+ 0.0735311210155487,
17
+ 0.1561058759689331,
18
+ 0.1316441297531128,
19
+ 0.14593777060508728,
20
+ 0.49711623787879944
21
+ ],
22
+ "max": [
23
+ 2.9984593391418457,
24
+ 22.09052848815918,
25
+ 2.7507524490356445,
26
+ 1.570636510848999,
27
+ 1.5321086645126343,
28
+ 1.5691522359848022,
29
+ 1.0
30
+ ],
31
+ "min": [
32
+ -2.0204520225524902,
33
+ -5.497899532318115,
34
+ -2.031663417816162,
35
+ -1.569917917251587,
36
+ -1.569892168045044,
37
+ -1.570419430732727,
38
+ 0.0
39
+ ],
40
+ "q01": [
41
+ -0.22453527510166169,
42
+ -0.14820013284683228,
43
+ -0.231589707583189,
44
+ -0.3517994859814644,
45
+ -0.4193011274933815,
46
+ -0.43643461108207704,
47
+ 0.0
48
+ ],
49
+ "q99": [
50
+ 0.17824687153100965,
51
+ 0.14938379630446405,
52
+ 0.21842354819178575,
53
+ 0.5892666035890578,
54
+ 0.35272657424211445,
55
+ 0.44796681255102094,
56
+ 1.0
57
+ ],
58
+ "mask": [
59
+ true,
60
+ true,
61
+ true,
62
+ true,
63
+ true,
64
+ true,
65
+ false
66
+ ]
67
+ },
68
+ "proprio": {
69
+ "mean": [
70
+ 0.0,
71
+ 0.0,
72
+ 0.0,
73
+ 0.0,
74
+ 0.0,
75
+ 0.0,
76
+ 0.0
77
+ ],
78
+ "std": [
79
+ 0.0,
80
+ 0.0,
81
+ 0.0,
82
+ 0.0,
83
+ 0.0,
84
+ 0.0,
85
+ 0.0
86
+ ],
87
+ "max": [
88
+ 0.0,
89
+ 0.0,
90
+ 0.0,
91
+ 0.0,
92
+ 0.0,
93
+ 0.0,
94
+ 0.0
95
+ ],
96
+ "min": [
97
+ 0.0,
98
+ 0.0,
99
+ 0.0,
100
+ 0.0,
101
+ 0.0,
102
+ 0.0,
103
+ 0.0
104
+ ],
105
+ "q01": [
106
+ 0.0,
107
+ 0.0,
108
+ 0.0,
109
+ 0.0,
110
+ 0.0,
111
+ 0.0,
112
+ 0.0
113
+ ],
114
+ "q99": [
115
+ 0.0,
116
+ 0.0,
117
+ 0.0,
118
+ 0.0,
119
+ 0.0,
120
+ 0.0,
121
+ 0.0
122
+ ]
123
+ },
124
+ "num_transitions": 3786400,
125
+ "num_trajectories": 87212
126
+ },
127
+ "kuka/0.1.0": {
128
+ "action": {
129
+ "mean": [
130
+ -0.00046687963185831904,
131
+ 0.00040137648466043174,
132
+ -0.0012807906605303288,
133
+ 0.0,
134
+ 0.0,
135
+ -0.037225183099508286,
136
+ 0.4131543040275574
137
+ ],
138
+ "std": [
139
+ 0.020832739770412445,
140
+ 0.029158642515540123,
141
+ 0.0642285868525505,
142
+ 0.0,
143
+ 0.0,
144
+ 0.14224639534950256,
145
+ 0.4908643662929535
146
+ ],
147
+ "max": [
148
+ 0.1697135865688324,
149
+ 0.2777623236179352,
150
+ 0.43710532784461975,
151
+ 0.0,
152
+ 0.0,
153
+ 1.9684287309646606,
154
+ 1.0
155
+ ],
156
+ "min": [
157
+ -0.159867063164711,
158
+ -0.2892282009124756,
159
+ -0.2795473635196686,
160
+ 0.0,
161
+ 0.0,
162
+ -1.9875637292861938,
163
+ 0.0
164
+ ],
165
+ "q01": [
166
+ -0.06619441494345665,
167
+ -0.08713878810405731,
168
+ -0.15083016991615295,
169
+ 0.0,
170
+ 0.0,
171
+ -0.5415697038173676,
172
+ 0.0
173
+ ],
174
+ "q99": [
175
+ 0.06601839080452929,
176
+ 0.08732476785779003,
177
+ 0.18168179214000715,
178
+ 0.0,
179
+ 0.0,
180
+ 0.2923380345106127,
181
+ 1.0
182
+ ],
183
+ "mask": [
184
+ true,
185
+ true,
186
+ true,
187
+ true,
188
+ true,
189
+ true,
190
+ false
191
+ ]
192
+ },
193
+ "proprio": {
194
+ "mean": [
195
+ 0.0,
196
+ 0.0,
197
+ 0.0,
198
+ 0.0,
199
+ 0.0,
200
+ 0.0,
201
+ 0.0
202
+ ],
203
+ "std": [
204
+ 0.0,
205
+ 0.0,
206
+ 0.0,
207
+ 0.0,
208
+ 0.0,
209
+ 0.0,
210
+ 0.0
211
+ ],
212
+ "max": [
213
+ 0.0,
214
+ 0.0,
215
+ 0.0,
216
+ 0.0,
217
+ 0.0,
218
+ 0.0,
219
+ 0.0
220
+ ],
221
+ "min": [
222
+ 0.0,
223
+ 0.0,
224
+ 0.0,
225
+ 0.0,
226
+ 0.0,
227
+ 0.0,
228
+ 0.0
229
+ ],
230
+ "q01": [
231
+ 0.0,
232
+ 0.0,
233
+ 0.0,
234
+ 0.0,
235
+ 0.0,
236
+ 0.0,
237
+ 0.0
238
+ ],
239
+ "q99": [
240
+ 0.0,
241
+ 0.0,
242
+ 0.0,
243
+ 0.0,
244
+ 0.0,
245
+ 0.0,
246
+ 0.0
247
+ ]
248
+ },
249
+ "num_transitions": 2455879,
250
+ "num_trajectories": 209880
251
+ },
252
+ "bridge_orig/1.0.0": {
253
+ "action": {
254
+ "mean": [
255
+ 0.00023341714404523373,
256
+ 0.00013004327774979174,
257
+ -0.00012762591359205544,
258
+ -0.0001556579809403047,
259
+ -0.00040393328526988626,
260
+ 0.00023558337124995887,
261
+ 0.5764582753181458
262
+ ],
263
+ "std": [
264
+ 0.009765734896063805,
265
+ 0.013689505867660046,
266
+ 0.012667152099311352,
267
+ 0.028534479439258575,
268
+ 0.03063790127635002,
269
+ 0.07691770792007446,
270
+ 0.4973658621311188
271
+ ],
272
+ "max": [
273
+ 0.41691166162490845,
274
+ 0.25864794850349426,
275
+ 0.21218234300613403,
276
+ 3.122201919555664,
277
+ 1.8618112802505493,
278
+ 6.280478477478027,
279
+ 1.0
280
+ ],
281
+ "min": [
282
+ -0.4007510244846344,
283
+ -0.13874775171279907,
284
+ -0.22553899884223938,
285
+ -3.2010786533355713,
286
+ -1.8618112802505493,
287
+ -6.279075622558594,
288
+ 0.0
289
+ ],
290
+ "q01": [
291
+ -0.02872725307941437,
292
+ -0.04170349963009357,
293
+ -0.026093858778476715,
294
+ -0.08092105075716972,
295
+ -0.09288699507713317,
296
+ -0.20718276381492615,
297
+ 0.0
298
+ ],
299
+ "q99": [
300
+ 0.028309678435325586,
301
+ 0.040855254605412394,
302
+ 0.040161586627364146,
303
+ 0.08192047759890528,
304
+ 0.07792850524187081,
305
+ 0.20382574498653397,
306
+ 1.0
307
+ ],
308
+ "mask": [
309
+ true,
310
+ true,
311
+ true,
312
+ true,
313
+ true,
314
+ true,
315
+ false
316
+ ]
317
+ },
318
+ "proprio": {
319
+ "mean": [
320
+ 0.0,
321
+ 0.0,
322
+ 0.0,
323
+ 0.0,
324
+ 0.0,
325
+ 0.0,
326
+ 0.0
327
+ ],
328
+ "std": [
329
+ 0.0,
330
+ 0.0,
331
+ 0.0,
332
+ 0.0,
333
+ 0.0,
334
+ 0.0,
335
+ 0.0
336
+ ],
337
+ "max": [
338
+ 0.0,
339
+ 0.0,
340
+ 0.0,
341
+ 0.0,
342
+ 0.0,
343
+ 0.0,
344
+ 0.0
345
+ ],
346
+ "min": [
347
+ 0.0,
348
+ 0.0,
349
+ 0.0,
350
+ 0.0,
351
+ 0.0,
352
+ 0.0,
353
+ 0.0
354
+ ],
355
+ "q01": [
356
+ 0.0,
357
+ 0.0,
358
+ 0.0,
359
+ 0.0,
360
+ 0.0,
361
+ 0.0,
362
+ 0.0
363
+ ],
364
+ "q99": [
365
+ 0.0,
366
+ 0.0,
367
+ 0.0,
368
+ 0.0,
369
+ 0.0,
370
+ 0.0,
371
+ 0.0
372
+ ]
373
+ },
374
+ "num_transitions": 2135463,
375
+ "num_trajectories": 60064
376
+ },
377
+ "taco_play/0.1.0": {
378
+ "action": {
379
+ "mean": [
380
+ -0.0038459226489067078,
381
+ 0.009671436622738838,
382
+ 0.01278059184551239,
383
+ -0.0054037850350141525,
384
+ -0.009606562554836273,
385
+ -0.0024807206355035305,
386
+ 0.4263913035392761
387
+ ],
388
+ "std": [
389
+ 0.23254045844078064,
390
+ 0.3629826307296753,
391
+ 0.2869291603565216,
392
+ 0.261770635843277,
393
+ 0.24388927221298218,
394
+ 0.5216501355171204,
395
+ 0.49469029903411865
396
+ ],
397
+ "max": [
398
+ 1.4915844202041626,
399
+ 2.1842432022094727,
400
+ 2.6836395263671875,
401
+ 5.035226821899414,
402
+ 2.665864944458008,
403
+ 4.250768661499023,
404
+ 1.0
405
+ ],
406
+ "min": [
407
+ -4.242457866668701,
408
+ -3.192805051803589,
409
+ -1.3371467590332031,
410
+ -4.202683448791504,
411
+ -2.6722638607025146,
412
+ -3.3467135429382324,
413
+ 0.0
414
+ ],
415
+ "q01": [
416
+ -0.7106140398979186,
417
+ -1.056944659948349,
418
+ -0.5878450274467468,
419
+ -0.7682853937149048,
420
+ -0.7180147767066956,
421
+ -1.5527938604354858,
422
+ 0.0
423
+ ],
424
+ "q99": [
425
+ 0.6482916426658629,
426
+ 1.0051310062408447,
427
+ 0.9480248689651489,
428
+ 0.6926478147506714,
429
+ 0.6351067513227462,
430
+ 1.628010264635086,
431
+ 1.0
432
+ ],
433
+ "mask": [
434
+ true,
435
+ true,
436
+ true,
437
+ true,
438
+ true,
439
+ true,
440
+ false
441
+ ]
442
+ },
443
+ "proprio": {
444
+ "mean": [
445
+ 0.0,
446
+ 0.0,
447
+ 0.0,
448
+ 0.0,
449
+ 0.0,
450
+ 0.0,
451
+ 0.0
452
+ ],
453
+ "std": [
454
+ 0.0,
455
+ 0.0,
456
+ 0.0,
457
+ 0.0,
458
+ 0.0,
459
+ 0.0,
460
+ 0.0
461
+ ],
462
+ "max": [
463
+ 0.0,
464
+ 0.0,
465
+ 0.0,
466
+ 0.0,
467
+ 0.0,
468
+ 0.0,
469
+ 0.0
470
+ ],
471
+ "min": [
472
+ 0.0,
473
+ 0.0,
474
+ 0.0,
475
+ 0.0,
476
+ 0.0,
477
+ 0.0,
478
+ 0.0
479
+ ],
480
+ "q01": [
481
+ 0.0,
482
+ 0.0,
483
+ 0.0,
484
+ 0.0,
485
+ 0.0,
486
+ 0.0,
487
+ 0.0
488
+ ],
489
+ "q99": [
490
+ 0.0,
491
+ 0.0,
492
+ 0.0,
493
+ 0.0,
494
+ 0.0,
495
+ 0.0,
496
+ 0.0
497
+ ]
498
+ },
499
+ "num_transitions": 237798,
500
+ "num_trajectories": 3603
501
+ },
502
+ "jaco_play/0.1.0": {
503
+ "action": {
504
+ "mean": [
505
+ 0.0009658387862145901,
506
+ -0.005800850689411163,
507
+ -0.003950685728341341,
508
+ 0.0,
509
+ 0.0,
510
+ 0.0,
511
+ 0.34934908151626587
512
+ ],
513
+ "std": [
514
+ 0.12234985828399658,
515
+ 0.09678783267736435,
516
+ 0.1115543395280838,
517
+ 0.0,
518
+ 0.0,
519
+ 0.0,
520
+ 0.47682321071624756
521
+ ],
522
+ "max": [
523
+ 0.20000000298023224,
524
+ 0.20000000298023224,
525
+ 0.20000000298023224,
526
+ 0.0,
527
+ 0.0,
528
+ 0.0,
529
+ 1.0
530
+ ],
531
+ "min": [
532
+ -0.20000000298023224,
533
+ -0.20000000298023224,
534
+ -0.20000000298023224,
535
+ 0.0,
536
+ 0.0,
537
+ 0.0,
538
+ 0.0
539
+ ],
540
+ "q01": [
541
+ -0.20000000298023224,
542
+ -0.20000000298023224,
543
+ -0.20000000298023224,
544
+ 0.0,
545
+ 0.0,
546
+ 0.0,
547
+ 0.0
548
+ ],
549
+ "q99": [
550
+ 0.20000000298023224,
551
+ 0.20000000298023224,
552
+ 0.20000000298023224,
553
+ 0.0,
554
+ 0.0,
555
+ 0.0,
556
+ 1.0
557
+ ],
558
+ "mask": [
559
+ true,
560
+ true,
561
+ true,
562
+ true,
563
+ true,
564
+ true,
565
+ false
566
+ ]
567
+ },
568
+ "proprio": {
569
+ "mean": [
570
+ 0.0,
571
+ 0.0,
572
+ 0.0,
573
+ 0.0,
574
+ 0.0,
575
+ 0.0,
576
+ 0.0
577
+ ],
578
+ "std": [
579
+ 0.0,
580
+ 0.0,
581
+ 0.0,
582
+ 0.0,
583
+ 0.0,
584
+ 0.0,
585
+ 0.0
586
+ ],
587
+ "max": [
588
+ 0.0,
589
+ 0.0,
590
+ 0.0,
591
+ 0.0,
592
+ 0.0,
593
+ 0.0,
594
+ 0.0
595
+ ],
596
+ "min": [
597
+ 0.0,
598
+ 0.0,
599
+ 0.0,
600
+ 0.0,
601
+ 0.0,
602
+ 0.0,
603
+ 0.0
604
+ ],
605
+ "q01": [
606
+ 0.0,
607
+ 0.0,
608
+ 0.0,
609
+ 0.0,
610
+ 0.0,
611
+ 0.0,
612
+ 0.0
613
+ ],
614
+ "q99": [
615
+ 0.0,
616
+ 0.0,
617
+ 0.0,
618
+ 0.0,
619
+ 0.0,
620
+ 0.0,
621
+ 0.0
622
+ ]
623
+ },
624
+ "num_transitions": 77965,
625
+ "num_trajectories": 1085
626
+ },
627
+ "berkeley_cable_routing/0.1.0": {
628
+ "action": {
629
+ "mean": [
630
+ -0.07139858603477478,
631
+ 0.023608991876244545,
632
+ 0.10241956263780594,
633
+ 0.0,
634
+ 0.0,
635
+ 0.04967105761170387,
636
+ 0.0
637
+ ],
638
+ "std": [
639
+ 0.18155010044574738,
640
+ 0.18109896779060364,
641
+ 0.21220752596855164,
642
+ 0.0,
643
+ 0.0,
644
+ 0.3475516438484192,
645
+ 0.0
646
+ ],
647
+ "max": [
648
+ 0.9633283019065857,
649
+ 1.0,
650
+ 1.0,
651
+ 0.0,
652
+ 0.0,
653
+ 1.0,
654
+ 0.0
655
+ ],
656
+ "min": [
657
+ -0.9809081554412842,
658
+ -0.9554349184036255,
659
+ -0.9994775056838989,
660
+ 0.0,
661
+ 0.0,
662
+ -1.0,
663
+ 0.0
664
+ ],
665
+ "q01": [
666
+ -0.5534318816661835,
667
+ -0.4797285574674606,
668
+ -0.5314934802055359,
669
+ 0.0,
670
+ 0.0,
671
+ -0.8855219376087189,
672
+ 0.0
673
+ ],
674
+ "q99": [
675
+ 0.42652835428714786,
676
+ 0.5000944086909298,
677
+ 0.639823433756829,
678
+ 0.0,
679
+ 0.0,
680
+ 0.984243879914284,
681
+ 0.0
682
+ ],
683
+ "mask": [
684
+ true,
685
+ true,
686
+ true,
687
+ true,
688
+ true,
689
+ true,
690
+ false
691
+ ]
692
+ },
693
+ "proprio": {
694
+ "mean": [
695
+ 0.0,
696
+ 0.0,
697
+ 0.0,
698
+ 0.0,
699
+ 0.0,
700
+ 0.0,
701
+ 0.0
702
+ ],
703
+ "std": [
704
+ 0.0,
705
+ 0.0,
706
+ 0.0,
707
+ 0.0,
708
+ 0.0,
709
+ 0.0,
710
+ 0.0
711
+ ],
712
+ "max": [
713
+ 0.0,
714
+ 0.0,
715
+ 0.0,
716
+ 0.0,
717
+ 0.0,
718
+ 0.0,
719
+ 0.0
720
+ ],
721
+ "min": [
722
+ 0.0,
723
+ 0.0,
724
+ 0.0,
725
+ 0.0,
726
+ 0.0,
727
+ 0.0,
728
+ 0.0
729
+ ],
730
+ "q01": [
731
+ 0.0,
732
+ 0.0,
733
+ 0.0,
734
+ 0.0,
735
+ 0.0,
736
+ 0.0,
737
+ 0.0
738
+ ],
739
+ "q99": [
740
+ 0.0,
741
+ 0.0,
742
+ 0.0,
743
+ 0.0,
744
+ 0.0,
745
+ 0.0,
746
+ 0.0
747
+ ]
748
+ },
749
+ "num_transitions": 42328,
750
+ "num_trajectories": 1647
751
+ },
752
+ "roboturk/0.1.0": {
753
+ "action": {
754
+ "mean": [
755
+ 0.001444889116100967,
756
+ -0.0015945355407893658,
757
+ -0.0011753803119063377,
758
+ 0.002301239175722003,
759
+ -0.0009382442804053426,
760
+ -0.00011485860886750743,
761
+ 0.5746025443077087
762
+ ],
763
+ "std": [
764
+ 0.0493537075817585,
765
+ 0.06354564428329468,
766
+ 0.06116492301225662,
767
+ 0.0955340564250946,
768
+ 0.08420011401176453,
769
+ 0.06517910957336426,
770
+ 0.4945177137851715
771
+ ],
772
+ "max": [
773
+ 0.39124172925949097,
774
+ 0.4601028263568878,
775
+ 0.4870833456516266,
776
+ 1.816888689994812,
777
+ 1.8240282535552979,
778
+ 1.4824820756912231,
779
+ 1.0
780
+ ],
781
+ "min": [
782
+ -0.6546999216079712,
783
+ -0.6365841031074524,
784
+ -0.4217723608016968,
785
+ -1.6695482730865479,
786
+ -1.8023357391357422,
787
+ -1.4630827903747559,
788
+ 0.0
789
+ ],
790
+ "q01": [
791
+ -0.1342635464668274,
792
+ -0.19996687173843383,
793
+ -0.1482972100377083,
794
+ -0.20720748245716095,
795
+ -0.09676413893699647,
796
+ -0.18075634717941286,
797
+ 0.0
798
+ ],
799
+ "q99": [
800
+ 0.14956976801157001,
801
+ 0.1805950567126275,
802
+ 0.18841815620660796,
803
+ 0.21615413755178453,
804
+ 0.09457383215427405,
805
+ 0.18543301910162005,
806
+ 1.0
807
+ ],
808
+ "mask": [
809
+ true,
810
+ true,
811
+ true,
812
+ true,
813
+ true,
814
+ true,
815
+ false
816
+ ]
817
+ },
818
+ "proprio": {
819
+ "mean": [
820
+ 0.0,
821
+ 0.0,
822
+ 0.0,
823
+ 0.0,
824
+ 0.0,
825
+ 0.0,
826
+ 0.0
827
+ ],
828
+ "std": [
829
+ 0.0,
830
+ 0.0,
831
+ 0.0,
832
+ 0.0,
833
+ 0.0,
834
+ 0.0,
835
+ 0.0
836
+ ],
837
+ "max": [
838
+ 0.0,
839
+ 0.0,
840
+ 0.0,
841
+ 0.0,
842
+ 0.0,
843
+ 0.0,
844
+ 0.0
845
+ ],
846
+ "min": [
847
+ 0.0,
848
+ 0.0,
849
+ 0.0,
850
+ 0.0,
851
+ 0.0,
852
+ 0.0,
853
+ 0.0
854
+ ],
855
+ "q01": [
856
+ 0.0,
857
+ 0.0,
858
+ 0.0,
859
+ 0.0,
860
+ 0.0,
861
+ 0.0,
862
+ 0.0
863
+ ],
864
+ "q99": [
865
+ 0.0,
866
+ 0.0,
867
+ 0.0,
868
+ 0.0,
869
+ 0.0,
870
+ 0.0,
871
+ 0.0
872
+ ]
873
+ },
874
+ "num_transitions": 187507,
875
+ "num_trajectories": 1995
876
+ },
877
+ "viola/0.1.0": {
878
+ "action": {
879
+ "mean": [
880
+ 0.04761853069067001,
881
+ -0.029204534366726875,
882
+ 0.055867329239845276,
883
+ -0.0026185200549662113,
884
+ 0.006867341697216034,
885
+ -0.016821356490254402,
886
+ 0.7323777675628662
887
+ ],
888
+ "std": [
889
+ 0.39157867431640625,
890
+ 0.40765219926834106,
891
+ 0.40077903866767883,
892
+ 0.10023998469114304,
893
+ 0.08443189412355423,
894
+ 0.10375089943408966,
895
+ 0.442600816488266
896
+ ],
897
+ "max": [
898
+ 1.0,
899
+ 1.0,
900
+ 1.0,
901
+ 0.375,
902
+ 0.36321428418159485,
903
+ 0.375,
904
+ 1.0
905
+ ],
906
+ "min": [
907
+ -1.0,
908
+ -1.0,
909
+ -1.0,
910
+ -0.375,
911
+ -0.375,
912
+ -0.375,
913
+ 0.0
914
+ ],
915
+ "q01": [
916
+ -0.9628571271896362,
917
+ -1.0,
918
+ -1.0,
919
+ -0.26249998807907104,
920
+ -0.21321429312229156,
921
+ -0.3385714292526245,
922
+ 0.0
923
+ ],
924
+ "q99": [
925
+ 0.9114285707473755,
926
+ 0.868571400642395,
927
+ 1.0,
928
+ 0.2817857265472412,
929
+ 0.2239285707473755,
930
+ 0.3557142913341522,
931
+ 1.0
932
+ ],
933
+ "mask": [
934
+ true,
935
+ true,
936
+ true,
937
+ true,
938
+ true,
939
+ true,
940
+ false
941
+ ]
942
+ },
943
+ "proprio": {
944
+ "mean": [
945
+ 0.0,
946
+ 0.0,
947
+ 0.0,
948
+ 0.0,
949
+ 0.0,
950
+ 0.0,
951
+ 0.0
952
+ ],
953
+ "std": [
954
+ 0.0,
955
+ 0.0,
956
+ 0.0,
957
+ 0.0,
958
+ 0.0,
959
+ 0.0,
960
+ 0.0
961
+ ],
962
+ "max": [
963
+ 0.0,
964
+ 0.0,
965
+ 0.0,
966
+ 0.0,
967
+ 0.0,
968
+ 0.0,
969
+ 0.0
970
+ ],
971
+ "min": [
972
+ 0.0,
973
+ 0.0,
974
+ 0.0,
975
+ 0.0,
976
+ 0.0,
977
+ 0.0,
978
+ 0.0
979
+ ],
980
+ "q01": [
981
+ 0.0,
982
+ 0.0,
983
+ 0.0,
984
+ 0.0,
985
+ 0.0,
986
+ 0.0,
987
+ 0.0
988
+ ],
989
+ "q99": [
990
+ 0.0,
991
+ 0.0,
992
+ 0.0,
993
+ 0.0,
994
+ 0.0,
995
+ 0.0,
996
+ 0.0
997
+ ]
998
+ },
999
+ "num_transitions": 76324,
1000
+ "num_trajectories": 150
1001
+ },
1002
+ "berkeley_autolab_ur5/0.1.0": {
1003
+ "action": {
1004
+ "mean": [
1005
+ 0.0005683613708242774,
1006
+ 0.0012176961172372103,
1007
+ -0.0005296385497786105,
1008
+ 0.00021029777417425066,
1009
+ 6.069485243642703e-05,
1010
+ 0.0012049867073073983,
1011
+ 0.6298308372497559
1012
+ ],
1013
+ "std": [
1014
+ 0.011533073149621487,
1015
+ 0.007990497164428234,
1016
+ 0.009577799588441849,
1017
+ 0.009432999417185783,
1018
+ 0.016427574679255486,
1019
+ 0.011054049246013165,
1020
+ 0.482679545879364
1021
+ ],
1022
+ "max": [
1023
+ 0.019999999552965164,
1024
+ 0.019999999552965164,
1025
+ 0.019999999552965164,
1026
+ 0.06666667014360428,
1027
+ 0.06666667014360428,
1028
+ 0.06666667014360428,
1029
+ 1.0
1030
+ ],
1031
+ "min": [
1032
+ -0.019999999552965164,
1033
+ -0.019999999552965164,
1034
+ -0.019999999552965164,
1035
+ -0.06666667014360428,
1036
+ -0.06666667014360428,
1037
+ -0.06666667014360428,
1038
+ 0.0
1039
+ ],
1040
+ "q01": [
1041
+ -0.019999999552965164,
1042
+ -0.019999999552965164,
1043
+ -0.019999999552965164,
1044
+ -0.02628571353852749,
1045
+ -0.06666667014360428,
1046
+ -0.03847619146108627,
1047
+ 0.0
1048
+ ],
1049
+ "q99": [
1050
+ 0.019999999552965164,
1051
+ 0.019999999552965164,
1052
+ 0.019999999552965164,
1053
+ 0.031809523701667786,
1054
+ 0.06666667014360428,
1055
+ 0.036571428179740906,
1056
+ 1.0
1057
+ ],
1058
+ "mask": [
1059
+ true,
1060
+ true,
1061
+ true,
1062
+ true,
1063
+ true,
1064
+ true,
1065
+ false
1066
+ ]
1067
+ },
1068
+ "proprio": {
1069
+ "mean": [
1070
+ 0.0,
1071
+ 0.0,
1072
+ 0.0,
1073
+ 0.0,
1074
+ 0.0,
1075
+ 0.0,
1076
+ 0.0
1077
+ ],
1078
+ "std": [
1079
+ 0.0,
1080
+ 0.0,
1081
+ 0.0,
1082
+ 0.0,
1083
+ 0.0,
1084
+ 0.0,
1085
+ 0.0
1086
+ ],
1087
+ "max": [
1088
+ 0.0,
1089
+ 0.0,
1090
+ 0.0,
1091
+ 0.0,
1092
+ 0.0,
1093
+ 0.0,
1094
+ 0.0
1095
+ ],
1096
+ "min": [
1097
+ 0.0,
1098
+ 0.0,
1099
+ 0.0,
1100
+ 0.0,
1101
+ 0.0,
1102
+ 0.0,
1103
+ 0.0
1104
+ ],
1105
+ "q01": [
1106
+ 0.0,
1107
+ 0.0,
1108
+ 0.0,
1109
+ 0.0,
1110
+ 0.0,
1111
+ 0.0,
1112
+ 0.0
1113
+ ],
1114
+ "q99": [
1115
+ 0.0,
1116
+ 0.0,
1117
+ 0.0,
1118
+ 0.0,
1119
+ 0.0,
1120
+ 0.0,
1121
+ 0.0
1122
+ ]
1123
+ },
1124
+ "num_transitions": 97939,
1125
+ "num_trajectories": 1000
1126
+ },
1127
+ "toto/0.1.0": {
1128
+ "action": {
1129
+ "mean": [
1130
+ 0.3854214549064636,
1131
+ 0.007769507821649313,
1132
+ 0.3632742166519165,
1133
+ -0.665202796459198,
1134
+ 0.1890396624803543,
1135
+ 0.0329875648021698,
1136
+ 0.0
1137
+ ],
1138
+ "std": [
1139
+ 0.12211630493402481,
1140
+ 0.19378569722175598,
1141
+ 0.10178232192993164,
1142
+ 0.5725256204605103,
1143
+ 0.298846036195755,
1144
+ 0.32599160075187683,
1145
+ 0.0
1146
+ ],
1147
+ "max": [
1148
+ 0.6839867234230042,
1149
+ 0.4454185664653778,
1150
+ 0.7984078526496887,
1151
+ 2.120781660079956,
1152
+ 1.371164321899414,
1153
+ 1.4118704795837402,
1154
+ 0.0
1155
+ ],
1156
+ "min": [
1157
+ 0.09922284632921219,
1158
+ -0.5180193781852722,
1159
+ 0.13791072368621826,
1160
+ -2.635117530822754,
1161
+ -1.0734480619430542,
1162
+ -1.9282547235488892,
1163
+ 0.0
1164
+ ],
1165
+ "q01": [
1166
+ 0.1756722891330719,
1167
+ -0.3077590811252594,
1168
+ 0.235383919775486,
1169
+ -2.0908505964279174,
1170
+ -0.6191593289375306,
1171
+ -0.7488683319091797,
1172
+ 0.0
1173
+ ],
1174
+ "q99": [
1175
+ 0.6136963081359863,
1176
+ 0.33704194784164443,
1177
+ 0.6681221985816956,
1178
+ 0.7422861719131538,
1179
+ 0.7955395007133507,
1180
+ 0.740464625358582,
1181
+ 0.0
1182
+ ],
1183
+ "mask": [
1184
+ true,
1185
+ true,
1186
+ true,
1187
+ true,
1188
+ true,
1189
+ true,
1190
+ false
1191
+ ]
1192
+ },
1193
+ "proprio": {
1194
+ "mean": [
1195
+ 0.0,
1196
+ 0.0,
1197
+ 0.0,
1198
+ 0.0,
1199
+ 0.0,
1200
+ 0.0,
1201
+ 0.0
1202
+ ],
1203
+ "std": [
1204
+ 0.0,
1205
+ 0.0,
1206
+ 0.0,
1207
+ 0.0,
1208
+ 0.0,
1209
+ 0.0,
1210
+ 0.0
1211
+ ],
1212
+ "max": [
1213
+ 0.0,
1214
+ 0.0,
1215
+ 0.0,
1216
+ 0.0,
1217
+ 0.0,
1218
+ 0.0,
1219
+ 0.0
1220
+ ],
1221
+ "min": [
1222
+ 0.0,
1223
+ 0.0,
1224
+ 0.0,
1225
+ 0.0,
1226
+ 0.0,
1227
+ 0.0,
1228
+ 0.0
1229
+ ],
1230
+ "q01": [
1231
+ 0.0,
1232
+ 0.0,
1233
+ 0.0,
1234
+ 0.0,
1235
+ 0.0,
1236
+ 0.0,
1237
+ 0.0
1238
+ ],
1239
+ "q99": [
1240
+ 0.0,
1241
+ 0.0,
1242
+ 0.0,
1243
+ 0.0,
1244
+ 0.0,
1245
+ 0.0,
1246
+ 0.0
1247
+ ]
1248
+ },
1249
+ "num_transitions": 325699,
1250
+ "num_trajectories": 1003
1251
+ },
1252
+ "language_table/0.1.0": {
1253
+ "action": {
1254
+ "mean": [
1255
+ 0.00014891766477376223,
1256
+ -0.0005636657006107271,
1257
+ 0.0,
1258
+ 0.0,
1259
+ 0.0,
1260
+ 0.0,
1261
+ 1.0
1262
+ ],
1263
+ "std": [
1264
+ 0.030162859708070755,
1265
+ 0.04230763390660286,
1266
+ 0.0,
1267
+ 0.0,
1268
+ 0.0,
1269
+ 0.0,
1270
+ 0.0
1271
+ ],
1272
+ "max": [
1273
+ 0.23357294499874115,
1274
+ 0.24496802687644958,
1275
+ 0.0,
1276
+ 0.0,
1277
+ 0.0,
1278
+ 0.0,
1279
+ 1.0
1280
+ ],
1281
+ "min": [
1282
+ -0.21989956498146057,
1283
+ -0.23736150562763214,
1284
+ 0.0,
1285
+ 0.0,
1286
+ 0.0,
1287
+ 0.0,
1288
+ 1.0
1289
+ ],
1290
+ "q01": [
1291
+ -0.08179590478539467,
1292
+ -0.11795833334326744,
1293
+ 0.0,
1294
+ 0.0,
1295
+ 0.0,
1296
+ 0.0,
1297
+ 1.0
1298
+ ],
1299
+ "q99": [
1300
+ 0.08822273463010788,
1301
+ 0.1191693339496851,
1302
+ 0.0,
1303
+ 0.0,
1304
+ 0.0,
1305
+ 0.0,
1306
+ 1.0
1307
+ ],
1308
+ "mask": [
1309
+ true,
1310
+ true,
1311
+ true,
1312
+ true,
1313
+ true,
1314
+ true,
1315
+ false
1316
+ ]
1317
+ },
1318
+ "proprio": {
1319
+ "mean": [
1320
+ 0.0,
1321
+ 0.0,
1322
+ 0.0,
1323
+ 0.0,
1324
+ 0.0,
1325
+ 0.0,
1326
+ 0.0
1327
+ ],
1328
+ "std": [
1329
+ 0.0,
1330
+ 0.0,
1331
+ 0.0,
1332
+ 0.0,
1333
+ 0.0,
1334
+ 0.0,
1335
+ 0.0
1336
+ ],
1337
+ "max": [
1338
+ 0.0,
1339
+ 0.0,
1340
+ 0.0,
1341
+ 0.0,
1342
+ 0.0,
1343
+ 0.0,
1344
+ 0.0
1345
+ ],
1346
+ "min": [
1347
+ 0.0,
1348
+ 0.0,
1349
+ 0.0,
1350
+ 0.0,
1351
+ 0.0,
1352
+ 0.0,
1353
+ 0.0
1354
+ ],
1355
+ "q01": [
1356
+ 0.0,
1357
+ 0.0,
1358
+ 0.0,
1359
+ 0.0,
1360
+ 0.0,
1361
+ 0.0,
1362
+ 0.0
1363
+ ],
1364
+ "q99": [
1365
+ 0.0,
1366
+ 0.0,
1367
+ 0.0,
1368
+ 0.0,
1369
+ 0.0,
1370
+ 0.0,
1371
+ 0.0
1372
+ ]
1373
+ },
1374
+ "num_transitions": 7045476,
1375
+ "num_trajectories": 442226
1376
+ },
1377
+ "stanford_hydra_dataset_converted_externally_to_rlds/0.1.0": {
1378
+ "action": {
1379
+ "mean": [
1380
+ 0.0007790043600834906,
1381
+ 0.00013707877951674163,
1382
+ -0.000254859565757215,
1383
+ 0.0012903243768960238,
1384
+ -0.004751724191009998,
1385
+ 0.002692892448976636,
1386
+ 0.48855218291282654
1387
+ ],
1388
+ "std": [
1389
+ 0.008022183552384377,
1390
+ 0.009131456725299358,
1391
+ 0.00957438349723816,
1392
+ 0.04122224077582359,
1393
+ 0.03843001648783684,
1394
+ 0.046067025512456894,
1395
+ 0.49978113174438477
1396
+ ],
1397
+ "max": [
1398
+ 0.02499854564666748,
1399
+ 0.02499903365969658,
1400
+ 0.024999922141432762,
1401
+ 0.24974457919597626,
1402
+ 0.24997030198574066,
1403
+ 0.24999946355819702,
1404
+ 1.0
1405
+ ],
1406
+ "min": [
1407
+ -0.024999044835567474,
1408
+ -0.024999700486660004,
1409
+ -0.02499929815530777,
1410
+ -0.24993225932121277,
1411
+ -0.2499666064977646,
1412
+ -0.2499932497739792,
1413
+ 0.0
1414
+ ],
1415
+ "q01": [
1416
+ -0.019992006458342076,
1417
+ -0.02415412735193968,
1418
+ -0.022941758055239916,
1419
+ -0.11085530579090118,
1420
+ -0.12024572037160397,
1421
+ -0.13314770206809043,
1422
+ 0.0
1423
+ ],
1424
+ "q99": [
1425
+ 0.022886231057345868,
1426
+ 0.022358838934451335,
1427
+ 0.02410089675337076,
1428
+ 0.12370114490389822,
1429
+ 0.11323311634361738,
1430
+ 0.18474749639630164,
1431
+ 1.0
1432
+ ],
1433
+ "mask": [
1434
+ true,
1435
+ true,
1436
+ true,
1437
+ true,
1438
+ true,
1439
+ true,
1440
+ false
1441
+ ]
1442
+ },
1443
+ "proprio": {
1444
+ "mean": [
1445
+ 0.0,
1446
+ 0.0,
1447
+ 0.0,
1448
+ 0.0,
1449
+ 0.0,
1450
+ 0.0,
1451
+ 0.0
1452
+ ],
1453
+ "std": [
1454
+ 0.0,
1455
+ 0.0,
1456
+ 0.0,
1457
+ 0.0,
1458
+ 0.0,
1459
+ 0.0,
1460
+ 0.0
1461
+ ],
1462
+ "max": [
1463
+ 0.0,
1464
+ 0.0,
1465
+ 0.0,
1466
+ 0.0,
1467
+ 0.0,
1468
+ 0.0,
1469
+ 0.0
1470
+ ],
1471
+ "min": [
1472
+ 0.0,
1473
+ 0.0,
1474
+ 0.0,
1475
+ 0.0,
1476
+ 0.0,
1477
+ 0.0,
1478
+ 0.0
1479
+ ],
1480
+ "q01": [
1481
+ 0.0,
1482
+ 0.0,
1483
+ 0.0,
1484
+ 0.0,
1485
+ 0.0,
1486
+ 0.0,
1487
+ 0.0
1488
+ ],
1489
+ "q99": [
1490
+ 0.0,
1491
+ 0.0,
1492
+ 0.0,
1493
+ 0.0,
1494
+ 0.0,
1495
+ 0.0,
1496
+ 0.0
1497
+ ]
1498
+ },
1499
+ "num_transitions": 358234,
1500
+ "num_trajectories": 570
1501
+ },
1502
+ "austin_buds_dataset_converted_externally_to_rlds/0.1.0": {
1503
+ "action": {
1504
+ "mean": [
1505
+ -0.07678329944610596,
1506
+ 0.0036849123425781727,
1507
+ 0.05644941329956055,
1508
+ 0.0,
1509
+ 0.0,
1510
+ 0.0,
1511
+ 0.3510494828224182
1512
+ ],
1513
+ "std": [
1514
+ 0.6367746591567993,
1515
+ 0.3788914680480957,
1516
+ 0.47796377539634705,
1517
+ 0.0,
1518
+ 0.0,
1519
+ 0.0,
1520
+ 0.4772108495235443
1521
+ ],
1522
+ "max": [
1523
+ 1.0,
1524
+ 1.0,
1525
+ 1.0,
1526
+ 0.0,
1527
+ 0.0,
1528
+ 0.0,
1529
+ 1.0
1530
+ ],
1531
+ "min": [
1532
+ -1.0,
1533
+ -1.0,
1534
+ -1.0,
1535
+ 0.0,
1536
+ 0.0,
1537
+ 0.0,
1538
+ 0.0
1539
+ ],
1540
+ "q01": [
1541
+ -1.0,
1542
+ -0.9599999785423279,
1543
+ -0.8714285492897034,
1544
+ 0.0,
1545
+ 0.0,
1546
+ 0.0,
1547
+ 0.0
1548
+ ],
1549
+ "q99": [
1550
+ 1.0,
1551
+ 0.8600000143051147,
1552
+ 1.0,
1553
+ 0.0,
1554
+ 0.0,
1555
+ 0.0,
1556
+ 1.0
1557
+ ],
1558
+ "mask": [
1559
+ true,
1560
+ true,
1561
+ true,
1562
+ true,
1563
+ true,
1564
+ true,
1565
+ false
1566
+ ]
1567
+ },
1568
+ "proprio": {
1569
+ "mean": [
1570
+ 0.0,
1571
+ 0.0,
1572
+ 0.0,
1573
+ 0.0,
1574
+ 0.0,
1575
+ 0.0,
1576
+ 0.0
1577
+ ],
1578
+ "std": [
1579
+ 0.0,
1580
+ 0.0,
1581
+ 0.0,
1582
+ 0.0,
1583
+ 0.0,
1584
+ 0.0,
1585
+ 0.0
1586
+ ],
1587
+ "max": [
1588
+ 0.0,
1589
+ 0.0,
1590
+ 0.0,
1591
+ 0.0,
1592
+ 0.0,
1593
+ 0.0,
1594
+ 0.0
1595
+ ],
1596
+ "min": [
1597
+ 0.0,
1598
+ 0.0,
1599
+ 0.0,
1600
+ 0.0,
1601
+ 0.0,
1602
+ 0.0,
1603
+ 0.0
1604
+ ],
1605
+ "q01": [
1606
+ 0.0,
1607
+ 0.0,
1608
+ 0.0,
1609
+ 0.0,
1610
+ 0.0,
1611
+ 0.0,
1612
+ 0.0
1613
+ ],
1614
+ "q99": [
1615
+ 0.0,
1616
+ 0.0,
1617
+ 0.0,
1618
+ 0.0,
1619
+ 0.0,
1620
+ 0.0,
1621
+ 0.0
1622
+ ]
1623
+ },
1624
+ "num_transitions": 34112,
1625
+ "num_trajectories": 50
1626
+ },
1627
+ "nyu_franka_play_dataset_converted_externally_to_rlds/0.1.0": {
1628
+ "action": {
1629
+ "mean": [
1630
+ 0.0010219910182058811,
1631
+ -0.00012002632865915075,
1632
+ 0.00032894135802052915,
1633
+ 0.0015034276293590665,
1634
+ -0.002198528265580535,
1635
+ -0.0016632305923849344,
1636
+ 0.7230083346366882
1637
+ ],
1638
+ "std": [
1639
+ 0.013274150900542736,
1640
+ 0.013215919025242329,
1641
+ 0.01282210648059845,
1642
+ 0.27324533462524414,
1643
+ 0.05702253058552742,
1644
+ 0.03917279839515686,
1645
+ 0.44753193855285645
1646
+ ],
1647
+ "max": [
1648
+ 0.06424188613891602,
1649
+ 0.07027634978294373,
1650
+ 0.06129661202430725,
1651
+ 6.281067848205566,
1652
+ 0.1967729926109314,
1653
+ 0.26377415657043457,
1654
+ 1.0
1655
+ ],
1656
+ "min": [
1657
+ -0.05952230095863342,
1658
+ -0.07232445478439331,
1659
+ -0.06730806827545166,
1660
+ -6.278434753417969,
1661
+ -0.21479034423828125,
1662
+ -0.3627619743347168,
1663
+ 0.0
1664
+ ],
1665
+ "q01": [
1666
+ -0.03199600875377655,
1667
+ -0.032861671447753905,
1668
+ -0.03368805110454559,
1669
+ -0.12080862045288086,
1670
+ -0.12175218224525451,
1671
+ -0.11370223641395569,
1672
+ 0.0
1673
+ ],
1674
+ "q99": [
1675
+ 0.03101520001888276,
1676
+ 0.0373908892273903,
1677
+ 0.03646374464035038,
1678
+ 0.11764093399047852,
1679
+ 0.1258920183777809,
1680
+ 0.09366151213645942,
1681
+ 1.0
1682
+ ],
1683
+ "mask": [
1684
+ true,
1685
+ true,
1686
+ true,
1687
+ true,
1688
+ true,
1689
+ true,
1690
+ false
1691
+ ]
1692
+ },
1693
+ "proprio": {
1694
+ "mean": [
1695
+ 0.0,
1696
+ 0.0,
1697
+ 0.0,
1698
+ 0.0,
1699
+ 0.0,
1700
+ 0.0,
1701
+ 0.0
1702
+ ],
1703
+ "std": [
1704
+ 0.0,
1705
+ 0.0,
1706
+ 0.0,
1707
+ 0.0,
1708
+ 0.0,
1709
+ 0.0,
1710
+ 0.0
1711
+ ],
1712
+ "max": [
1713
+ 0.0,
1714
+ 0.0,
1715
+ 0.0,
1716
+ 0.0,
1717
+ 0.0,
1718
+ 0.0,
1719
+ 0.0
1720
+ ],
1721
+ "min": [
1722
+ 0.0,
1723
+ 0.0,
1724
+ 0.0,
1725
+ 0.0,
1726
+ 0.0,
1727
+ 0.0,
1728
+ 0.0
1729
+ ],
1730
+ "q01": [
1731
+ 0.0,
1732
+ 0.0,
1733
+ 0.0,
1734
+ 0.0,
1735
+ 0.0,
1736
+ 0.0,
1737
+ 0.0
1738
+ ],
1739
+ "q99": [
1740
+ 0.0,
1741
+ 0.0,
1742
+ 0.0,
1743
+ 0.0,
1744
+ 0.0,
1745
+ 0.0,
1746
+ 0.0
1747
+ ]
1748
+ },
1749
+ "num_transitions": 44875,
1750
+ "num_trajectories": 456
1751
+ },
1752
+ "furniture_bench_dataset_converted_externally_to_rlds/0.1.0": {
1753
+ "action": {
1754
+ "mean": [
1755
+ 0.0001461071806261316,
1756
+ 0.0010830992832779884,
1757
+ 0.0006224963581189513,
1758
+ -0.0033032014034688473,
1759
+ -0.002688060747459531,
1760
+ 0.018242614343762398,
1761
+ 0.48854944109916687
1762
+ ],
1763
+ "std": [
1764
+ 0.016107233241200447,
1765
+ 0.014891570433974266,
1766
+ 0.014014236629009247,
1767
+ 0.05827433615922928,
1768
+ 0.11417083442211151,
1769
+ 0.33479660749435425,
1770
+ 0.4999157190322876
1771
+ ],
1772
+ "max": [
1773
+ 0.10000000149011612,
1774
+ 0.10000000149011612,
1775
+ 0.10000000149011612,
1776
+ 0.8651833534240723,
1777
+ 1.0909736156463623,
1778
+ 2.863185405731201,
1779
+ 1.0
1780
+ ],
1781
+ "min": [
1782
+ -0.10495579987764359,
1783
+ -0.10939455777406693,
1784
+ -0.10000000149011612,
1785
+ -0.971906840801239,
1786
+ -1.0475432872772217,
1787
+ -3.06000018119812,
1788
+ 0.0
1789
+ ],
1790
+ "q01": [
1791
+ -0.053988199681043625,
1792
+ -0.05049169331789017,
1793
+ -0.032499241530895236,
1794
+ -0.1953887003660202,
1795
+ -0.41674559473991396,
1796
+ -0.8886768388748169,
1797
+ 0.0
1798
+ ],
1799
+ "q99": [
1800
+ 0.05414841488003723,
1801
+ 0.04965164884924884,
1802
+ 0.060055799782276154,
1803
+ 0.18231668293476103,
1804
+ 0.39867786407470646,
1805
+ 0.8772023963928218,
1806
+ 1.0
1807
+ ],
1808
+ "mask": [
1809
+ true,
1810
+ true,
1811
+ true,
1812
+ true,
1813
+ true,
1814
+ true,
1815
+ false
1816
+ ]
1817
+ },
1818
+ "proprio": {
1819
+ "mean": [
1820
+ 0.0,
1821
+ 0.0,
1822
+ 0.0,
1823
+ 0.0,
1824
+ 0.0,
1825
+ 0.0,
1826
+ 0.0
1827
+ ],
1828
+ "std": [
1829
+ 0.0,
1830
+ 0.0,
1831
+ 0.0,
1832
+ 0.0,
1833
+ 0.0,
1834
+ 0.0,
1835
+ 0.0
1836
+ ],
1837
+ "max": [
1838
+ 0.0,
1839
+ 0.0,
1840
+ 0.0,
1841
+ 0.0,
1842
+ 0.0,
1843
+ 0.0,
1844
+ 0.0
1845
+ ],
1846
+ "min": [
1847
+ 0.0,
1848
+ 0.0,
1849
+ 0.0,
1850
+ 0.0,
1851
+ 0.0,
1852
+ 0.0,
1853
+ 0.0
1854
+ ],
1855
+ "q01": [
1856
+ 0.0,
1857
+ 0.0,
1858
+ 0.0,
1859
+ 0.0,
1860
+ 0.0,
1861
+ 0.0,
1862
+ 0.0
1863
+ ],
1864
+ "q99": [
1865
+ 0.0,
1866
+ 0.0,
1867
+ 0.0,
1868
+ 0.0,
1869
+ 0.0,
1870
+ 0.0,
1871
+ 0.0
1872
+ ]
1873
+ },
1874
+ "num_transitions": 3948057,
1875
+ "num_trajectories": 5100
1876
+ },
1877
+ "ucsd_kitchen_dataset_converted_externally_to_rlds/0.1.0": {
1878
+ "action": {
1879
+ "mean": [
1880
+ 410.375732421875,
1881
+ 116.9518814086914,
1882
+ 192.35031127929688,
1883
+ -121.22441864013672,
1884
+ -33.84892654418945,
1885
+ 50.016136169433594,
1886
+ 0.741813600063324
1887
+ ],
1888
+ "std": [
1889
+ 122.81488037109375,
1890
+ 108.80094909667969,
1891
+ 130.30345153808594,
1892
+ 116.2820053100586,
1893
+ 27.62191390991211,
1894
+ 41.02091979980469,
1895
+ 0.4376337230205536
1896
+ ],
1897
+ "max": [
1898
+ 678.0,
1899
+ 400.0,
1900
+ 507.0,
1901
+ 180.00001525878906,
1902
+ 6.000013828277588,
1903
+ 116.99998474121094,
1904
+ 1.0
1905
+ ],
1906
+ "min": [
1907
+ 172.0,
1908
+ -166.0,
1909
+ -99.99999237060547,
1910
+ -180.00001525878906,
1911
+ -89.0,
1912
+ -96.00010681152344,
1913
+ 0.0
1914
+ ],
1915
+ "q01": [
1916
+ 200.00001052856445,
1917
+ -102.31004211425781,
1918
+ -94.99993370056153,
1919
+ -180.00001525878906,
1920
+ -88.00001525878906,
1921
+ -38.999977111816406,
1922
+ 0.0
1923
+ ],
1924
+ "q99": [
1925
+ 637.0,
1926
+ 368.30999999999995,
1927
+ 493.0,
1928
+ 180.00001525878906,
1929
+ 0.999983012676239,
1930
+ 105.00001525878906,
1931
+ 1.0
1932
+ ],
1933
+ "mask": [
1934
+ true,
1935
+ true,
1936
+ true,
1937
+ true,
1938
+ true,
1939
+ true,
1940
+ false
1941
+ ]
1942
+ },
1943
+ "proprio": {
1944
+ "mean": [
1945
+ 0.0,
1946
+ 0.0,
1947
+ 0.0,
1948
+ 0.0,
1949
+ 0.0,
1950
+ 0.0,
1951
+ 0.0
1952
+ ],
1953
+ "std": [
1954
+ 0.0,
1955
+ 0.0,
1956
+ 0.0,
1957
+ 0.0,
1958
+ 0.0,
1959
+ 0.0,
1960
+ 0.0
1961
+ ],
1962
+ "max": [
1963
+ 0.0,
1964
+ 0.0,
1965
+ 0.0,
1966
+ 0.0,
1967
+ 0.0,
1968
+ 0.0,
1969
+ 0.0
1970
+ ],
1971
+ "min": [
1972
+ 0.0,
1973
+ 0.0,
1974
+ 0.0,
1975
+ 0.0,
1976
+ 0.0,
1977
+ 0.0,
1978
+ 0.0
1979
+ ],
1980
+ "q01": [
1981
+ 0.0,
1982
+ 0.0,
1983
+ 0.0,
1984
+ 0.0,
1985
+ 0.0,
1986
+ 0.0,
1987
+ 0.0
1988
+ ],
1989
+ "q99": [
1990
+ 0.0,
1991
+ 0.0,
1992
+ 0.0,
1993
+ 0.0,
1994
+ 0.0,
1995
+ 0.0,
1996
+ 0.0
1997
+ ]
1998
+ },
1999
+ "num_transitions": 3970,
2000
+ "num_trajectories": 150
2001
+ },
2002
+ "austin_sailor_dataset_converted_externally_to_rlds/0.1.0": {
2003
+ "action": {
2004
+ "mean": [
2005
+ 0.011825386434793472,
2006
+ 0.0064610871486365795,
2007
+ 0.060236409306526184,
2008
+ 0.0,
2009
+ 0.0,
2010
+ 0.0016465834341943264,
2011
+ 0.5260950326919556
2012
+ ],
2013
+ "std": [
2014
+ 0.46348854899406433,
2015
+ 0.41240164637565613,
2016
+ 0.41186293959617615,
2017
+ 0.0,
2018
+ 0.0,
2019
+ 0.0578608438372612,
2020
+ 0.49893733859062195
2021
+ ],
2022
+ "max": [
2023
+ 1.0,
2024
+ 1.0,
2025
+ 1.0,
2026
+ 0.0,
2027
+ 0.0,
2028
+ 0.375,
2029
+ 1.0
2030
+ ],
2031
+ "min": [
2032
+ -1.0,
2033
+ -1.0,
2034
+ -1.0,
2035
+ 0.0,
2036
+ 0.0,
2037
+ -0.375,
2038
+ 0.0
2039
+ ],
2040
+ "q01": [
2041
+ -1.0,
2042
+ -0.9828571677207947,
2043
+ -0.6000000238418579,
2044
+ 0.0,
2045
+ 0.0,
2046
+ -0.17249999940395355,
2047
+ 0.0
2048
+ ],
2049
+ "q99": [
2050
+ 1.0,
2051
+ 0.9457142949104309,
2052
+ 1.0,
2053
+ 0.0,
2054
+ 0.0,
2055
+ 0.17892856895923615,
2056
+ 1.0
2057
+ ],
2058
+ "mask": [
2059
+ true,
2060
+ true,
2061
+ true,
2062
+ true,
2063
+ true,
2064
+ true,
2065
+ false
2066
+ ]
2067
+ },
2068
+ "proprio": {
2069
+ "mean": [
2070
+ 0.0,
2071
+ 0.0,
2072
+ 0.0,
2073
+ 0.0,
2074
+ 0.0,
2075
+ 0.0,
2076
+ 0.0
2077
+ ],
2078
+ "std": [
2079
+ 0.0,
2080
+ 0.0,
2081
+ 0.0,
2082
+ 0.0,
2083
+ 0.0,
2084
+ 0.0,
2085
+ 0.0
2086
+ ],
2087
+ "max": [
2088
+ 0.0,
2089
+ 0.0,
2090
+ 0.0,
2091
+ 0.0,
2092
+ 0.0,
2093
+ 0.0,
2094
+ 0.0
2095
+ ],
2096
+ "min": [
2097
+ 0.0,
2098
+ 0.0,
2099
+ 0.0,
2100
+ 0.0,
2101
+ 0.0,
2102
+ 0.0,
2103
+ 0.0
2104
+ ],
2105
+ "q01": [
2106
+ 0.0,
2107
+ 0.0,
2108
+ 0.0,
2109
+ 0.0,
2110
+ 0.0,
2111
+ 0.0,
2112
+ 0.0
2113
+ ],
2114
+ "q99": [
2115
+ 0.0,
2116
+ 0.0,
2117
+ 0.0,
2118
+ 0.0,
2119
+ 0.0,
2120
+ 0.0,
2121
+ 0.0
2122
+ ]
2123
+ },
2124
+ "num_transitions": 353094,
2125
+ "num_trajectories": 240
2126
+ },
2127
+ "austin_sirius_dataset_converted_externally_to_rlds/0.1.0": {
2128
+ "action": {
2129
+ "mean": [
2130
+ 0.077476866543293,
2131
+ 0.031955525279045105,
2132
+ 0.04244735836982727,
2133
+ 0.0,
2134
+ 0.0,
2135
+ -0.01603454165160656,
2136
+ 0.43260180950164795
2137
+ ],
2138
+ "std": [
2139
+ 0.3906330168247223,
2140
+ 0.2998153865337372,
2141
+ 0.2782270312309265,
2142
+ 0.0,
2143
+ 0.0,
2144
+ 0.08120641857385635,
2145
+ 0.49528202414512634
2146
+ ],
2147
+ "max": [
2148
+ 1.0002285242080688,
2149
+ 0.960608720779419,
2150
+ 1.105179786682129,
2151
+ 0.0,
2152
+ 0.0,
2153
+ 0.341785728931427,
2154
+ 1.0
2155
+ ],
2156
+ "min": [
2157
+ -1.0183025598526,
2158
+ -0.9800000190734863,
2159
+ -0.9774575233459473,
2160
+ 0.0,
2161
+ 0.0,
2162
+ -0.34607142210006714,
2163
+ 0.0
2164
+ ],
2165
+ "q01": [
2166
+ -0.780905865430832,
2167
+ -0.5667179036140442,
2168
+ -0.5254343223571777,
2169
+ 0.0,
2170
+ 0.0,
2171
+ -0.28495091378688814,
2172
+ 0.0
2173
+ ],
2174
+ "q99": [
2175
+ 0.9569637751579284,
2176
+ 0.6971374487876891,
2177
+ 0.8124888157844541,
2178
+ 0.0,
2179
+ 0.0,
2180
+ 0.1971428543329239,
2181
+ 1.0
2182
+ ],
2183
+ "mask": [
2184
+ true,
2185
+ true,
2186
+ true,
2187
+ true,
2188
+ true,
2189
+ true,
2190
+ false
2191
+ ]
2192
+ },
2193
+ "proprio": {
2194
+ "mean": [
2195
+ 0.0,
2196
+ 0.0,
2197
+ 0.0,
2198
+ 0.0,
2199
+ 0.0,
2200
+ 0.0,
2201
+ 0.0
2202
+ ],
2203
+ "std": [
2204
+ 0.0,
2205
+ 0.0,
2206
+ 0.0,
2207
+ 0.0,
2208
+ 0.0,
2209
+ 0.0,
2210
+ 0.0
2211
+ ],
2212
+ "max": [
2213
+ 0.0,
2214
+ 0.0,
2215
+ 0.0,
2216
+ 0.0,
2217
+ 0.0,
2218
+ 0.0,
2219
+ 0.0
2220
+ ],
2221
+ "min": [
2222
+ 0.0,
2223
+ 0.0,
2224
+ 0.0,
2225
+ 0.0,
2226
+ 0.0,
2227
+ 0.0,
2228
+ 0.0
2229
+ ],
2230
+ "q01": [
2231
+ 0.0,
2232
+ 0.0,
2233
+ 0.0,
2234
+ 0.0,
2235
+ 0.0,
2236
+ 0.0,
2237
+ 0.0
2238
+ ],
2239
+ "q99": [
2240
+ 0.0,
2241
+ 0.0,
2242
+ 0.0,
2243
+ 0.0,
2244
+ 0.0,
2245
+ 0.0,
2246
+ 0.0
2247
+ ]
2248
+ },
2249
+ "num_transitions": 279939,
2250
+ "num_trajectories": 559
2251
+ },
2252
+ "dlr_edan_shared_control_converted_externally_to_rlds/0.1.0": {
2253
+ "action": {
2254
+ "mean": [
2255
+ 0.0066478196531534195,
2256
+ -0.0007657355745323002,
2257
+ 0.006522845011204481,
2258
+ 0.0011679773451760411,
2259
+ -0.006395624950528145,
2260
+ -0.011903021484613419,
2261
+ 0.6985887289047241
2262
+ ],
2263
+ "std": [
2264
+ 0.021393585950136185,
2265
+ 0.018142299726605415,
2266
+ 0.03374377265572548,
2267
+ 0.01743541844189167,
2268
+ 0.03394372761249542,
2269
+ 0.04641878604888916,
2270
+ 0.45885783433914185
2271
+ ],
2272
+ "max": [
2273
+ 0.18991442024707794,
2274
+ 0.0739002525806427,
2275
+ 0.18064819276332855,
2276
+ 0.0866486132144928,
2277
+ 0.13464981317520142,
2278
+ 0.16910280287265778,
2279
+ 1.0
2280
+ ],
2281
+ "min": [
2282
+ -0.10054297000169754,
2283
+ -0.08427435159683228,
2284
+ -0.13533438742160797,
2285
+ -0.17556548118591309,
2286
+ -0.18485672771930695,
2287
+ -0.2680685818195343,
2288
+ 0.0
2289
+ ],
2290
+ "q01": [
2291
+ -0.02987122368067503,
2292
+ -0.06013262912631035,
2293
+ -0.08286409199237824,
2294
+ -0.05924444157630205,
2295
+ -0.15986866518855095,
2296
+ -0.15636983573436739,
2297
+ 0.0
2298
+ ],
2299
+ "q99": [
2300
+ 0.08832092039287087,
2301
+ 0.042126184627413736,
2302
+ 0.11311905644834042,
2303
+ 0.0643695573508739,
2304
+ 0.03941855944693088,
2305
+ 0.156646853685379,
2306
+ 1.0
2307
+ ],
2308
+ "mask": [
2309
+ true,
2310
+ true,
2311
+ true,
2312
+ true,
2313
+ true,
2314
+ true,
2315
+ false
2316
+ ]
2317
+ },
2318
+ "proprio": {
2319
+ "mean": [
2320
+ 0.0,
2321
+ 0.0,
2322
+ 0.0,
2323
+ 0.0,
2324
+ 0.0,
2325
+ 0.0,
2326
+ 0.0
2327
+ ],
2328
+ "std": [
2329
+ 0.0,
2330
+ 0.0,
2331
+ 0.0,
2332
+ 0.0,
2333
+ 0.0,
2334
+ 0.0,
2335
+ 0.0
2336
+ ],
2337
+ "max": [
2338
+ 0.0,
2339
+ 0.0,
2340
+ 0.0,
2341
+ 0.0,
2342
+ 0.0,
2343
+ 0.0,
2344
+ 0.0
2345
+ ],
2346
+ "min": [
2347
+ 0.0,
2348
+ 0.0,
2349
+ 0.0,
2350
+ 0.0,
2351
+ 0.0,
2352
+ 0.0,
2353
+ 0.0
2354
+ ],
2355
+ "q01": [
2356
+ 0.0,
2357
+ 0.0,
2358
+ 0.0,
2359
+ 0.0,
2360
+ 0.0,
2361
+ 0.0,
2362
+ 0.0
2363
+ ],
2364
+ "q99": [
2365
+ 0.0,
2366
+ 0.0,
2367
+ 0.0,
2368
+ 0.0,
2369
+ 0.0,
2370
+ 0.0,
2371
+ 0.0
2372
+ ]
2373
+ },
2374
+ "num_transitions": 8928,
2375
+ "num_trajectories": 104
2376
+ },
2377
+ "iamlab_cmu_pickup_insert_converted_externally_to_rlds/0.1.0": {
2378
+ "action": {
2379
+ "mean": [
2380
+ 0.5274373292922974,
2381
+ 0.028582017868757248,
2382
+ 0.18712472915649414,
2383
+ 1.2339569330215454,
2384
+ 0.03226622939109802,
2385
+ -1.4199472665786743,
2386
+ 0.5550631880760193
2387
+ ],
2388
+ "std": [
2389
+ 0.08108346909284592,
2390
+ 0.1116756722331047,
2391
+ 0.07747555524110794,
2392
+ 2.8737244606018066,
2393
+ 0.02774704433977604,
2394
+ 2.7678685188293457,
2395
+ 0.4969509243965149
2396
+ ],
2397
+ "max": [
2398
+ 0.6634981632232666,
2399
+ 0.23428471386432648,
2400
+ 0.4308285415172577,
2401
+ 3.1415927410125732,
2402
+ 0.13647015392780304,
2403
+ 3.141592502593994,
2404
+ 1.0
2405
+ ],
2406
+ "min": [
2407
+ 0.3071657121181488,
2408
+ -0.29754969477653503,
2409
+ 0.06578229367733002,
2410
+ -3.1415927410125732,
2411
+ -0.04584203287959099,
2412
+ -3.141592502593994,
2413
+ 0.0
2414
+ ],
2415
+ "q01": [
2416
+ 0.3148897051811218,
2417
+ -0.20317550599575043,
2418
+ 0.06785467118024827,
2419
+ -3.140952730178833,
2420
+ -0.029743434861302376,
2421
+ -3.141091251373291,
2422
+ 0.0
2423
+ ],
2424
+ "q99": [
2425
+ 0.6472805738449097,
2426
+ 0.20846802592277527,
2427
+ 0.36855655312538155,
2428
+ 3.1409926891326903,
2429
+ 0.11424950212240226,
2430
+ 3.1410969257354737,
2431
+ 1.0
2432
+ ],
2433
+ "mask": [
2434
+ true,
2435
+ true,
2436
+ true,
2437
+ true,
2438
+ true,
2439
+ true,
2440
+ false
2441
+ ]
2442
+ },
2443
+ "proprio": {
2444
+ "mean": [
2445
+ 0.0,
2446
+ 0.0,
2447
+ 0.0,
2448
+ 0.0,
2449
+ 0.0,
2450
+ 0.0,
2451
+ 0.0
2452
+ ],
2453
+ "std": [
2454
+ 0.0,
2455
+ 0.0,
2456
+ 0.0,
2457
+ 0.0,
2458
+ 0.0,
2459
+ 0.0,
2460
+ 0.0
2461
+ ],
2462
+ "max": [
2463
+ 0.0,
2464
+ 0.0,
2465
+ 0.0,
2466
+ 0.0,
2467
+ 0.0,
2468
+ 0.0,
2469
+ 0.0
2470
+ ],
2471
+ "min": [
2472
+ 0.0,
2473
+ 0.0,
2474
+ 0.0,
2475
+ 0.0,
2476
+ 0.0,
2477
+ 0.0,
2478
+ 0.0
2479
+ ],
2480
+ "q01": [
2481
+ 0.0,
2482
+ 0.0,
2483
+ 0.0,
2484
+ 0.0,
2485
+ 0.0,
2486
+ 0.0,
2487
+ 0.0
2488
+ ],
2489
+ "q99": [
2490
+ 0.0,
2491
+ 0.0,
2492
+ 0.0,
2493
+ 0.0,
2494
+ 0.0,
2495
+ 0.0,
2496
+ 0.0
2497
+ ]
2498
+ },
2499
+ "num_transitions": 146241,
2500
+ "num_trajectories": 631
2501
+ },
2502
+ "utaustin_mutex/0.1.0": {
2503
+ "action": {
2504
+ "mean": [
2505
+ 0.06176406517624855,
2506
+ -0.005005490034818649,
2507
+ 0.10216782987117767,
2508
+ -0.03314131125807762,
2509
+ 0.013895022682845592,
2510
+ -0.011317633092403412,
2511
+ 0.5038976669311523
2512
+ ],
2513
+ "std": [
2514
+ 0.187501460313797,
2515
+ 0.4468473196029663,
2516
+ 0.3792876601219177,
2517
+ 0.14097853004932404,
2518
+ 0.06453699618577957,
2519
+ 0.11765265464782715,
2520
+ 0.501045286655426
2521
+ ],
2522
+ "max": [
2523
+ 1.0,
2524
+ 1.0,
2525
+ 1.0,
2526
+ 0.375,
2527
+ 0.375,
2528
+ 0.375,
2529
+ 1.0
2530
+ ],
2531
+ "min": [
2532
+ -1.0,
2533
+ -1.0,
2534
+ -1.0,
2535
+ -0.375,
2536
+ -0.375,
2537
+ -0.375,
2538
+ 0.0
2539
+ ],
2540
+ "q01": [
2541
+ -0.4285714328289032,
2542
+ -0.9800000190734863,
2543
+ -0.5571428537368774,
2544
+ -0.375,
2545
+ -0.15642857551574707,
2546
+ -0.335357129573822,
2547
+ 0.0
2548
+ ],
2549
+ "q99": [
2550
+ 0.5914285778999329,
2551
+ 0.9714285731315613,
2552
+ 1.0,
2553
+ 0.3278571367263794,
2554
+ 0.207857146859169,
2555
+ 0.25607141852378845,
2556
+ 1.0
2557
+ ],
2558
+ "mask": [
2559
+ true,
2560
+ true,
2561
+ true,
2562
+ true,
2563
+ true,
2564
+ true,
2565
+ false
2566
+ ]
2567
+ },
2568
+ "proprio": {
2569
+ "mean": [
2570
+ 0.0,
2571
+ 0.0,
2572
+ 0.0,
2573
+ 0.0,
2574
+ 0.0,
2575
+ 0.0,
2576
+ 0.0
2577
+ ],
2578
+ "std": [
2579
+ 0.0,
2580
+ 0.0,
2581
+ 0.0,
2582
+ 0.0,
2583
+ 0.0,
2584
+ 0.0,
2585
+ 0.0
2586
+ ],
2587
+ "max": [
2588
+ 0.0,
2589
+ 0.0,
2590
+ 0.0,
2591
+ 0.0,
2592
+ 0.0,
2593
+ 0.0,
2594
+ 0.0
2595
+ ],
2596
+ "min": [
2597
+ 0.0,
2598
+ 0.0,
2599
+ 0.0,
2600
+ 0.0,
2601
+ 0.0,
2602
+ 0.0,
2603
+ 0.0
2604
+ ],
2605
+ "q01": [
2606
+ 0.0,
2607
+ 0.0,
2608
+ 0.0,
2609
+ 0.0,
2610
+ 0.0,
2611
+ 0.0,
2612
+ 0.0
2613
+ ],
2614
+ "q99": [
2615
+ 0.0,
2616
+ 0.0,
2617
+ 0.0,
2618
+ 0.0,
2619
+ 0.0,
2620
+ 0.0,
2621
+ 0.0
2622
+ ]
2623
+ },
2624
+ "num_transitions": 361883,
2625
+ "num_trajectories": 1500
2626
+ },
2627
+ "berkeley_fanuc_manipulation/0.1.0": {
2628
+ "action": {
2629
+ "mean": [
2630
+ 0.0007744057802483439,
2631
+ -0.00031240080716088414,
2632
+ -0.0015001941937953234,
2633
+ -0.0007515158504247665,
2634
+ -0.00015832878125365824,
2635
+ 0.00014327642566058785,
2636
+ 0.699295699596405
2637
+ ],
2638
+ "std": [
2639
+ 0.0034070133697241545,
2640
+ 0.00499219074845314,
2641
+ 0.005344326142221689,
2642
+ 0.007599010597914457,
2643
+ 0.004081932827830315,
2644
+ 0.008568963967263699,
2645
+ 0.45868709683418274
2646
+ ],
2647
+ "max": [
2648
+ 0.009999999776482582,
2649
+ 0.009999999776482582,
2650
+ 0.009999999776482582,
2651
+ 0.03490658476948738,
2652
+ 0.03490658476948738,
2653
+ 0.03490658476948738,
2654
+ 1.0
2655
+ ],
2656
+ "min": [
2657
+ -0.009999999776482582,
2658
+ -0.009999999776482582,
2659
+ -0.009999999776482582,
2660
+ -0.03490658476948738,
2661
+ -0.03490658476948738,
2662
+ -0.03490658476948738,
2663
+ 0.0
2664
+ ],
2665
+ "q01": [
2666
+ -0.009999999776482582,
2667
+ -0.009999999776482582,
2668
+ -0.009999999776482582,
2669
+ -0.03490658476948738,
2670
+ 0.0,
2671
+ -0.03490658476948738,
2672
+ 0.0
2673
+ ],
2674
+ "q99": [
2675
+ 0.009999999776482582,
2676
+ 0.009999999776482582,
2677
+ 0.009999999776482582,
2678
+ 0.03490658476948738,
2679
+ 0.0,
2680
+ 0.03490658476948738,
2681
+ 1.0
2682
+ ],
2683
+ "mask": [
2684
+ true,
2685
+ true,
2686
+ true,
2687
+ true,
2688
+ true,
2689
+ true,
2690
+ false
2691
+ ]
2692
+ },
2693
+ "proprio": {
2694
+ "mean": [
2695
+ 0.0,
2696
+ 0.0,
2697
+ 0.0,
2698
+ 0.0,
2699
+ 0.0,
2700
+ 0.0,
2701
+ 0.0
2702
+ ],
2703
+ "std": [
2704
+ 0.0,
2705
+ 0.0,
2706
+ 0.0,
2707
+ 0.0,
2708
+ 0.0,
2709
+ 0.0,
2710
+ 0.0
2711
+ ],
2712
+ "max": [
2713
+ 0.0,
2714
+ 0.0,
2715
+ 0.0,
2716
+ 0.0,
2717
+ 0.0,
2718
+ 0.0,
2719
+ 0.0
2720
+ ],
2721
+ "min": [
2722
+ 0.0,
2723
+ 0.0,
2724
+ 0.0,
2725
+ 0.0,
2726
+ 0.0,
2727
+ 0.0,
2728
+ 0.0
2729
+ ],
2730
+ "q01": [
2731
+ 0.0,
2732
+ 0.0,
2733
+ 0.0,
2734
+ 0.0,
2735
+ 0.0,
2736
+ 0.0,
2737
+ 0.0
2738
+ ],
2739
+ "q99": [
2740
+ 0.0,
2741
+ 0.0,
2742
+ 0.0,
2743
+ 0.0,
2744
+ 0.0,
2745
+ 0.0,
2746
+ 0.0
2747
+ ]
2748
+ },
2749
+ "num_transitions": 62613,
2750
+ "num_trajectories": 415
2751
+ },
2752
+ "cmu_stretch/0.1.0": {
2753
+ "action": {
2754
+ "mean": [
2755
+ 0.0003630445571616292,
2756
+ 0.0,
2757
+ 0.0016466928645968437,
2758
+ 0.0,
2759
+ 0.0,
2760
+ 0.0,
2761
+ 0.3987048268318176
2762
+ ],
2763
+ "std": [
2764
+ 0.004081855062395334,
2765
+ 0.0,
2766
+ 0.003774340031668544,
2767
+ 0.0,
2768
+ 0.0,
2769
+ 0.0,
2770
+ 0.489638090133667
2771
+ ],
2772
+ "max": [
2773
+ 0.02338407188653946,
2774
+ 0.0,
2775
+ 0.023404927924275398,
2776
+ 0.0,
2777
+ 0.0,
2778
+ 0.0,
2779
+ 1.0
2780
+ ],
2781
+ "min": [
2782
+ -0.019353797659277916,
2783
+ 0.0,
2784
+ -0.02019215188920498,
2785
+ 0.0,
2786
+ 0.0,
2787
+ 0.0,
2788
+ 0.0
2789
+ ],
2790
+ "q01": [
2791
+ -0.011175686959177256,
2792
+ 0.0,
2793
+ -0.0032206363626755773,
2794
+ 0.0,
2795
+ 0.0,
2796
+ 0.0,
2797
+ 0.0
2798
+ ],
2799
+ "q99": [
2800
+ 0.014501785952597848,
2801
+ 0.0,
2802
+ 0.015056106168776728,
2803
+ 0.0,
2804
+ 0.0,
2805
+ 0.0,
2806
+ 1.0
2807
+ ],
2808
+ "mask": [
2809
+ true,
2810
+ true,
2811
+ true,
2812
+ true,
2813
+ true,
2814
+ true,
2815
+ false
2816
+ ]
2817
+ },
2818
+ "proprio": {
2819
+ "mean": [
2820
+ 0.0,
2821
+ 0.0,
2822
+ 0.0,
2823
+ 0.0,
2824
+ 0.0,
2825
+ 0.0,
2826
+ 0.0
2827
+ ],
2828
+ "std": [
2829
+ 0.0,
2830
+ 0.0,
2831
+ 0.0,
2832
+ 0.0,
2833
+ 0.0,
2834
+ 0.0,
2835
+ 0.0
2836
+ ],
2837
+ "max": [
2838
+ 0.0,
2839
+ 0.0,
2840
+ 0.0,
2841
+ 0.0,
2842
+ 0.0,
2843
+ 0.0,
2844
+ 0.0
2845
+ ],
2846
+ "min": [
2847
+ 0.0,
2848
+ 0.0,
2849
+ 0.0,
2850
+ 0.0,
2851
+ 0.0,
2852
+ 0.0,
2853
+ 0.0
2854
+ ],
2855
+ "q01": [
2856
+ 0.0,
2857
+ 0.0,
2858
+ 0.0,
2859
+ 0.0,
2860
+ 0.0,
2861
+ 0.0,
2862
+ 0.0
2863
+ ],
2864
+ "q99": [
2865
+ 0.0,
2866
+ 0.0,
2867
+ 0.0,
2868
+ 0.0,
2869
+ 0.0,
2870
+ 0.0,
2871
+ 0.0
2872
+ ]
2873
+ },
2874
+ "num_transitions": 25016,
2875
+ "num_trajectories": 135
2876
+ },
2877
+ "bc_z/0.1.0": {
2878
+ "action": {
2879
+ "mean": [
2880
+ -0.009958645328879356,
2881
+ 0.0008958434336818755,
2882
+ 0.00499522453173995,
2883
+ 0.000297540333122015,
2884
+ -0.008734511211514473,
2885
+ -0.03068969026207924,
2886
+ 0.8344562649726868
2887
+ ],
2888
+ "std": [
2889
+ 0.030533093959093094,
2890
+ 0.0231416504830122,
2891
+ 0.020642085000872612,
2892
+ 0.04156165570020676,
2893
+ 0.04643021523952484,
2894
+ 0.07697845250368118,
2895
+ 0.36111101508140564
2896
+ ],
2897
+ "max": [
2898
+ 0.2165454924106598,
2899
+ 0.1251407265663147,
2900
+ 0.10772687941789627,
2901
+ 0.33544227480888367,
2902
+ 0.28117990493774414,
2903
+ 0.40614867210388184,
2904
+ 1.0
2905
+ ],
2906
+ "min": [
2907
+ -0.1677047461271286,
2908
+ -0.14630407094955444,
2909
+ -0.10066790133714676,
2910
+ -0.29421567916870117,
2911
+ -0.32101404666900635,
2912
+ -0.4635624885559082,
2913
+ 0.0
2914
+ ],
2915
+ "q01": [
2916
+ -0.09220654994249344,
2917
+ -0.06456145539879798,
2918
+ -0.049121275544166565,
2919
+ -0.11594625547528267,
2920
+ -0.14152548640966414,
2921
+ -0.2251061636209488,
2922
+ 0.0
2923
+ ],
2924
+ "q99": [
2925
+ 0.07628866866230968,
2926
+ 0.058019736707210584,
2927
+ 0.052540797740221024,
2928
+ 0.11740604028105736,
2929
+ 0.11703975558280955,
2930
+ 0.16729306846857078,
2931
+ 1.0
2932
+ ],
2933
+ "mask": [
2934
+ true,
2935
+ true,
2936
+ true,
2937
+ true,
2938
+ true,
2939
+ true,
2940
+ false
2941
+ ]
2942
+ },
2943
+ "proprio": {
2944
+ "mean": [
2945
+ 0.0,
2946
+ 0.0,
2947
+ 0.0,
2948
+ 0.0,
2949
+ 0.0,
2950
+ 0.0,
2951
+ 0.0
2952
+ ],
2953
+ "std": [
2954
+ 0.0,
2955
+ 0.0,
2956
+ 0.0,
2957
+ 0.0,
2958
+ 0.0,
2959
+ 0.0,
2960
+ 0.0
2961
+ ],
2962
+ "max": [
2963
+ 0.0,
2964
+ 0.0,
2965
+ 0.0,
2966
+ 0.0,
2967
+ 0.0,
2968
+ 0.0,
2969
+ 0.0
2970
+ ],
2971
+ "min": [
2972
+ 0.0,
2973
+ 0.0,
2974
+ 0.0,
2975
+ 0.0,
2976
+ 0.0,
2977
+ 0.0,
2978
+ 0.0
2979
+ ],
2980
+ "q01": [
2981
+ 0.0,
2982
+ 0.0,
2983
+ 0.0,
2984
+ 0.0,
2985
+ 0.0,
2986
+ 0.0,
2987
+ 0.0
2988
+ ],
2989
+ "q99": [
2990
+ 0.0,
2991
+ 0.0,
2992
+ 0.0,
2993
+ 0.0,
2994
+ 0.0,
2995
+ 0.0,
2996
+ 0.0
2997
+ ]
2998
+ },
2999
+ "num_transitions": 6015535,
3000
+ "num_trajectories": 43264
3001
+ },
3002
+ "fmb_dataset/1.0.0": {
3003
+ "action": {
3004
+ "mean": [
3005
+ 0.05902976542711258,
3006
+ -0.06476633995771408,
3007
+ -0.09787469357252121,
3008
+ 0.004325387068092823,
3009
+ 0.00028963759541511536,
3010
+ -0.04457257315516472,
3011
+ 0.7336440086364746
3012
+ ],
3013
+ "std": [
3014
+ 0.28809186816215515,
3015
+ 0.2820416986942291,
3016
+ 0.4626740515232086,
3017
+ 0.3266514539718628,
3018
+ 0.10842999070882797,
3019
+ 0.34400978684425354,
3020
+ 0.4435289800167084
3021
+ ],
3022
+ "max": [
3023
+ 1.399999976158142,
3024
+ 1.0,
3025
+ 1.399999976158142,
3026
+ 1.0,
3027
+ 1.0,
3028
+ 1.0,
3029
+ 1.0
3030
+ ],
3031
+ "min": [
3032
+ -1.399999976158142,
3033
+ -1.399999976158142,
3034
+ -1.0,
3035
+ -1.0,
3036
+ -1.0,
3037
+ -1.0,
3038
+ 0.0
3039
+ ],
3040
+ "q01": [
3041
+ -0.8257142901420593,
3042
+ -1.399999976158142,
3043
+ -1.0,
3044
+ -1.0,
3045
+ -0.3028571307659149,
3046
+ -1.0,
3047
+ 0.0
3048
+ ],
3049
+ "q99": [
3050
+ 1.0,
3051
+ 0.5257142782211304,
3052
+ 1.0,
3053
+ 1.0,
3054
+ 0.3400000035762787,
3055
+ 1.0,
3056
+ 1.0
3057
+ ],
3058
+ "mask": [
3059
+ true,
3060
+ true,
3061
+ true,
3062
+ true,
3063
+ true,
3064
+ true,
3065
+ false
3066
+ ]
3067
+ },
3068
+ "proprio": {
3069
+ "mean": [
3070
+ 0.0,
3071
+ 0.0,
3072
+ 0.0,
3073
+ 0.0,
3074
+ 0.0,
3075
+ 0.0,
3076
+ 0.0
3077
+ ],
3078
+ "std": [
3079
+ 0.0,
3080
+ 0.0,
3081
+ 0.0,
3082
+ 0.0,
3083
+ 0.0,
3084
+ 0.0,
3085
+ 0.0
3086
+ ],
3087
+ "max": [
3088
+ 0.0,
3089
+ 0.0,
3090
+ 0.0,
3091
+ 0.0,
3092
+ 0.0,
3093
+ 0.0,
3094
+ 0.0
3095
+ ],
3096
+ "min": [
3097
+ 0.0,
3098
+ 0.0,
3099
+ 0.0,
3100
+ 0.0,
3101
+ 0.0,
3102
+ 0.0,
3103
+ 0.0
3104
+ ],
3105
+ "q01": [
3106
+ 0.0,
3107
+ 0.0,
3108
+ 0.0,
3109
+ 0.0,
3110
+ 0.0,
3111
+ 0.0,
3112
+ 0.0
3113
+ ],
3114
+ "q99": [
3115
+ 0.0,
3116
+ 0.0,
3117
+ 0.0,
3118
+ 0.0,
3119
+ 0.0,
3120
+ 0.0,
3121
+ 0.0
3122
+ ]
3123
+ },
3124
+ "num_transitions": 1137459,
3125
+ "num_trajectories": 8612
3126
+ },
3127
+ "dobbe/0.0.1": {
3128
+ "action": {
3129
+ "mean": [
3130
+ -0.00011206958151888102,
3131
+ 0.0011229681549593806,
3132
+ -0.00010193959315074608,
3133
+ -7.37128357286565e-05,
3134
+ -0.0006753374473191798,
3135
+ -5.664441778208129e-05,
3136
+ 0.6318688988685608
3137
+ ],
3138
+ "std": [
3139
+ 0.042660679668188095,
3140
+ 0.04428431764245033,
3141
+ 0.12224890291690826,
3142
+ 0.005388470832258463,
3143
+ 0.011246936395764351,
3144
+ 0.006288259290158749,
3145
+ 0.3973240256309509
3146
+ ],
3147
+ "max": [
3148
+ 38.590423583984375,
3149
+ 17.932697296142578,
3150
+ 4.843764305114746,
3151
+ 1.4372116327285767,
3152
+ 0.4340403974056244,
3153
+ 1.2057193517684937,
3154
+ 0.9998947381973267
3155
+ ],
3156
+ "min": [
3157
+ -5.700923442840576,
3158
+ -21.605947494506836,
3159
+ -123.72489929199219,
3160
+ -1.7229845523834229,
3161
+ -0.4998578727245331,
3162
+ -0.8867913484573364,
3163
+ 1.4196479014572105e-06
3164
+ ],
3165
+ "q01": [
3166
+ -0.01119564864784479,
3167
+ -0.014266146533191203,
3168
+ -0.0071747214533388615,
3169
+ -0.009444301575422287,
3170
+ -0.03990109823644161,
3171
+ -0.017422311007976532,
3172
+ 4.003279136668425e-05
3173
+ ],
3174
+ "q99": [
3175
+ 0.01015154086053368,
3176
+ 0.017181577533483497,
3177
+ 0.007216989761218411,
3178
+ 0.010380979906767595,
3179
+ 0.03556173853576176,
3180
+ 0.018032474815845446,
3181
+ 0.9982578039169312
3182
+ ],
3183
+ "mask": [
3184
+ true,
3185
+ true,
3186
+ true,
3187
+ true,
3188
+ true,
3189
+ true,
3190
+ false
3191
+ ]
3192
+ },
3193
+ "proprio": {
3194
+ "mean": [
3195
+ 0.0,
3196
+ 0.0,
3197
+ 0.0,
3198
+ 0.0,
3199
+ 0.0,
3200
+ 0.0,
3201
+ 0.0
3202
+ ],
3203
+ "std": [
3204
+ 0.0,
3205
+ 0.0,
3206
+ 0.0,
3207
+ 0.0,
3208
+ 0.0,
3209
+ 0.0,
3210
+ 0.0
3211
+ ],
3212
+ "max": [
3213
+ 0.0,
3214
+ 0.0,
3215
+ 0.0,
3216
+ 0.0,
3217
+ 0.0,
3218
+ 0.0,
3219
+ 0.0
3220
+ ],
3221
+ "min": [
3222
+ 0.0,
3223
+ 0.0,
3224
+ 0.0,
3225
+ 0.0,
3226
+ 0.0,
3227
+ 0.0,
3228
+ 0.0
3229
+ ],
3230
+ "q01": [
3231
+ 0.0,
3232
+ 0.0,
3233
+ 0.0,
3234
+ 0.0,
3235
+ 0.0,
3236
+ 0.0,
3237
+ 0.0
3238
+ ],
3239
+ "q99": [
3240
+ 0.0,
3241
+ 0.0,
3242
+ 0.0,
3243
+ 0.0,
3244
+ 0.0,
3245
+ 0.0,
3246
+ 0.0
3247
+ ]
3248
+ },
3249
+ "num_transitions": 1139911,
3250
+ "num_trajectories": 5208
3251
+ },
3252
+ "droid/1.0.0": {
3253
+ "action": {
3254
+ "mean": [
3255
+ 0.027425529435276985,
3256
+ -0.0026820411439985037,
3257
+ 0.01595238223671913,
3258
+ 0.0035501928068697453,
3259
+ -0.030532635748386383,
3260
+ -0.006685464642941952,
3261
+ 0.5860344171524048
3262
+ ],
3263
+ "std": [
3264
+ 0.25387412309646606,
3265
+ 0.18426834046840668,
3266
+ 0.22532416880130768,
3267
+ 0.21757009625434875,
3268
+ 0.22572560608386993,
3269
+ 0.2867794930934906,
3270
+ 0.4287726879119873
3271
+ ],
3272
+ "max": [
3273
+ 0.9999998211860657,
3274
+ 0.999991774559021,
3275
+ 0.9999973177909851,
3276
+ 0.9999874830245972,
3277
+ 0.9999954104423523,
3278
+ 0.9999998807907104,
3279
+ 1.0
3280
+ ],
3281
+ "min": [
3282
+ -0.9999999403953552,
3283
+ -0.9999951124191284,
3284
+ -0.9999960660934448,
3285
+ -0.9999980330467224,
3286
+ -0.9999982118606567,
3287
+ -0.9999998807907104,
3288
+ 0.0
3289
+ ],
3290
+ "q01": [
3291
+ -0.7776297926902771,
3292
+ -0.5803514122962952,
3293
+ -0.5795090794563293,
3294
+ -0.6464047729969025,
3295
+ -0.7041108310222626,
3296
+ -0.8895104378461838,
3297
+ 0.0
3298
+ ],
3299
+ "q99": [
3300
+ 0.7597932070493698,
3301
+ 0.5726242214441299,
3302
+ 0.7351000607013702,
3303
+ 0.6705610305070877,
3304
+ 0.6464948207139969,
3305
+ 0.8897542208433151,
3306
+ 1.0
3307
+ ],
3308
+ "mask": [
3309
+ true,
3310
+ true,
3311
+ true,
3312
+ true,
3313
+ true,
3314
+ true,
3315
+ false
3316
+ ]
3317
+ },
3318
+ "proprio": {
3319
+ "mean": [
3320
+ 0.0,
3321
+ 0.0,
3322
+ 0.0,
3323
+ 0.0,
3324
+ 0.0,
3325
+ 0.0,
3326
+ 0.0
3327
+ ],
3328
+ "std": [
3329
+ 0.0,
3330
+ 0.0,
3331
+ 0.0,
3332
+ 0.0,
3333
+ 0.0,
3334
+ 0.0,
3335
+ 0.0
3336
+ ],
3337
+ "max": [
3338
+ 0.0,
3339
+ 0.0,
3340
+ 0.0,
3341
+ 0.0,
3342
+ 0.0,
3343
+ 0.0,
3344
+ 0.0
3345
+ ],
3346
+ "min": [
3347
+ 0.0,
3348
+ 0.0,
3349
+ 0.0,
3350
+ 0.0,
3351
+ 0.0,
3352
+ 0.0,
3353
+ 0.0
3354
+ ],
3355
+ "q01": [
3356
+ 0.0,
3357
+ 0.0,
3358
+ 0.0,
3359
+ 0.0,
3360
+ 0.0,
3361
+ 0.0,
3362
+ 0.0
3363
+ ],
3364
+ "q99": [
3365
+ 0.0,
3366
+ 0.0,
3367
+ 0.0,
3368
+ 0.0,
3369
+ 0.0,
3370
+ 0.0,
3371
+ 0.0
3372
+ ]
3373
+ },
3374
+ "num_transitions": 27044326,
3375
+ "num_trajectories": 92233
3376
+ },
3377
+ "rh20t_rlds/1.0.0": {
3378
+ "action": {
3379
+ "mean": [
3380
+ -5.332157638779582e+28,
3381
+ -1.5128827327837974e+29,
3382
+ -1.832736619079747e+28,
3383
+ 0.5735913515090942,
3384
+ -0.00847744569182396,
3385
+ -0.5566052198410034,
3386
+ 0.3186892569065094
3387
+ ],
3388
+ "std": [
3389
+ Infinity,
3390
+ Infinity,
3391
+ Infinity,
3392
+ 2.2581026554107666,
3393
+ 0.1548534482717514,
3394
+ 2.2581026554107666,
3395
+ 0.39917993545532227
3396
+ ],
3397
+ "max": [
3398
+ 7.582831568163597e+35,
3399
+ 7.557172735451728e+35,
3400
+ 2.2717764477020827e+27,
3401
+ 3.1415927410125732,
3402
+ 1.5116956233978271,
3403
+ 3.1415927410125732,
3404
+ 1.0
3405
+ ],
3406
+ "min": [
3407
+ -3.5543094244408723e+36,
3408
+ -8.723098019507117e+36,
3409
+ -9.648338287048974e+35,
3410
+ -3.1415927410125732,
3411
+ -1.5062522888183594,
3412
+ -3.1415927410125732,
3413
+ 0.0
3414
+ ],
3415
+ "q01": [
3416
+ 0.36028257966041566,
3417
+ -0.272584410905838,
3418
+ 0.005985925104469062,
3419
+ -3.1411514282226562,
3420
+ -0.5925320792198181,
3421
+ -3.1415159702301025,
3422
+ 0.0
3423
+ ],
3424
+ "q99": [
3425
+ 0.7534684538841248,
3426
+ 0.31738221645355225,
3427
+ 0.33061375379562374,
3428
+ 3.141425132751465,
3429
+ 0.47507260441780086,
3430
+ 3.141479730606079,
3431
+ 1.0
3432
+ ],
3433
+ "mask": [
3434
+ true,
3435
+ true,
3436
+ true,
3437
+ true,
3438
+ true,
3439
+ true,
3440
+ false
3441
+ ]
3442
+ },
3443
+ "proprio": {
3444
+ "mean": [
3445
+ 0.0,
3446
+ 0.0,
3447
+ 0.0,
3448
+ 0.0,
3449
+ 0.0,
3450
+ 0.0,
3451
+ 0.0
3452
+ ],
3453
+ "std": [
3454
+ 0.0,
3455
+ 0.0,
3456
+ 0.0,
3457
+ 0.0,
3458
+ 0.0,
3459
+ 0.0,
3460
+ 0.0
3461
+ ],
3462
+ "max": [
3463
+ 0.0,
3464
+ 0.0,
3465
+ 0.0,
3466
+ 0.0,
3467
+ 0.0,
3468
+ 0.0,
3469
+ 0.0
3470
+ ],
3471
+ "min": [
3472
+ 0.0,
3473
+ 0.0,
3474
+ 0.0,
3475
+ 0.0,
3476
+ 0.0,
3477
+ 0.0,
3478
+ 0.0
3479
+ ],
3480
+ "q01": [
3481
+ 0.0,
3482
+ 0.0,
3483
+ 0.0,
3484
+ 0.0,
3485
+ 0.0,
3486
+ 0.0,
3487
+ 0.0
3488
+ ],
3489
+ "q99": [
3490
+ 0.0,
3491
+ 0.0,
3492
+ 0.0,
3493
+ 0.0,
3494
+ 0.0,
3495
+ 0.0,
3496
+ 0.0
3497
+ ]
3498
+ },
3499
+ "num_transitions": 52644433,
3500
+ "num_trajectories": 104392
3501
+ }
3502
+ }
example.png ADDED
gaussian_statistic.json ADDED
@@ -0,0 +1,38 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "x": {
3
+ "mu": 0.029053575254787405,
4
+ "sigma": 0.35739711346177905
5
+ },
6
+ "y": {
7
+ "mu": 0.02786103774647074,
8
+ "sigma": 0.3559571318187452
9
+ },
10
+ "z": {
11
+ "mu": -0.09711947743976429,
12
+ "sigma": 0.3812679355450573
13
+ },
14
+ "theta": {
15
+ "mu": 1.876412496914298,
16
+ "sigma": 0.7796698531704824
17
+ },
18
+ "phi": {
19
+ "mu": 0.11370731154738657,
20
+ "sigma": 1.6770051583708574
21
+ },
22
+ "r": {
23
+ "mu": 0.5388089344232078,
24
+ "sigma": 0.3471899869415345
25
+ },
26
+ "roll": {
27
+ "mu": -0.027831684347476855,
28
+ "sigma": 0.3128015393591425
29
+ },
30
+ "pitch": {
31
+ "mu": 0.024452017209463325,
32
+ "sigma": 0.30003871781999225
33
+ },
34
+ "yaw": {
35
+ "mu": 0.00545067902753645,
36
+ "sigma": 0.33581468270262405
37
+ }
38
+ }
generation_config.json ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "_from_model_config": true,
3
+ "bos_token_id": 2,
4
+ "cache_implementation": "hybrid",
5
+ "eos_token_id": 1,
6
+ "pad_token_id": 0,
7
+ "transformers_version": "4.47.0"
8
+ }
model-00001-of-00002.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:713ee1bd116c8f77e2f56903d15e6c3f3dff6ea6b12fc71bfcc3bd4a53a2cc2b
3
+ size 4969426016
model-00002-of-00002.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:b8c87abc1b91598ad237c31ee2286c5c783bfb9f4142696d9b1c36e62f634a34
3
+ size 3086476734
model.safetensors.index.json ADDED
The diff for this file is too large to render. See raw diff
 
modeling_ego3d.py ADDED
@@ -0,0 +1,124 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # MIT License
2
+ # Copyright (c) 2025 IPEC at Shanghai AI Laboratory
3
+ # Permission is hereby granted, free of charge, to use, copy, modify, merge, publish,
4
+ # distribute, sublicense, and/or sell copies of the Software, subject to the following conditions:
5
+ # The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
6
+ # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND.
7
+ # coding=utf-8
8
+
9
+ import torch.utils.checkpoint
10
+ from torch import nn
11
+ from transformers.utils import logging
12
+ import torchvision.transforms.functional as F
13
+ import numpy as np
14
+ import math
15
+
16
+ logger = logging.get_logger(__name__)
17
+
18
+
19
+ class Ego3DPositionEmbeddingMLP(nn.Module):
20
+ """Absolute pos embedding, learned.
21
+ https://github.com/kwea123/nerf_pl/blob/52aeb387da64a9ad9a0f914ea9b049ffc598b20c/models/nerf.py#L4
22
+ """
23
+
24
+ def __init__(self, in_channels=3, num_pos_feats=768, n_freqs=8, logscale=True):
25
+ super(Ego3DPositionEmbeddingMLP, self).__init__()
26
+ self.n_freqs = n_freqs
27
+ self.freq_out_channels = in_channels * (2 * n_freqs + 1)
28
+ if logscale:
29
+ freq_bands = 2 ** torch.linspace(0, n_freqs - 1, n_freqs)
30
+ else:
31
+ freq_bands = torch.linspace(1, 2 ** (n_freqs - 1), n_freqs)
32
+
33
+ center = torch.tensor([0., 0., 2.]).repeat(in_channels // 3)
34
+ self.register_buffer("freq_bands", freq_bands, persistent=False)
35
+ self.register_buffer("center", center, persistent=False)
36
+
37
+ self.position_embedding_head = nn.Sequential(
38
+ nn.Linear(self.freq_out_channels, num_pos_feats),
39
+ nn.LayerNorm(num_pos_feats),
40
+ nn.ReLU(),
41
+ nn.Linear(num_pos_feats, num_pos_feats),
42
+ )
43
+ self._reset_parameters()
44
+
45
+ def _reset_parameters(self):
46
+ """init with small weights to maintain stable training."""
47
+ for p in self.parameters():
48
+ if p.dim() > 1:
49
+ nn.init.xavier_uniform_(p, gain=0.01)
50
+
51
+ @torch.no_grad()
52
+ def frequency_encoding(self, xyz):
53
+ """
54
+ Embeds x to (x, sin(2^k x), cos(2^k x), ...)
55
+ Different from the paper, "x" is also in the output
56
+ See https://github.com/bmild/nerf/issues/12
57
+ x \in [-2, 2]
58
+ y \in [-2, 2]
59
+ z \in [0., 4]
60
+ Inputs:
61
+ x: (b n m)
62
+ Outputs:
63
+ out: (b n o)
64
+ """
65
+ xyz_n = ((xyz - self.center) / 2.0).to(self.freq_bands.dtype)
66
+ xyz_feq = xyz_n.unsqueeze(-1) * self.freq_bands # (b n m 1)
67
+ sin_xyz, cos_xyz = torch.sin(xyz_feq), torch.cos(xyz_feq) # (b n m nf)
68
+ encoding = torch.cat([xyz_n.unsqueeze(-1), sin_xyz, cos_xyz], -1).reshape(*xyz.shape[:2], -1)
69
+ return encoding
70
+
71
+ def forward(self, xyz):
72
+ """Forward pass, xyz is (B, N, 3or6), output (B, N, F)."""
73
+ # TODO: encoding with 3D position
74
+ freq_encoding = self.frequency_encoding(xyz)
75
+ position_embedding = self.position_embedding_head(freq_encoding)
76
+ return position_embedding
77
+
78
+
79
+ def get_resize_output_image_size(
80
+ input_height: int,
81
+ input_width: int,
82
+ output_size: tuple = (384, 512),
83
+ keep_aspect_ratio: bool = True,
84
+ multiple: int = 32,
85
+ ):
86
+ def constrain_to_multiple_of(val, multiple, min_val=0):
87
+ x = (np.round(val / multiple) * multiple).astype(int)
88
+ if x < min_val:
89
+ x = math.ceil(val / multiple) * multiple
90
+ return x
91
+
92
+ output_height, output_width = output_size
93
+ scale_height = output_height / input_height
94
+ scale_width = output_width / input_width
95
+
96
+ if keep_aspect_ratio:
97
+ # scale as little as possible
98
+ if abs(1 - scale_width) < abs(1 - scale_height):
99
+ scale_height = scale_width
100
+ else:
101
+ scale_width = scale_height
102
+
103
+ new_height = constrain_to_multiple_of(scale_height * input_height, multiple=multiple)
104
+ new_width = constrain_to_multiple_of(scale_width * input_width, multiple=multiple)
105
+
106
+ return (int(new_height), int(new_width))
107
+
108
+
109
+ def process_zoe(pixel_values, pad_mode="reflect", output_size=(384, 512)):
110
+ """https://github.com/huggingface/transformers/blob/v4.45.2/src/transformers/models/zoedepth/image_processing_zoedepth.py"""
111
+ # h, w = images.shape[-2:]
112
+ # pad images
113
+ ph, pw = 31, 31 # int((h / 2)**0.5 * 3), int((w / 2)**0.5 * 3) # 32, 31
114
+ images = torch.nn.functional.pad(pixel_values, (pw, pw, ph, ph), mode=pad_mode)
115
+
116
+ # resize images
117
+ size = (384, 384) # get_resize_output_image_size(h, w, output_size=output_size, keep_aspect_ratio=True, multiple=32) # 384, 384
118
+ images = torch.nn.functional.interpolate(images, size=size, mode="bicubic", align_corners=True)
119
+
120
+ # NOTE: zoe: padding -> resize -> nomalize.
121
+ # BUT: siglip processor get nomalized image, we simplely follow `nomalize -> padding -> resize` in reflect pad mode
122
+ ZOE_MEAN, ZOE_STD = (0.5, 0.5, 0.5), (0.5, 0.5, 0.5)
123
+ images = F.normalize(images, mean=ZOE_MEAN, std=ZOE_STD)
124
+ return images, ph, pw
modeling_gemma2.py ADDED
@@ -0,0 +1,1286 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # custom gemma2 to support flash_attention_2
2
+ # coding=utf-8
3
+ # Copyright 2024 Google Inc. HuggingFace Inc. team. All rights reserved.
4
+ #
5
+ #
6
+ # Licensed under the Apache License, Version 2.0 (the "License");
7
+ # you may not use this file except in compliance with the License.
8
+ # You may obtain a copy of the License at
9
+ #
10
+ # http://www.apache.org/licenses/LICENSE-2.0
11
+ #
12
+ # Unless required by applicable law or agreed to in writing, software
13
+ # distributed under the License is distributed on an "AS IS" BASIS,
14
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
+ # See the License for the specific language governing permissions and
16
+ # limitations under the License.
17
+
18
+ from typing import List, Optional, Tuple, Union
19
+
20
+ import torch
21
+ import torch.nn as nn
22
+
23
+ from transformers.activations import ACT2FN
24
+ from transformers.cache_utils import Cache, HybridCache
25
+ from transformers.generation import GenerationMixin
26
+ from transformers.modeling_outputs import (
27
+ BaseModelOutputWithPast,
28
+ CausalLMOutputWithPast,
29
+ SequenceClassifierOutputWithPast,
30
+ TokenClassifierOutput,
31
+ )
32
+ from transformers.modeling_utils import PreTrainedModel
33
+ from transformers.utils import (
34
+ add_code_sample_docstrings,
35
+ add_start_docstrings,
36
+ add_start_docstrings_to_model_forward,
37
+ is_flash_attn_2_available,
38
+ is_flash_attn_greater_or_equal,
39
+ is_torch_greater_or_equal,
40
+ logging,
41
+ replace_return_docstrings,
42
+ is_flash_attn_greater_or_equal_2_10,
43
+ )
44
+ from transformers import Gemma2Config
45
+
46
+
47
+ if is_flash_attn_2_available():
48
+ from transformers.modeling_flash_attention_utils import _flash_attention_forward
49
+
50
+ if is_torch_greater_or_equal("2.5"):
51
+ from torch.nn.attention.flex_attention import flex_attention
52
+
53
+ logger = logging.get_logger(__name__)
54
+
55
+
56
+ _CHECKPOINT_FOR_DOC = "google/gemma2-7b"
57
+ _CONFIG_FOR_DOC = "Gemma2Config"
58
+
59
+
60
+ class Gemma2RMSNorm(nn.Module):
61
+ def __init__(self, dim: int, eps: float = 1e-6):
62
+ super().__init__()
63
+ self.eps = eps
64
+ self.weight = nn.Parameter(torch.zeros(dim))
65
+
66
+ def _norm(self, x):
67
+ return x * torch.rsqrt(x.pow(2).mean(-1, keepdim=True) + self.eps)
68
+
69
+ def forward(self, x):
70
+ output = self._norm(x.float())
71
+ # Llama does x.to(float16) * w whilst Gemma2 is (x * w).to(float16)
72
+ # See https://github.com/huggingface/transformers/pull/29402
73
+ output = output * (1.0 + self.weight.float())
74
+ return output.type_as(x)
75
+
76
+ def extra_repr(self):
77
+ return f"{tuple(self.weight.shape)}, eps={self.eps}"
78
+
79
+
80
+ class Gemma2MLP(nn.Module):
81
+ def __init__(self, config):
82
+ super().__init__()
83
+ self.config = config
84
+ self.hidden_size = config.hidden_size
85
+ self.intermediate_size = config.intermediate_size
86
+ self.gate_proj = nn.Linear(self.hidden_size, self.intermediate_size, bias=False)
87
+ self.up_proj = nn.Linear(self.hidden_size, self.intermediate_size, bias=False)
88
+ self.down_proj = nn.Linear(self.intermediate_size, self.hidden_size, bias=False)
89
+ self.act_fn = ACT2FN[config.hidden_activation]
90
+
91
+ def forward(self, x):
92
+ return self.down_proj(self.act_fn(self.gate_proj(x)) * self.up_proj(x))
93
+
94
+
95
+ class Gemma2RotaryEmbedding(nn.Module):
96
+ def __init__(self, dim, max_position_embeddings=2048, base=10000, device=None):
97
+ super().__init__()
98
+
99
+ self.dim = dim
100
+ self.max_position_embeddings = max_position_embeddings
101
+ self.base = base
102
+ inv_freq = 1.0 / (self.base ** (torch.arange(0, self.dim, 2, dtype=torch.int64).float() / self.dim))
103
+ self.register_buffer("inv_freq", tensor=inv_freq, persistent=False)
104
+
105
+ @torch.no_grad()
106
+ def forward(self, x, position_ids, seq_len=None):
107
+ # x: [bs, num_attention_heads, seq_len, head_size]
108
+ self.inv_freq.to(x.device)
109
+ inv_freq_expanded = self.inv_freq[None, :, None].float().expand(position_ids.shape[0], -1, 1)
110
+ position_ids_expanded = position_ids[:, None, :].float()
111
+ # Force float32 since bfloat16 loses precision on long contexts
112
+ # See https://github.com/huggingface/transformers/pull/29285
113
+ device_type = x.device.type
114
+ device_type = device_type if isinstance(device_type, str) and device_type != "mps" else "cpu"
115
+ with torch.autocast(device_type=device_type, enabled=False):
116
+ freqs = (inv_freq_expanded.float() @ position_ids_expanded.float()).transpose(1, 2)
117
+ emb = torch.cat((freqs, freqs), dim=-1)
118
+ cos = emb.cos()
119
+ sin = emb.sin()
120
+ return cos.to(dtype=x.dtype), sin.to(dtype=x.dtype)
121
+
122
+
123
+ def rotate_half(x):
124
+ """Rotates half the hidden dims of the input."""
125
+ x1 = x[..., : x.shape[-1] // 2]
126
+ x2 = x[..., x.shape[-1] // 2 :]
127
+ return torch.cat((-x2, x1), dim=-1)
128
+
129
+
130
+ def apply_rotary_pos_emb(q, k, cos, sin, position_ids=None, unsqueeze_dim=1):
131
+ """Applies Rotary Position Embedding to the query and key tensors.
132
+
133
+ Args:
134
+ q (`torch.Tensor`): The query tensor.
135
+ k (`torch.Tensor`): The key tensor.
136
+ cos (`torch.Tensor`): The cosine part of the rotary embedding.
137
+ sin (`torch.Tensor`): The sine part of the rotary embedding.
138
+ position_ids (`torch.Tensor`, *optional*):
139
+ Deprecated and unused.
140
+ unsqueeze_dim (`int`, *optional*, defaults to 1):
141
+ The 'unsqueeze_dim' argument specifies the dimension along which to unsqueeze cos[position_ids] and
142
+ sin[position_ids] so that they can be properly broadcasted to the dimensions of q and k. For example, note
143
+ that cos[position_ids] and sin[position_ids] have the shape [batch_size, seq_len, head_dim]. Then, if q and
144
+ k have the shape [batch_size, heads, seq_len, head_dim], then setting unsqueeze_dim=1 makes
145
+ cos[position_ids] and sin[position_ids] broadcastable to the shapes of q and k. Similarly, if q and k have
146
+ the shape [batch_size, seq_len, heads, head_dim], then set unsqueeze_dim=2.
147
+ Returns:
148
+ `tuple(torch.Tensor)` comprising of the query and key tensors rotated using the Rotary Position Embedding.
149
+ """
150
+ cos = cos.unsqueeze(unsqueeze_dim)
151
+ sin = sin.unsqueeze(unsqueeze_dim)
152
+ q_embed = (q * cos) + (rotate_half(q) * sin)
153
+ k_embed = (k * cos) + (rotate_half(k) * sin)
154
+ return q_embed, k_embed
155
+
156
+
157
+ def repeat_kv(hidden_states: torch.Tensor, n_rep: int) -> torch.Tensor:
158
+ """
159
+ This is the equivalent of torch.repeat_interleave(x, dim=1, repeats=n_rep). The hidden states go from (batch,
160
+ num_key_value_heads, seqlen, head_dim) to (batch, num_attention_heads, seqlen, head_dim)
161
+ """
162
+ batch, num_key_value_heads, slen, head_dim = hidden_states.shape
163
+ if n_rep == 1:
164
+ return hidden_states
165
+ hidden_states = hidden_states[:, :, None, :, :].expand(batch, num_key_value_heads, n_rep, slen, head_dim)
166
+ return hidden_states.reshape(batch, num_key_value_heads * n_rep, slen, head_dim)
167
+
168
+
169
+ def eager_attention_forward(
170
+ config: Gemma2Config,
171
+ query: torch.Tensor,
172
+ key: torch.Tensor,
173
+ value: torch.Tensor,
174
+ mask: Optional[torch.Tensor],
175
+ **_kwargs,
176
+ ) -> Tuple[torch.Tensor, torch.Tensor]:
177
+ key_states = repeat_kv(key, config.num_key_value_groups)
178
+ value_states = repeat_kv(value, config.num_key_value_groups)
179
+
180
+ attn_weights = torch.matmul(query, key_states.transpose(2, 3)) * config.scaling
181
+
182
+ if config.attn_logit_softcapping is not None:
183
+ attn_weights = attn_weights / config.attn_logit_softcapping
184
+ attn_weights = torch.tanh(attn_weights)
185
+ attn_weights = attn_weights * config.attn_logit_softcapping
186
+ if mask is not None: # no matter the length, we just slice it
187
+ causal_mask = mask[:, :, :, : key_states.shape[-2]]
188
+ attn_weights = attn_weights + causal_mask
189
+
190
+ # upcast attention to fp32
191
+ attn_weights = nn.functional.softmax(attn_weights, dim=-1, dtype=torch.float32).to(query.dtype)
192
+ attn_weights = nn.functional.dropout(attn_weights, p=config.attention_dropout, training=config.training)
193
+ attn_output = torch.matmul(attn_weights, value_states)
194
+ attn_output = attn_output.transpose(1, 2).contiguous()
195
+ return attn_output, attn_weights
196
+
197
+
198
+ def flash_attention_forward(
199
+ config: Gemma2Config,
200
+ query: torch.Tensor,
201
+ key: torch.Tensor,
202
+ value: torch.Tensor,
203
+ mask: Optional[torch.Tensor],
204
+ target_dtype: torch.dtype = torch.float16,
205
+ **_kwargs,
206
+ ) -> Tuple[torch.Tensor, None]:
207
+ # NOTE: None mask cause un defined https://github.com/huggingface/transformers/blob/c8c8dffbe45ebef0a8dba4a51024e5e5e498596b/src/transformers/models/gemma2/modeling_gemma2.py#L211
208
+ seq_len = query.shape[2]
209
+ # print(f"🔥 query {query.shape}, key {key.shape}, value: {value.shape}")
210
+ if mask is not None:
211
+ # print(f"🔥 mask {mask.shape}")
212
+ # seq_len = mask.shape[1]
213
+ query = query[:, :, :seq_len]
214
+ value = value[:, :, :seq_len]
215
+
216
+ # TODO: These transpose are quite inefficient but Flash Attention requires the layout
217
+ # [batch_size, sequence_length, num_heads, head_dim]. We would need to refactor rotary embedding
218
+ query_states = query.transpose(1, 2)
219
+ key_states = key.transpose(1, 2)
220
+ value_states = value.transpose(1, 2)
221
+
222
+ dropout_rate = config.attention_dropout if config.training else 0.0
223
+
224
+ input_dtype = query_states.dtype
225
+ if input_dtype == torch.float32:
226
+ query_states = query_states.to(target_dtype)
227
+ key_states = key_states.to(target_dtype)
228
+ value_states = value_states.to(target_dtype)
229
+
230
+ attn_output = _flash_attention_forward(
231
+ query_states,
232
+ key_states,
233
+ value_states,
234
+ mask,
235
+ seq_len,
236
+ dropout=dropout_rate,
237
+ softmax_scale=config.scaling,
238
+ is_causal=config.is_causal,
239
+ sliding_window=config.sliding_window,
240
+ use_top_left_mask=config._flash_attn_uses_top_left_mask,
241
+ softcap=config.attn_logit_softcapping if is_flash_attn_greater_or_equal("2.6.0") else None,
242
+ )
243
+
244
+ return attn_output, None
245
+
246
+
247
+ def flex_attention_forward(
248
+ config: Gemma2Config,
249
+ query: torch.Tensor,
250
+ key: torch.Tensor,
251
+ value: torch.Tensor,
252
+ mask: Optional[torch.Tensor],
253
+ output_attentions: bool = False,
254
+ **_kwargs,
255
+ ) -> Tuple[torch.Tensor, Optional[torch.Tensor]]:
256
+ def tanh_softcap(score, b, h, q_idx, kv_idx):
257
+ soft_cap = config.attn_logit_softcapping
258
+ score = soft_cap * torch.tanh(score / soft_cap)
259
+ if mask is not None:
260
+ return score + mask[b][0][q_idx][kv_idx]
261
+ return score
262
+
263
+ attn_output = flex_attention(
264
+ query,
265
+ key,
266
+ value,
267
+ score_mod=tanh_softcap,
268
+ enable_gqa=True,
269
+ scale=config.scaling,
270
+ return_lse=output_attentions,
271
+ )
272
+ if not output_attentions:
273
+ attn_weights = None
274
+ else:
275
+ attn_output, attn_weights = attn_output
276
+
277
+ attn_output = attn_output.transpose(1, 2).contiguous()
278
+ return attn_output, attn_weights
279
+
280
+
281
+ def sdpa_attention_forward(
282
+ config: Gemma2Config,
283
+ query: torch.Tensor,
284
+ key: torch.Tensor,
285
+ value: torch.Tensor,
286
+ mask: Optional[torch.Tensor],
287
+ **_kwargs,
288
+ ) -> Tuple[torch.Tensor, None]:
289
+ key = repeat_kv(key, config.num_key_value_groups)
290
+ value = repeat_kv(value, config.num_key_value_groups)
291
+
292
+ causal_mask = mask
293
+ if mask is not None:
294
+ causal_mask = causal_mask[:, :, :, : key.shape[-2]]
295
+
296
+ # SDPA with memory-efficient backend is currently (torch==2.1.2) bugged with non-contiguous inputs with custom attn_mask,
297
+ # Reference: https://github.com/pytorch/pytorch/issues/112577.
298
+ if query.device.type == "cuda" and causal_mask is not None:
299
+ query = query.contiguous()
300
+ key = key.contiguous()
301
+ value = value.contiguous()
302
+
303
+ # We dispatch to SDPA's Flash Attention or Efficient kernels via this `is_causal` if statement instead of an inline conditional assignment
304
+ # in SDPA to support both torch.compile's dynamic shapes and full graph options. An inline conditional prevents dynamic shapes from compiling.
305
+ is_causal = True if causal_mask is None and query.shape[1] > 1 else False
306
+
307
+ attn_output = torch.nn.functional.scaled_dot_product_attention(
308
+ query,
309
+ key,
310
+ value,
311
+ attn_mask=causal_mask,
312
+ dropout_p=config.attention_dropout if config.training else 0.0,
313
+ is_causal=is_causal,
314
+ scale=config.scaling,
315
+ )
316
+ attn_output = attn_output.transpose(1, 2).contiguous()
317
+ return attn_output, None
318
+
319
+
320
+ GEMMA2_ATTENTION_FUNCTION = {
321
+ "flash_attention_2": flash_attention_forward,
322
+ "flex_attention": flex_attention_forward,
323
+ "eager": eager_attention_forward,
324
+ "sdpa": sdpa_attention_forward,
325
+ }
326
+
327
+
328
+ class Gemma2Attention(nn.Module):
329
+ """Multi-headed attention from 'Attention Is All You Need' paper"""
330
+
331
+ def __init__(self, config: Gemma2Config, layer_idx: Optional[int] = None):
332
+ super().__init__()
333
+ self.config = config
334
+ self.layer_idx = layer_idx
335
+
336
+ self.attention_dropout = config.attention_dropout
337
+ self.hidden_size = config.hidden_size
338
+ self.num_heads = config.num_attention_heads
339
+ self.head_dim = config.head_dim
340
+ self.num_key_value_heads = config.num_key_value_heads
341
+ self.num_key_value_groups = self.num_heads // self.num_key_value_heads
342
+ self.max_position_embeddings = config.max_position_embeddings
343
+ self.rope_theta = config.rope_theta
344
+ self.is_causal = True
345
+ self.scaling = config.query_pre_attn_scalar**-0.5
346
+ self.sliding_window = config.sliding_window if not bool(layer_idx % 2) else None
347
+ self.attn_logit_softcapping = config.attn_logit_softcapping
348
+ if self.hidden_size % self.num_heads != 0:
349
+ raise ValueError(
350
+ f"hidden_size must be divisible by num_heads (got `hidden_size`: {self.hidden_size}"
351
+ f" and `num_heads`: {self.num_heads})."
352
+ )
353
+
354
+ self.q_proj = nn.Linear(self.hidden_size, self.num_heads * self.head_dim, bias=config.attention_bias)
355
+ self.k_proj = nn.Linear(self.hidden_size, self.num_key_value_heads * self.head_dim, bias=config.attention_bias)
356
+ self.v_proj = nn.Linear(self.hidden_size, self.num_key_value_heads * self.head_dim, bias=config.attention_bias)
357
+ self.o_proj = nn.Linear(self.num_heads * self.head_dim, self.hidden_size, bias=config.attention_bias)
358
+ self.rotary_emb = Gemma2RotaryEmbedding(
359
+ self.head_dim,
360
+ max_position_embeddings=self.max_position_embeddings,
361
+ base=self.rope_theta,
362
+ )
363
+
364
+ # NOTE: gemma2 do not include _flash_attn_uses_top_left_mask for flash attention
365
+ self._flash_attn_uses_top_left_mask = not is_flash_attn_greater_or_equal_2_10()
366
+
367
+ def forward(
368
+ self,
369
+ hidden_states: torch.Tensor,
370
+ attention_mask: Optional[torch.Tensor] = None,
371
+ position_ids: Optional[torch.LongTensor] = None,
372
+ past_key_value: Optional[Cache] = None,
373
+ output_attentions: bool = False,
374
+ use_cache: bool = False,
375
+ cache_position: Optional[torch.LongTensor] = None,
376
+ ) -> Tuple[torch.Tensor, Optional[torch.Tensor], Optional[Tuple[torch.Tensor]]]:
377
+ bsz, q_len, _ = hidden_states.size()
378
+
379
+ query_states = self.q_proj(hidden_states)
380
+ key_states = self.k_proj(hidden_states)
381
+ value_states = self.v_proj(hidden_states)
382
+
383
+ query_states = query_states.view(bsz, q_len, self.num_heads, self.head_dim).transpose(1, 2)
384
+ key_states = key_states.view(bsz, q_len, self.num_key_value_heads, self.head_dim).transpose(1, 2)
385
+ value_states = value_states.view(bsz, q_len, self.num_key_value_heads, self.head_dim).transpose(1, 2)
386
+
387
+ cos, sin = self.rotary_emb(value_states, position_ids)
388
+ query_states, key_states = apply_rotary_pos_emb(query_states, key_states, cos, sin)
389
+
390
+ if past_key_value is not None:
391
+ # sin and cos are specific to RoPE models; cache_position needed for the static cache
392
+ cache_kwargs = {
393
+ "sin": sin,
394
+ "cos": cos,
395
+ "sliding_window": self.sliding_window,
396
+ "cache_position": cache_position,
397
+ }
398
+ key_states, value_states = past_key_value.update(key_states, value_states, self.layer_idx, cache_kwargs)
399
+
400
+ if output_attentions and self.config._attn_implementation in ["sdpa", "flash_attention_2"]:
401
+ logger.warning_once("Setting `attention_type` to `flex_attention` because `output_attentions=True`")
402
+ attention_type = "flex_attention"
403
+ else:
404
+ attention_type = self.config._attn_implementation
405
+
406
+ attn_output, attn_weights = GEMMA2_ATTENTION_FUNCTION[attention_type](
407
+ self, query_states, key_states, value_states, attention_mask, output_attentions=output_attentions
408
+ )
409
+
410
+ attn_output = attn_output.reshape(bsz, q_len, -1).contiguous()
411
+ attn_output = self.o_proj(attn_output)
412
+
413
+ if not output_attentions:
414
+ attn_weights = None
415
+
416
+ return attn_output, attn_weights, past_key_value
417
+
418
+
419
+ class Gemma2FlashAttention2(Gemma2Attention):
420
+ def __init__(self, config: Gemma2Config, layer_idx: Optional[int] = None):
421
+ super().__init__(config, layer_idx)
422
+ self.config._attn_implementation = "flash_attention_2"
423
+ logger.warning_once(
424
+ "The `Gemma2FlashAttention2` class is deprecated in favor of simply modifying the `config._attn_implementation`"
425
+ "attribute of the `GemmaAttention` class! It will be removed in v4.48"
426
+ )
427
+
428
+
429
+ class Gemma2SdpaAttention(Gemma2Attention):
430
+ def __init__(self, config: Gemma2Config, layer_idx: Optional[int] = None):
431
+ super().__init__(config, layer_idx)
432
+ self.config._attn_implementation = "sdpa"
433
+ logger.warning_once(
434
+ "The `Gemma2FlashAttention2` class is deprecated in favor of simply modifying the `config._attn_implementation`"
435
+ "attribute of the `GemmaAttention` class! It will be removed in v4.48"
436
+ )
437
+
438
+
439
+ class Gemma2DecoderLayer(nn.Module):
440
+ def __init__(self, config: Gemma2Config, layer_idx: int):
441
+ super().__init__()
442
+ self.hidden_size = config.hidden_size
443
+ self.config = config
444
+ self.is_sliding = not bool(layer_idx % 2)
445
+ self.self_attn = Gemma2Attention(config=config, layer_idx=layer_idx)
446
+ self.mlp = Gemma2MLP(config)
447
+ self.input_layernorm = Gemma2RMSNorm(config.hidden_size, eps=config.rms_norm_eps)
448
+ self.post_attention_layernorm = Gemma2RMSNorm(config.hidden_size, eps=config.rms_norm_eps)
449
+
450
+ self.pre_feedforward_layernorm = Gemma2RMSNorm(config.hidden_size, eps=config.rms_norm_eps)
451
+ self.post_feedforward_layernorm = Gemma2RMSNorm(config.hidden_size, eps=config.rms_norm_eps)
452
+ self.sliding_window = config.sliding_window
453
+
454
+ def forward(
455
+ self,
456
+ hidden_states: torch.Tensor,
457
+ attention_mask: Optional[torch.Tensor] = None,
458
+ position_ids: Optional[torch.LongTensor] = None,
459
+ past_key_value: Optional[Cache] = None,
460
+ output_attentions: Optional[bool] = False,
461
+ use_cache: Optional[bool] = False,
462
+ cache_position: Optional[torch.LongTensor] = None,
463
+ ) -> Tuple[torch.FloatTensor, Optional[Tuple[torch.FloatTensor, torch.FloatTensor]]]:
464
+ if self.is_sliding and attention_mask is not None: # efficient SDPA and no padding
465
+ # Flash-attn is a 2D tensor
466
+ if self.config._attn_implementation == "flash_attention_2":
467
+ if past_key_value is not None: # when decoding
468
+ attention_mask = attention_mask[:, -self.sliding_window :]
469
+ else:
470
+ min_dtype = torch.finfo(hidden_states.dtype).min
471
+ sliding_window_mask = torch.tril(
472
+ torch.ones_like(attention_mask, dtype=torch.bool), diagonal=-self.sliding_window
473
+ )
474
+ attention_mask = torch.where(sliding_window_mask, min_dtype, attention_mask)
475
+ if attention_mask.shape[-1] <= 1: # when decoding
476
+ attention_mask = attention_mask[:, :, :, -self.sliding_window :]
477
+
478
+ residual = hidden_states
479
+
480
+ hidden_states = self.input_layernorm(hidden_states)
481
+
482
+ # Self Attention
483
+ hidden_states, self_attn_weights, present_key_value = self.self_attn(
484
+ hidden_states=hidden_states,
485
+ attention_mask=attention_mask,
486
+ position_ids=position_ids,
487
+ past_key_value=past_key_value,
488
+ output_attentions=output_attentions,
489
+ use_cache=use_cache,
490
+ cache_position=cache_position,
491
+ )
492
+ hidden_states = self.post_attention_layernorm(hidden_states)
493
+ hidden_states = residual + hidden_states
494
+
495
+ residual = hidden_states
496
+ hidden_states = self.pre_feedforward_layernorm(hidden_states)
497
+ hidden_states = self.mlp(hidden_states)
498
+ hidden_states = self.post_feedforward_layernorm(hidden_states)
499
+ hidden_states = residual + hidden_states
500
+
501
+ outputs = (hidden_states,)
502
+
503
+ if output_attentions:
504
+ outputs += (self_attn_weights,)
505
+
506
+ if use_cache:
507
+ outputs += (present_key_value,)
508
+
509
+ return outputs
510
+
511
+
512
+ GEMMA2_START_DOCSTRING = r"""
513
+ This model inherits from [`PreTrainedModel`]. Check the superclass documentation for the generic methods the
514
+ library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
515
+ etc.)
516
+
517
+ This model is also a PyTorch [torch.nn.Module](https://pytorch.org/docs/stable/nn.html#torch.nn.Module) subclass.
518
+ Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
519
+ and behavior.
520
+
521
+ Parameters:
522
+ config ([`Gemma2Config`]):
523
+ Model configuration class with all the parameters of the model. Initializing with a config file does not
524
+ load the weights associated with the model, only the configuration. Check out the
525
+ [`~PreTrainedModel.from_pretrained`] method to load the model weights.
526
+ """
527
+
528
+
529
+ @add_start_docstrings(
530
+ "The bare Gemma2 Model outputting raw hidden-states without any specific head on top.",
531
+ GEMMA2_START_DOCSTRING,
532
+ )
533
+ class Gemma2PreTrainedModel(PreTrainedModel):
534
+ config_class = Gemma2Config
535
+ base_model_prefix = "model"
536
+ supports_gradient_checkpointing = True
537
+ _no_split_modules = ["Gemma2DecoderLayer"]
538
+ _skip_keys_device_placement = ["past_key_values"]
539
+ _supports_flash_attn_2 = True
540
+ _supports_sdpa = True
541
+ _supports_cache_class = True
542
+ _supports_quantized_cache = False
543
+ _supports_static_cache = True
544
+
545
+ def _init_weights(self, module):
546
+ std = self.config.initializer_range
547
+ if isinstance(module, nn.Linear):
548
+ module.weight.data.normal_(mean=0.0, std=std)
549
+ if module.bias is not None:
550
+ module.bias.data.zero_()
551
+ elif isinstance(module, nn.Embedding):
552
+ module.weight.data.normal_(mean=0.0, std=std)
553
+ if module.padding_idx is not None:
554
+ module.weight.data[module.padding_idx].zero_()
555
+
556
+ @classmethod
557
+ def _check_and_enable_sdpa(cls, config, hard_check_only: bool = False):
558
+ """
559
+ Overloads `PreTrainedModel._check_and_enable_sdpa` so as to DISABLE torch SDPA by default on Gemma2 models.
560
+ SDPA reduces the model performance on Gemma2 because of the logits softcapping.
561
+ """
562
+ config = super()._check_and_enable_sdpa(config, hard_check_only=hard_check_only)
563
+
564
+ # if using the default path -> swap sdpa by eager
565
+ if not hard_check_only and config._attn_implementation == "sdpa":
566
+ config._attn_implementation = "eager"
567
+
568
+ return config
569
+
570
+
571
+ GEMMA2_INPUTS_DOCSTRING = r"""
572
+ Args:
573
+ input_ids (`torch.LongTensor` of shape `(batch_size, sequence_length)`):
574
+ Indices of input sequence tokens in the vocabulary. Padding will be ignored by default should you provide
575
+ it.
576
+
577
+ Indices can be obtained using [`AutoTokenizer`]. See [`PreTrainedTokenizer.encode`] and
578
+ [`PreTrainedTokenizer.__call__`] for details.
579
+
580
+ [What are input IDs?](../glossary#input-ids)
581
+ attention_mask (`torch.Tensor` of shape `(batch_size, sequence_length)`, *optional*):
582
+ Mask to avoid performing attention on padding token indices. Mask values selected in `[0, 1]`:
583
+
584
+ - 1 for tokens that are **not masked**,
585
+ - 0 for tokens that are **masked**.
586
+
587
+ [What are attention masks?](../glossary#attention-mask)
588
+
589
+ Indices can be obtained using [`AutoTokenizer`]. See [`PreTrainedTokenizer.encode`] and
590
+ [`PreTrainedTokenizer.__call__`] for details.
591
+
592
+ If `past_key_values` is used, optionally only the last `input_ids` have to be input (see
593
+ `past_key_values`).
594
+
595
+ If you want to change padding behavior, you should read [`modeling_opt._prepare_decoder_attention_mask`]
596
+ and modify to your needs. See diagram 1 in [the paper](https://arxiv.org/abs/1910.13461) for more
597
+ information on the default strategy.
598
+
599
+ - 1 indicates the head is **not masked**,
600
+ - 0 indicates the head is **masked**.
601
+ position_ids (`torch.LongTensor` of shape `(batch_size, sequence_length)`, *optional*):
602
+ Indices of positions of each input sequence tokens in the position embeddings. Selected in the range `[0,
603
+ config.n_positions - 1]`.
604
+
605
+ [What are position IDs?](../glossary#position-ids)
606
+ past_key_values (`Cache` or `tuple(tuple(torch.FloatTensor))`, *optional*):
607
+ Pre-computed hidden-states (key and values in the self-attention blocks and in the cross-attention
608
+ blocks) that can be used to speed up sequential decoding. This typically consists in the `past_key_values`
609
+ returned by the model at a previous stage of decoding, when `use_cache=True` or `config.use_cache=True`.
610
+
611
+ Two formats are allowed:
612
+ - a [`~cache_utils.Cache`] instance, see our
613
+ [kv cache guide](https://huggingface.co/docs/transformers/en/kv_cache);
614
+ - Tuple of `tuple(torch.FloatTensor)` of length `config.n_layers`, with each tuple having 2 tensors of
615
+ shape `(batch_size, num_heads, sequence_length, embed_size_per_head)`). This is also known as the legacy
616
+ cache format.
617
+
618
+ The model will output the same cache format that is fed as input. If no `past_key_values` are passed, the
619
+ legacy cache format will be returned.
620
+
621
+ If `past_key_values` are used, the user can optionally input only the last `input_ids` (those that don't
622
+ have their past key value states given to this model) of shape `(batch_size, 1)` instead of all `input_ids`
623
+ of shape `(batch_size, sequence_length)`.
624
+ inputs_embeds (`torch.FloatTensor` of shape `(batch_size, sequence_length, hidden_size)`, *optional*):
625
+ Optionally, instead of passing `input_ids` you can choose to directly pass an embedded representation. This
626
+ is useful if you want more control over how to convert `input_ids` indices into associated vectors than the
627
+ model's internal embedding lookup matrix.
628
+ use_cache (`bool`, *optional*):
629
+ If set to `True`, `past_key_values` key value states are returned and can be used to speed up decoding (see
630
+ `past_key_values`).
631
+ output_attentions (`bool`, *optional*):
632
+ Whether or not to return the attentions tensors of all attention layers. See `attentions` under returned
633
+ tensors for more detail.
634
+ output_hidden_states (`bool`, *optional*):
635
+ Whether or not to return the hidden states of all layers. See `hidden_states` under returned tensors for
636
+ more detail.
637
+ return_dict (`bool`, *optional*):
638
+ Whether or not to return a [`~utils.ModelOutput`] instead of a plain tuple.
639
+ cache_position (`torch.LongTensor` of shape `(sequence_length)`, *optional*):
640
+ Indices depicting the position of the input sequence tokens in the sequence. Contrarily to `position_ids`,
641
+ this tensor is not affected by padding. It is used to update the cache in the correct position and to infer
642
+ the complete sequence length.
643
+ """
644
+
645
+
646
+ @add_start_docstrings(
647
+ "The bare Gemma2 Model outputting raw hidden-states without any specific head on top.",
648
+ GEMMA2_START_DOCSTRING,
649
+ )
650
+ class Gemma2Model(Gemma2PreTrainedModel):
651
+ """
652
+ Transformer decoder consisting of *config.num_hidden_layers* layers. Each layer is a [`Gemma2DecoderLayer`]
653
+
654
+ Args:
655
+ config: Gemma2Config
656
+ """
657
+
658
+ def __init__(self, config: Gemma2Config):
659
+ super().__init__(config)
660
+ self.padding_idx = config.pad_token_id
661
+ self.vocab_size = config.vocab_size
662
+
663
+ self.embed_tokens = nn.Embedding(config.vocab_size, config.hidden_size, self.padding_idx)
664
+ self.layers = nn.ModuleList(
665
+ [Gemma2DecoderLayer(config, layer_idx) for layer_idx in range(config.num_hidden_layers)]
666
+ )
667
+ self.norm = Gemma2RMSNorm(config.hidden_size, eps=config.rms_norm_eps)
668
+
669
+ self.gradient_checkpointing = False
670
+ if getattr(config, "pretraining_tp", 1) != 1:
671
+ logger.warn("`pretraining_tp` is deprecated, please use `model.tensor_parallel` instead.")
672
+
673
+ # Initialize weights and apply final processing
674
+ self.post_init()
675
+
676
+ def get_input_embeddings(self):
677
+ return self.embed_tokens
678
+
679
+ def set_input_embeddings(self, value):
680
+ self.embed_tokens = value
681
+
682
+ @add_start_docstrings_to_model_forward(GEMMA2_INPUTS_DOCSTRING)
683
+ def forward(
684
+ self,
685
+ input_ids: torch.LongTensor = None,
686
+ attention_mask: Optional[torch.Tensor] = None,
687
+ position_ids: Optional[torch.LongTensor] = None,
688
+ past_key_values: Optional[HybridCache] = None,
689
+ inputs_embeds: Optional[torch.FloatTensor] = None,
690
+ use_cache: Optional[bool] = None,
691
+ output_attentions: Optional[bool] = None,
692
+ output_hidden_states: Optional[bool] = None,
693
+ return_dict: Optional[bool] = None,
694
+ cache_position: Optional[torch.LongTensor] = None,
695
+ ) -> Union[Tuple, BaseModelOutputWithPast]:
696
+ output_attentions = output_attentions if output_attentions is not None else self.config.output_attentions
697
+ output_hidden_states = (
698
+ output_hidden_states if output_hidden_states is not None else self.config.output_hidden_states
699
+ )
700
+ use_cache = use_cache if use_cache is not None else self.config.use_cache
701
+ return_dict = return_dict if return_dict is not None else self.config.use_return_dict
702
+
703
+ if (input_ids is None) ^ (inputs_embeds is not None):
704
+ raise ValueError("You must specify exactly one of input_ids or inputs_embeds")
705
+
706
+ if self.gradient_checkpointing and self.training and use_cache:
707
+ logger.warning_once(
708
+ "`use_cache=True` is incompatible with gradient checkpointing. Setting `use_cache=False`."
709
+ )
710
+ use_cache = False
711
+
712
+ if inputs_embeds is None:
713
+ inputs_embeds = self.embed_tokens(input_ids)
714
+
715
+ if use_cache and past_key_values is None and not self.training:
716
+ batch_size, seq_len, _ = inputs_embeds.shape
717
+ past_key_values = HybridCache(
718
+ self.config,
719
+ batch_size=batch_size,
720
+ max_cache_len=seq_len,
721
+ device=self.device,
722
+ dtype=inputs_embeds.dtype,
723
+ )
724
+
725
+ if cache_position is None:
726
+ past_seen_tokens = past_key_values.get_seq_length() if past_key_values is not None else 0
727
+ cache_position = torch.arange(
728
+ past_seen_tokens, past_seen_tokens + inputs_embeds.shape[1], device=inputs_embeds.device
729
+ )
730
+
731
+ if position_ids is None:
732
+ position_ids = cache_position.unsqueeze(0)
733
+
734
+ causal_mask = self._update_causal_mask(
735
+ attention_mask, inputs_embeds, cache_position, past_key_values, output_attentions
736
+ )
737
+
738
+ # embed positions
739
+ hidden_states = inputs_embeds
740
+
741
+ # normalized
742
+ # Gemma2 downcasts the below to float16, causing sqrt(3072)=55.4256 to become 55.5
743
+ # See https://github.com/huggingface/transformers/pull/29402
744
+ normalizer = torch.tensor(self.config.hidden_size**0.5, dtype=hidden_states.dtype)
745
+ hidden_states = hidden_states * normalizer
746
+
747
+ # decoder layers
748
+ all_hidden_states = () if output_hidden_states else None
749
+ all_self_attns = () if output_attentions else None
750
+
751
+ for decoder_layer in self.layers[: self.config.num_hidden_layers]:
752
+ if output_hidden_states:
753
+ all_hidden_states += (hidden_states,)
754
+
755
+ if self.gradient_checkpointing and self.training:
756
+ layer_outputs = self._gradient_checkpointing_func(
757
+ decoder_layer.__call__,
758
+ hidden_states,
759
+ causal_mask,
760
+ position_ids,
761
+ past_key_values,
762
+ output_attentions,
763
+ use_cache,
764
+ cache_position,
765
+ )
766
+ else:
767
+ layer_outputs = decoder_layer(
768
+ hidden_states,
769
+ attention_mask=causal_mask,
770
+ position_ids=position_ids,
771
+ past_key_value=past_key_values,
772
+ output_attentions=output_attentions,
773
+ use_cache=use_cache,
774
+ cache_position=cache_position,
775
+ )
776
+
777
+ hidden_states = layer_outputs[0]
778
+
779
+ if output_attentions:
780
+ all_self_attns += (layer_outputs[1],)
781
+
782
+ hidden_states = self.norm(hidden_states)
783
+
784
+ if output_hidden_states:
785
+ all_hidden_states += (hidden_states,)
786
+
787
+ next_cache = past_key_values if use_cache else None
788
+
789
+ if not return_dict:
790
+ return tuple(v for v in [hidden_states, next_cache, all_hidden_states, all_self_attns] if v is not None)
791
+ return BaseModelOutputWithPast(
792
+ last_hidden_state=hidden_states,
793
+ past_key_values=next_cache,
794
+ hidden_states=all_hidden_states,
795
+ attentions=all_self_attns,
796
+ )
797
+
798
+ @torch.no_grad()
799
+ def _update_causal_mask(
800
+ self,
801
+ attention_mask: torch.Tensor,
802
+ input_tensor: torch.Tensor,
803
+ cache_position: torch.Tensor,
804
+ past_key_values: HybridCache,
805
+ output_attentions: bool,
806
+ ):
807
+ # Flash Attention currently doesn't support static cache but Gemma2 work only with static cache.
808
+ # So we will pass in attention mask as is in any case, not only when ther's padding. Then we'll use its shape
809
+ # to cut out keys/values trailing 0 used in static cache. This workaround should be compile compatible
810
+ # as it doesn't cause dynamic control issues.
811
+ if self.config._attn_implementation == "flash_attention_2":
812
+ return attention_mask
813
+
814
+ dtype, device = input_tensor.dtype, input_tensor.device
815
+ sequence_length = input_tensor.shape[1]
816
+ if isinstance(past_key_values, HybridCache):
817
+ target_length = past_key_values.get_max_cache_shape()
818
+ else:
819
+ target_length = attention_mask.shape[-1] if attention_mask is not None else input_tensor.shape[1]
820
+
821
+ # In case the provided `attention` mask is 2D, we generate a causal mask here (4D).
822
+ causal_mask = self._prepare_4d_causal_attention_mask_with_cache_position(
823
+ attention_mask,
824
+ sequence_length=sequence_length,
825
+ target_length=target_length,
826
+ dtype=dtype,
827
+ device=device,
828
+ cache_position=cache_position,
829
+ batch_size=input_tensor.shape[0],
830
+ )
831
+ return causal_mask
832
+
833
+ @staticmethod
834
+ def _prepare_4d_causal_attention_mask_with_cache_position(
835
+ attention_mask: torch.Tensor,
836
+ sequence_length: int,
837
+ target_length: int,
838
+ dtype: torch.dtype,
839
+ device: torch.device,
840
+ cache_position: torch.Tensor,
841
+ batch_size: int,
842
+ **kwargs,
843
+ ):
844
+ """
845
+ Creates a causal 4D mask of shape `(batch_size, 1, query_length, key_value_length)` from a 2D mask of shape
846
+ `(batch_size, key_value_length)`, or if the input `attention_mask` is already 4D, do nothing.
847
+
848
+ Args:
849
+ attention_mask (`torch.Tensor`):
850
+ A 2D attention mask of shape `(batch_size, key_value_length)` or a 4D attention mask of shape
851
+ `(batch_size, 1, query_length, key_value_length)`.
852
+ sequence_length (`int`):
853
+ The sequence length being processed.
854
+ target_length (`int`):
855
+ The target length: when generating with static cache, the mask should be as long as the static cache,
856
+ to account for the 0 padding, the part of the cache that is not filled yet.
857
+ dtype (`torch.dtype`):
858
+ The dtype to use for the 4D attention mask.
859
+ device (`torch.device`):
860
+ The device to plcae the 4D attention mask on.
861
+ cache_position (`torch.Tensor`):
862
+ Indices depicting the position of the input sequence tokens in the sequence.
863
+ batch_size (`torch.Tensor`):
864
+ Batch size.
865
+ """
866
+ if attention_mask is not None and attention_mask.dim() == 4:
867
+ # In this case we assume that the mask comes already in inverted form and requires no inversion or slicing.
868
+ causal_mask = attention_mask
869
+ else:
870
+ min_dtype = torch.finfo(dtype).min
871
+ causal_mask = torch.full(
872
+ (sequence_length, target_length), fill_value=min_dtype, dtype=dtype, device=device
873
+ )
874
+ if sequence_length != 1:
875
+ causal_mask = torch.triu(causal_mask, diagonal=1)
876
+ causal_mask *= torch.arange(target_length, device=device) > cache_position.reshape(-1, 1)
877
+ causal_mask = causal_mask[None, None, :, :].expand(batch_size, 1, -1, -1)
878
+ if attention_mask is not None:
879
+ causal_mask = causal_mask.clone() # copy to contiguous memory for in-place edit
880
+ mask_length = attention_mask.shape[-1]
881
+ padding_mask = causal_mask[:, :, :, :mask_length] + attention_mask[:, None, None, :]
882
+ padding_mask = padding_mask == 0
883
+ causal_mask[:, :, :, :mask_length] = causal_mask[:, :, :, :mask_length].masked_fill(
884
+ padding_mask, min_dtype
885
+ )
886
+
887
+ return causal_mask
888
+
889
+
890
+ class Gemma2ForCausalLM(Gemma2PreTrainedModel, GenerationMixin):
891
+ _tied_weights_keys = ["lm_head.weight"]
892
+ _tp_plan = {"lm_head": "colwise_rep"}
893
+
894
+ def __init__(self, config):
895
+ super().__init__(config)
896
+ self.model = Gemma2Model(config)
897
+ self.vocab_size = config.vocab_size
898
+ self.lm_head = nn.Linear(config.hidden_size, config.vocab_size, bias=False)
899
+
900
+ # Initialize weights and apply final processing
901
+ self.post_init()
902
+
903
+ def get_input_embeddings(self):
904
+ return self.model.embed_tokens
905
+
906
+ def set_input_embeddings(self, value):
907
+ self.model.embed_tokens = value
908
+
909
+ def get_output_embeddings(self):
910
+ return self.lm_head
911
+
912
+ def set_output_embeddings(self, new_embeddings):
913
+ self.lm_head = new_embeddings
914
+
915
+ def set_decoder(self, decoder):
916
+ self.model = decoder
917
+
918
+ def get_decoder(self):
919
+ return self.model
920
+
921
+ @add_start_docstrings_to_model_forward(GEMMA2_INPUTS_DOCSTRING)
922
+ @replace_return_docstrings(output_type=CausalLMOutputWithPast, config_class=_CONFIG_FOR_DOC)
923
+ def forward(
924
+ self,
925
+ input_ids: torch.LongTensor = None,
926
+ attention_mask: Optional[torch.Tensor] = None,
927
+ position_ids: Optional[torch.LongTensor] = None,
928
+ past_key_values: Optional[HybridCache] = None,
929
+ inputs_embeds: Optional[torch.FloatTensor] = None,
930
+ labels: Optional[torch.LongTensor] = None,
931
+ use_cache: Optional[bool] = None,
932
+ output_attentions: Optional[bool] = None,
933
+ output_hidden_states: Optional[bool] = None,
934
+ return_dict: Optional[bool] = None,
935
+ cache_position: Optional[torch.LongTensor] = None,
936
+ num_logits_to_keep: int = 0,
937
+ **loss_kwargs,
938
+ ) -> Union[Tuple, CausalLMOutputWithPast]:
939
+ r"""
940
+ Args:
941
+ labels (`torch.LongTensor` of shape `(batch_size, sequence_length)`, *optional*):
942
+ Labels for computing the masked language modeling loss. Indices should either be in `[0, ...,
943
+ config.vocab_size]` or -100 (see `input_ids` docstring). Tokens with indices set to `-100` are ignored
944
+ (masked), the loss is only computed for the tokens with labels in `[0, ..., config.vocab_size]`.
945
+
946
+ num_logits_to_keep (`int`, *optional*):
947
+ Calculate logits for the last `num_logits_to_keep` tokens. If `0`, calculate logits for all
948
+ `input_ids` (special case). Only last token logits are needed for generation, and calculating them only for that
949
+ token can save memory, which becomes pretty significant for long sequences or large vocabulary size.
950
+
951
+ Returns:
952
+
953
+ Example:
954
+
955
+ ```python
956
+ >>> from transformers import AutoTokenizer, GemmaForCausalLM
957
+
958
+ >>> model = GemmaForCausalLM.from_pretrained("google/gemma-2-9b")
959
+ >>> tokenizer = AutoTokenizer.from_pretrained("google/gemma-2-9b")
960
+
961
+ >>> prompt = "What is your favorite condiment?"
962
+ >>> inputs = tokenizer(prompt, return_tensors="pt")
963
+
964
+ >>> # Generate
965
+ >>> generate_ids = model.generate(inputs.input_ids, max_length=30)
966
+ >>> tokenizer.batch_decode(generate_ids, skip_special_tokens=True, clean_up_tokenization_spaces=False)[0]
967
+ "What is your favorite condiment?"
968
+ ```"""
969
+
970
+ if self.training and self.config._attn_implementation != "eager":
971
+ logger.warning_once(
972
+ "It is strongly recommended to train Gemma2 models with the `eager` attention implementation "
973
+ f"instead of `{self.config._attn_implementation}`. Use `eager` with `AutoModelForCausalLM.from_pretrained('<path-to-checkpoint>', attn_implementation='eager')`."
974
+ )
975
+ output_attentions = output_attentions if output_attentions is not None else self.config.output_attentions
976
+ output_hidden_states = (
977
+ output_hidden_states if output_hidden_states is not None else self.config.output_hidden_states
978
+ )
979
+ return_dict = return_dict if return_dict is not None else self.config.use_return_dict
980
+ # decoder outputs consists of (dec_features, layer_state, dec_hidden, dec_attn)
981
+ outputs = self.model(
982
+ input_ids=input_ids,
983
+ attention_mask=attention_mask,
984
+ position_ids=position_ids,
985
+ past_key_values=past_key_values,
986
+ inputs_embeds=inputs_embeds,
987
+ use_cache=use_cache,
988
+ output_attentions=output_attentions,
989
+ output_hidden_states=output_hidden_states,
990
+ return_dict=return_dict,
991
+ cache_position=cache_position,
992
+ )
993
+
994
+ hidden_states = outputs[0]
995
+ # Only compute necessary logits, and do not upcast them to float if we are not computing the loss
996
+ logits = self.lm_head(hidden_states[:, -num_logits_to_keep:, :])
997
+ if self.config.final_logit_softcapping is not None:
998
+ logits = logits / self.config.final_logit_softcapping
999
+ logits = torch.tanh(logits)
1000
+ logits = logits * self.config.final_logit_softcapping
1001
+
1002
+ loss = None
1003
+ if labels is not None:
1004
+ loss = self.loss_function(logits, labels, self.vocab_size, **loss_kwargs)
1005
+
1006
+ if not return_dict:
1007
+ output = (logits,) + outputs[1:]
1008
+ return (loss,) + output if loss is not None else output
1009
+
1010
+ return CausalLMOutputWithPast(
1011
+ loss=loss,
1012
+ logits=logits,
1013
+ past_key_values=outputs.past_key_values,
1014
+ hidden_states=outputs.hidden_states,
1015
+ attentions=outputs.attentions,
1016
+ )
1017
+
1018
+ def prepare_inputs_for_generation(
1019
+ self,
1020
+ input_ids,
1021
+ past_key_values=None,
1022
+ attention_mask=None,
1023
+ inputs_embeds=None,
1024
+ cache_position=None,
1025
+ position_ids=None,
1026
+ use_cache=True,
1027
+ num_logits_to_keep=None,
1028
+ **kwargs,
1029
+ ):
1030
+ # Overwritten: has a special cache type, `HybridCache`
1031
+
1032
+ # If we have cache: let's slice `input_ids` through `cache_position`, to keep only the unprocessed tokens
1033
+ # Exception 1: when passing input_embeds, input_ids may be missing entries
1034
+ # Exception 2: some generation methods do special slicing of input_ids, so we don't need to do it here
1035
+ if past_key_values is not None:
1036
+ if inputs_embeds is not None: # Exception 1
1037
+ input_ids = input_ids[:, -cache_position.shape[0] :]
1038
+ elif input_ids.shape[1] != cache_position.shape[0]: # Default case (the "else", a no op, is Exception 2)
1039
+ input_ids = input_ids[:, cache_position]
1040
+ if attention_mask is not None and position_ids is None:
1041
+ # create position_ids on the fly for batch generation
1042
+ position_ids = attention_mask.long().cumsum(-1) - 1
1043
+ position_ids.masked_fill_(attention_mask == 0, 1)
1044
+ if past_key_values:
1045
+ position_ids = position_ids[:, -input_ids.shape[1] :]
1046
+ # This `clone` call is needed to avoid recapturing cuda graphs with `torch.compile`'s
1047
+ # `mode="reduce-overhead`, as otherwise the input `position_ids` would have various stride
1048
+ # during the decoding. Here, simply using `.contiguous()` is not sufficient as in the
1049
+ # batch size = 1 case, `position_ids` is already contiguous but with varying stride
1050
+ # which retriggers a capture.
1051
+ position_ids = position_ids.clone(memory_format=torch.contiguous_format)
1052
+
1053
+ # if `inputs_embeds` are passed, we only want to use them in the 1st generation step
1054
+ if inputs_embeds is not None and cache_position[0] == 0:
1055
+ model_inputs = {"inputs_embeds": inputs_embeds, "input_ids": None}
1056
+ else:
1057
+ # The clone here is for the same reason as for `position_ids`.
1058
+ model_inputs = {"input_ids": input_ids.clone(memory_format=torch.contiguous_format), "inputs_embeds": None}
1059
+
1060
+ if (
1061
+ isinstance(past_key_values, HybridCache)
1062
+ and attention_mask.ndim == 2
1063
+ and not self.config._attn_implementation == "flash_attention_2"
1064
+ ):
1065
+ if model_inputs["inputs_embeds"] is not None:
1066
+ batch_size, sequence_length, _ = model_inputs["inputs_embeds"].shape
1067
+ device = model_inputs["inputs_embeds"].device
1068
+ else:
1069
+ batch_size, sequence_length = model_inputs["input_ids"].shape
1070
+ device = model_inputs["input_ids"].device
1071
+
1072
+ attention_mask = self.model._prepare_4d_causal_attention_mask_with_cache_position(
1073
+ attention_mask,
1074
+ sequence_length=sequence_length,
1075
+ target_length=past_key_values.get_max_cache_shape(),
1076
+ dtype=self.lm_head.weight.dtype,
1077
+ device=device,
1078
+ cache_position=cache_position,
1079
+ batch_size=batch_size,
1080
+ )
1081
+
1082
+ if num_logits_to_keep is not None:
1083
+ model_inputs["num_logits_to_keep"] = num_logits_to_keep
1084
+
1085
+ model_inputs.update(
1086
+ {
1087
+ "position_ids": position_ids,
1088
+ "cache_position": cache_position,
1089
+ "past_key_values": past_key_values,
1090
+ "use_cache": use_cache,
1091
+ "attention_mask": attention_mask,
1092
+ }
1093
+ )
1094
+ return model_inputs
1095
+
1096
+
1097
+ @add_start_docstrings(
1098
+ """
1099
+ The Gemma2 Model transformer with a sequence classification head on top (linear layer).
1100
+
1101
+ [`Gemma2ForSequenceClassification`] uses the last token in order to do the classification, as other causal models
1102
+ (e.g. GPT-2) do.
1103
+
1104
+ Since it does classification on the last token, it requires to know the position of the last token. If a
1105
+ `pad_token_id` is defined in the configuration, it finds the last token that is not a padding token in each row. If
1106
+ no `pad_token_id` is defined, it simply takes the last value in each row of the batch. Since it cannot guess the
1107
+ padding tokens when `inputs_embeds` are passed instead of `input_ids`, it does the same (take the last value in
1108
+ each row of the batch).
1109
+ """,
1110
+ GEMMA2_START_DOCSTRING,
1111
+ )
1112
+ class Gemma2ForSequenceClassification(Gemma2PreTrainedModel):
1113
+ def __init__(self, config):
1114
+ super().__init__(config)
1115
+ self.num_labels = config.num_labels
1116
+ self.model = Gemma2Model(config)
1117
+ self.score = nn.Linear(config.hidden_size, self.num_labels, bias=False)
1118
+
1119
+ # Initialize weights and apply final processing
1120
+ self.post_init()
1121
+
1122
+ def get_input_embeddings(self):
1123
+ return self.model.embed_tokens
1124
+
1125
+ def set_input_embeddings(self, value):
1126
+ self.model.embed_tokens = value
1127
+
1128
+ @add_start_docstrings_to_model_forward(GEMMA2_INPUTS_DOCSTRING)
1129
+ def forward(
1130
+ self,
1131
+ input_ids: Optional[torch.LongTensor] = None,
1132
+ attention_mask: Optional[torch.Tensor] = None,
1133
+ position_ids: Optional[torch.LongTensor] = None,
1134
+ past_key_values: Optional[Union[Cache, List[torch.FloatTensor]]] = None,
1135
+ inputs_embeds: Optional[torch.FloatTensor] = None,
1136
+ labels: Optional[torch.LongTensor] = None,
1137
+ use_cache: Optional[bool] = None,
1138
+ output_attentions: Optional[bool] = None,
1139
+ output_hidden_states: Optional[bool] = None,
1140
+ return_dict: Optional[bool] = None,
1141
+ ) -> Union[Tuple, SequenceClassifierOutputWithPast]:
1142
+ r"""
1143
+ labels (`torch.LongTensor` of shape `(batch_size,)`, *optional*):
1144
+ Labels for computing the sequence classification/regression loss. Indices should be in `[0, ...,
1145
+ config.num_labels - 1]`. If `config.num_labels == 1` a regression loss is computed (Mean-Square loss), If
1146
+ `config.num_labels > 1` a classification loss is computed (Cross-Entropy).
1147
+ """
1148
+ return_dict = return_dict if return_dict is not None else self.config.use_return_dict
1149
+
1150
+ transformer_outputs = self.model(
1151
+ input_ids,
1152
+ attention_mask=attention_mask,
1153
+ position_ids=position_ids,
1154
+ past_key_values=past_key_values,
1155
+ inputs_embeds=inputs_embeds,
1156
+ use_cache=use_cache,
1157
+ output_attentions=output_attentions,
1158
+ output_hidden_states=output_hidden_states,
1159
+ return_dict=return_dict,
1160
+ )
1161
+ hidden_states = transformer_outputs[0]
1162
+ logits = self.score(hidden_states)
1163
+
1164
+ if input_ids is not None:
1165
+ batch_size = input_ids.shape[0]
1166
+ else:
1167
+ batch_size = inputs_embeds.shape[0]
1168
+
1169
+ if self.config.pad_token_id is None and batch_size != 1:
1170
+ raise ValueError("Cannot handle batch sizes > 1 if no padding token is defined.")
1171
+ if self.config.pad_token_id is None:
1172
+ sequence_lengths = -1
1173
+ else:
1174
+ if input_ids is not None:
1175
+ # if no pad token found, use modulo instead of reverse indexing for ONNX compatibility
1176
+ sequence_lengths = torch.eq(input_ids, self.config.pad_token_id).int().argmax(-1) - 1
1177
+ sequence_lengths = sequence_lengths % input_ids.shape[-1]
1178
+ sequence_lengths = sequence_lengths.to(logits.device)
1179
+ else:
1180
+ sequence_lengths = -1
1181
+
1182
+ pooled_logits = logits[torch.arange(batch_size, device=logits.device), sequence_lengths]
1183
+
1184
+ loss = None
1185
+ if labels is not None:
1186
+ loss = self.loss_function(logits=logits, labels=labels, pooled_logits=pooled_logits, config=self.config)
1187
+
1188
+ if not return_dict:
1189
+ output = (pooled_logits,) + transformer_outputs[1:]
1190
+ return ((loss,) + output) if loss is not None else output
1191
+
1192
+ return SequenceClassifierOutputWithPast(
1193
+ loss=loss,
1194
+ logits=pooled_logits,
1195
+ past_key_values=transformer_outputs.past_key_values,
1196
+ hidden_states=transformer_outputs.hidden_states,
1197
+ attentions=transformer_outputs.attentions,
1198
+ )
1199
+
1200
+
1201
+ @add_start_docstrings(
1202
+ """
1203
+ The Gemma2 Model transformer with a token classification head on top (a linear layer on top of the hidden-states
1204
+ output) e.g. for Named-Entity-Recognition (NER) tasks.
1205
+ """,
1206
+ GEMMA2_START_DOCSTRING,
1207
+ )
1208
+ class Gemma2ForTokenClassification(Gemma2PreTrainedModel):
1209
+ def __init__(self, config):
1210
+ super().__init__(config)
1211
+ self.num_labels = config.num_labels
1212
+ self.model = Gemma2Model(config)
1213
+ if getattr(config, "classifier_dropout", None) is not None:
1214
+ classifier_dropout = config.classifier_dropout
1215
+ elif getattr(config, "hidden_dropout", None) is not None:
1216
+ classifier_dropout = config.hidden_dropout
1217
+ else:
1218
+ classifier_dropout = 0.1
1219
+ self.dropout = nn.Dropout(classifier_dropout)
1220
+ self.score = nn.Linear(config.hidden_size, config.num_labels)
1221
+
1222
+ # Initialize weights and apply final processing
1223
+ self.post_init()
1224
+
1225
+ def get_input_embeddings(self):
1226
+ return self.model.embed_tokens
1227
+
1228
+ def set_input_embeddings(self, value):
1229
+ self.model.embed_tokens = value
1230
+
1231
+ @add_start_docstrings_to_model_forward(GEMMA2_INPUTS_DOCSTRING)
1232
+ @add_code_sample_docstrings(
1233
+ checkpoint=_CHECKPOINT_FOR_DOC,
1234
+ output_type=TokenClassifierOutput,
1235
+ config_class=_CONFIG_FOR_DOC,
1236
+ )
1237
+ def forward(
1238
+ self,
1239
+ input_ids: Optional[torch.LongTensor] = None,
1240
+ attention_mask: Optional[torch.Tensor] = None,
1241
+ position_ids: Optional[torch.LongTensor] = None,
1242
+ past_key_values: Optional[List[torch.FloatTensor]] = None,
1243
+ inputs_embeds: Optional[torch.FloatTensor] = None,
1244
+ labels: Optional[torch.LongTensor] = None,
1245
+ use_cache: Optional[bool] = None,
1246
+ output_attentions: Optional[bool] = None,
1247
+ output_hidden_states: Optional[bool] = None,
1248
+ return_dict: Optional[bool] = None,
1249
+ ) -> Union[Tuple, TokenClassifierOutput]:
1250
+ r"""
1251
+ labels (`torch.LongTensor` of shape `(batch_size,)`, *optional*):
1252
+ Labels for computing the sequence classification/regression loss. Indices should be in `[0, ...,
1253
+ config.num_labels - 1]`. If `config.num_labels == 1` a regression loss is computed (Mean-Square loss), If
1254
+ `config.num_labels > 1` a classification loss is computed (Cross-Entropy).
1255
+ """
1256
+ return_dict = return_dict if return_dict is not None else self.config.use_return_dict
1257
+
1258
+ outputs = self.model(
1259
+ input_ids,
1260
+ attention_mask=attention_mask,
1261
+ position_ids=position_ids,
1262
+ past_key_values=past_key_values,
1263
+ inputs_embeds=inputs_embeds,
1264
+ use_cache=use_cache,
1265
+ output_attentions=output_attentions,
1266
+ output_hidden_states=output_hidden_states,
1267
+ return_dict=return_dict,
1268
+ )
1269
+ sequence_output = outputs[0]
1270
+ sequence_output = self.dropout(sequence_output)
1271
+ logits = self.score(sequence_output)
1272
+
1273
+ loss = None
1274
+ if labels is not None:
1275
+ loss = self.loss_function(logits, labels, self.config)
1276
+
1277
+ if not return_dict:
1278
+ output = (logits,) + outputs[2:]
1279
+ return ((loss,) + output) if loss is not None else output
1280
+
1281
+ return TokenClassifierOutput(
1282
+ loss=loss,
1283
+ logits=logits,
1284
+ hidden_states=outputs.hidden_states,
1285
+ attentions=outputs.attentions,
1286
+ )
modeling_spatialvla.py ADDED
@@ -0,0 +1,773 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # MIT License
2
+ # Copyright (c) 2025 IPEC at Shanghai AI Laboratory
3
+ # Permission is hereby granted, free of charge, to use, copy, modify, merge, publish,
4
+ # distribute, sublicense, and/or sell copies of the Software, subject to the following conditions:
5
+ # The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
6
+ # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND.
7
+ # Based on code licensed under the Apache License, Version 2.0 by Google Inc. and HuggingFace Inc. team (Copyright 2024).
8
+ # coding=utf-8
9
+
10
+ """PyTorch PaliGemmamodel."""
11
+
12
+ from dataclasses import dataclass
13
+ from typing import List, Optional, Tuple, Union
14
+
15
+ import torch
16
+ import torch.utils.checkpoint
17
+ from torch import nn
18
+ from torch.linalg import inv
19
+ import torchvision.transforms.functional as F
20
+
21
+ import os
22
+ from transformers.cache_utils import Cache, HybridCache, StaticCache
23
+ from transformers.generation import GenerationMixin
24
+ from transformers.modeling_utils import PreTrainedModel, PretrainedConfig
25
+ from transformers.utils import (
26
+ ModelOutput,
27
+ add_start_docstrings,
28
+ add_start_docstrings_to_model_forward,
29
+ is_flash_attn_2_available,
30
+ logging,
31
+ replace_return_docstrings,
32
+ )
33
+ from .configuration_spatialvla import SpatialVLAConfig
34
+ from .modeling_ego3d import Ego3DPositionEmbeddingMLP, process_zoe
35
+ from .modeling_gemma2 import Gemma2ForCausalLM
36
+
37
+ if is_flash_attn_2_available():
38
+ from flash_attn.bert_padding import index_first_axis, pad_input, unpad_input # noqa
39
+
40
+ from transformers import AutoModel, AutoModelForCausalLM, ZoeDepthForDepthEstimation
41
+
42
+
43
+ logger = logging.get_logger(__name__)
44
+
45
+ _CONFIG_FOR_DOC = "PaliGemmaConfig"
46
+
47
+ # constant
48
+ SIGLIP_MEAN, SIGLIP_STD = (0.5, 0.5, 0.5), (0.5, 0.5, 0.5)
49
+
50
+ # Adapted from transformers.models.llama.modeling_llama.LlamaModel._prepare_4d_causal_attention_mask_with_cache_position
51
+ # But Paligemma has no causal mask on prefix
52
+ def _prepare_4d_causal_attention_mask_with_cache_position(
53
+ attention_mask: torch.Tensor,
54
+ sequence_length: int,
55
+ target_length: int,
56
+ dtype: torch.dtype,
57
+ device: torch.device,
58
+ min_dtype: float,
59
+ cache_position: torch.Tensor,
60
+ batch_size: int,
61
+ is_training: bool = False,
62
+ token_type_ids: torch.Tensor = None,
63
+ **kwargs,
64
+ ):
65
+ """
66
+ Creates a causal 4D mask of shape `(batch_size, 1, query_length, key_value_length)` from a 2D mask of shape
67
+ `(batch_size, key_value_length)`, or if the input `attention_mask` is already 4D, do nothing.
68
+
69
+ Args:
70
+ attention_mask (`torch.Tensor`):
71
+ A 2D attention mask of shape `(batch_size, key_value_length)` or a 4D attention mask of shape `(batch_size, 1, query_length, key_value_length)`.
72
+ sequence_length (`int`):
73
+ The sequence length being processed.
74
+ target_length (`int`):
75
+ The target length: when generating with static cache, the mask should be as long as the static cache, to account for the 0 padding, the part of the cache that is not filled yet.
76
+ dtype (`torch.dtype`):
77
+ The dtype to use for the 4D attention mask.
78
+ device (`torch.device`):
79
+ The device to plcae the 4D attention mask on.
80
+ min_dtype (`float`):
81
+ The minimum value representable with the dtype `dtype`.
82
+ cache_position (`torch.Tensor`):
83
+ Indices depicting the position of the input sequence tokens in the sequence.
84
+ batch_size (`torch.Tensor`):
85
+ Batch size.
86
+ is_training (`bool`):
87
+ Whether the model is in training mode or in inference. The condition is checked by presence/absence of `token_type_ids/labels`
88
+ """
89
+ if attention_mask is not None and attention_mask.dim() == 4:
90
+ # In this case we assume that the mask comes already in inverted form and requires no inversion or slicing.
91
+ causal_mask = attention_mask
92
+ else:
93
+ causal_mask = torch.full((sequence_length, target_length), fill_value=min_dtype, dtype=dtype, device=device)
94
+ # Causal diagonal mask only if training, otherwise attend to the whole prefix. Training-specific attn for prefix is handled below
95
+ if sequence_length != 1:
96
+ if is_training:
97
+ causal_mask = torch.triu(causal_mask, diagonal=1)
98
+ else:
99
+ causal_mask[:, :sequence_length] = 0.0
100
+
101
+ causal_mask *= torch.arange(target_length, device=cache_position.device) > cache_position.reshape(-1, 1)
102
+ causal_mask = causal_mask[None, None, :, :].expand(batch_size, 1, -1, -1)
103
+ if attention_mask is not None:
104
+ causal_mask = causal_mask.clone() # copy to contiguous memory for in-place edit
105
+ mask_length = attention_mask.shape[-1]
106
+ padding_mask = causal_mask[:, :, :, :mask_length] + attention_mask[:, None, None, :].to(causal_mask.device)
107
+ padding_mask = padding_mask == 0
108
+ causal_mask[:, :, :, :mask_length] = causal_mask[:, :, :, :mask_length].masked_fill(
109
+ padding_mask, min_dtype
110
+ )
111
+ # we are training thus we need to create a full mask on the image + prefix but causal on suffix
112
+ if is_training:
113
+ causal_mask[:, :, :, :mask_length] = causal_mask[:, :, :, :mask_length].masked_fill(
114
+ token_type_ids[:, None, None, :].to(causal_mask.device) == 0, 0
115
+ )
116
+ return causal_mask
117
+
118
+
119
+ @dataclass
120
+ class SpatialVLACausalLMOutputWithPast(ModelOutput):
121
+ """
122
+ Base class for PaliGemmacausal language model (or autoregressive) outputs.
123
+
124
+ Args:
125
+ loss (`torch.FloatTensor` of shape `(1,)`, *optional*, returned when `labels` is provided):
126
+ Language modeling loss (for next-token prediction).
127
+ logits (`torch.FloatTensor` of shape `(batch_size, sequence_length, config.text_config.vocab_size)`):
128
+ Prediction scores of the language modeling head (scores for each vocabulary token before SoftMax).
129
+ past_key_values (`tuple(tuple(torch.FloatTensor))`, *optional*, returned when `use_cache=True` is passed or when `config.use_cache=True`):
130
+ Tuple of `tuple(torch.FloatTensor)` of length `config.n_layers`, with each tuple having 2 tensors of shape
131
+ `(batch_size, num_heads, sequence_length, embed_size_per_head)`)
132
+
133
+ Contains pre-computed hidden-states (key and values in the self-attention blocks) that can be used (see
134
+ `past_key_values` input) to speed up sequential decoding.
135
+ hidden_states (`tuple(torch.FloatTensor)`, *optional*, returned when `output_hidden_states=True` is passed or when `config.output_hidden_states=True`):
136
+ Tuple of `torch.FloatTensor` (one for the output of the embeddings, if the model has an embedding layer, +
137
+ one for the output of each layer) of shape `(batch_size, sequence_length, hidden_size)`.
138
+
139
+ Hidden-states of the model at the output of each layer plus the optional initial embedding outputs.
140
+ attentions (`tuple(torch.FloatTensor)`, *optional*, returned when `output_attentions=True` is passed or when `config.output_attentions=True`):
141
+ Tuple of `torch.FloatTensor` (one for each layer) of shape `(batch_size, num_heads, sequence_length,
142
+ sequence_length)`.
143
+
144
+ Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
145
+ heads.
146
+ image_hidden_states (`torch.FloatTensor`, *optional*):
147
+ A `torch.FloatTensor` of size `(batch_size, num_images, sequence_length, hidden_size)`.
148
+ image_hidden_states of the model produced by the vision encoder after projecting last hidden state.
149
+ """
150
+
151
+ loss: Optional[torch.FloatTensor] = None
152
+ logits: torch.FloatTensor = None
153
+ past_key_values: Optional[Union[List[torch.FloatTensor], Cache]] = None
154
+ hidden_states: Optional[Tuple[torch.FloatTensor]] = None
155
+ attentions: Optional[Tuple[torch.FloatTensor]] = None
156
+ image_hidden_states: Optional[torch.FloatTensor] = None
157
+
158
+
159
+ class SpatialVLAMultiModalProjector(nn.Module):
160
+ def __init__(self, config: SpatialVLAConfig):
161
+ super().__init__()
162
+ self.linear = nn.Linear(config.vision_config.hidden_size, config.vision_config.projection_dim, bias=True)
163
+
164
+ def forward(self, image_features):
165
+ hidden_states = self.linear(image_features)
166
+
167
+ return hidden_states
168
+
169
+
170
+ PALIGEMMA_START_DOCSTRING = r"""
171
+ This model inherits from [`PreTrainedModel`]. Check the superclass documentation for the generic methods the
172
+ library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
173
+ etc.)
174
+
175
+ This model is also a PyTorch [torch.nn.Module](https://pytorch.org/docs/stable/nn.html#torch.nn.Module) subclass.
176
+ Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
177
+ and behavior.
178
+
179
+ Parameters:
180
+ config ([`PaliGemmaConfig`] or [`PaliGemmaVisionConfig`]):
181
+ Model configuration class with all the parameters of the model. Initializing with a config file does not
182
+ load the weights associated with the model, only the configuration. Check out the
183
+ [`~PreTrainedModel.from_pretrained`] method to load the model weights.
184
+ """
185
+
186
+
187
+ @add_start_docstrings(
188
+ "The bare LLaMA Model outputting raw hidden-states without any specific head on top.",
189
+ PALIGEMMA_START_DOCSTRING,
190
+ )
191
+ class SpatialVLAPreTrainedModel(PreTrainedModel):
192
+ config_class = SpatialVLAConfig
193
+ base_model_prefix = "model"
194
+ supports_gradient_checkpointing = True
195
+ _no_split_modules = ["SpatialVLAMultiModalProjector", "ZoeDepthForDepthEstimation", "Ego3DPositionEmbeddingMLP"]
196
+ _skip_keys_device_placement = "past_key_values"
197
+ _supports_cache_class = True
198
+ _supports_quantized_cache = True
199
+ _supports_static_cache = True
200
+ _supports_cache_class = True
201
+ _supports_flash_attn_2 = True
202
+ _supports_sdpa = True
203
+
204
+ def _init_weights(self, module):
205
+ # important: this ported version of PaliGemmaisn't meant for training from scratch - only
206
+ # inference and fine-tuning
207
+ std = (
208
+ self.config.initializer_range
209
+ if hasattr(self.config, "initializer_range")
210
+ else self.config.text_config.initializer_range
211
+ )
212
+
213
+ if hasattr(module, "class_embedding"):
214
+ module.class_embedding.data.normal_(mean=0.0, std=std)
215
+
216
+ if isinstance(module, (nn.Linear, nn.Conv2d)):
217
+ module.weight.data.normal_(mean=0.0, std=std)
218
+ if module.bias is not None:
219
+ module.bias.data.zero_()
220
+ elif isinstance(module, nn.Embedding):
221
+ module.weight.data.normal_(mean=0.0, std=std)
222
+ if module.padding_idx is not None:
223
+ module.weight.data[module.padding_idx].zero_()
224
+
225
+
226
+ PALIGEMMA_INPUTS_DOCSTRING = r"""
227
+ Args:
228
+ input_ids (`torch.LongTensor` of shape `(batch_size, sequence_length)`):
229
+ Indices of input sequence tokens in the vocabulary. Padding will be ignored by default should you provide
230
+ it.
231
+
232
+ Indices can be obtained using [`AutoTokenizer`]. See [`PreTrainedTokenizer.encode`] and
233
+ [`PreTrainedTokenizer.__call__`] for details.
234
+
235
+ [What are input IDs?](../glossary#input-ids)
236
+ pixel_values (`torch.FloatTensor` of shape `(batch_size, num_channels, image_size, image_size)):
237
+ The tensors corresponding to the input images. Pixel values can be obtained using
238
+ [`AutoImageProcessor`]. See [`SiglipImageProcessor.__call__`] for details ([]`PaliGemmaProcessor`] uses
239
+ [`SiglipImageProcessor`] for processing images).
240
+ attention_mask (`torch.Tensor` of shape `(batch_size, sequence_length)`, *optional*):
241
+ Mask to avoid performing attention on padding token indices. Mask values selected in `[0, 1]`:
242
+
243
+ - 1 for tokens that are **not masked**,
244
+ - 0 for tokens that are **masked**.
245
+
246
+ [What are attention masks?](../glossary#attention-mask)
247
+
248
+ Indices can be obtained using [`AutoTokenizer`]. See [`PreTrainedTokenizer.encode`] and
249
+ [`PreTrainedTokenizer.__call__`] for details.
250
+
251
+ If `past_key_values` is used, optionally only the last `decoder_input_ids` have to be input (see
252
+ `past_key_values`).
253
+
254
+ If you want to change padding behavior, you should read [`modeling_opt._prepare_decoder_attention_mask`]
255
+ and modify to your needs. See diagram 1 in [the paper](https://arxiv.org/abs/1910.13461) for more
256
+ information on the default strategy.
257
+
258
+ - 1 indicates the head is **not masked**,
259
+ - 0 indicates the head is **masked**.
260
+ position_ids (`torch.LongTensor` of shape `(batch_size, sequence_length)`, *optional*):
261
+ Indices of positions of each input sequence tokens in the position embeddings. Selected in the range `[0,
262
+ config.n_positions - 1]`. [What are position IDs?](../glossary#position-ids)
263
+ past_key_values (`tuple(tuple(torch.FloatTensor))`, *optional*, returned when `use_cache=True` is passed or when `config.use_cache=True`):
264
+ Tuple of `tuple(torch.FloatTensor)` of length `config.n_layers`, with each tuple having 2 tensors of shape
265
+ `(batch_size, num_heads, sequence_length, embed_size_per_head)`) and 2 additional tensors of shape
266
+ `(batch_size, num_heads, encoder_sequence_length, embed_size_per_head)`.
267
+
268
+ Contains pre-computed hidden-states (key and values in the self-attention blocks and in the cross-attention
269
+ blocks) that can be used (see `past_key_values` input) to speed up sequential decoding.
270
+
271
+ If `past_key_values` are used, the user can optionally input only the last `decoder_input_ids` (those that
272
+ don't have their past key value states given to this model) of shape `(batch_size, 1)` instead of all
273
+ `decoder_input_ids` of shape `(batch_size, sequence_length)`.
274
+ inputs_embeds (`torch.FloatTensor` of shape `(batch_size, sequence_length, hidden_size)`, *optional*):
275
+ Optionally, instead of passing `input_ids` you can choose to directly pass an embedded representation. This
276
+ is useful if you want more control over how to convert `input_ids` indices into associated vectors than the
277
+ model's internal embedding lookup matrix.
278
+ use_cache (`bool`, *optional*):
279
+ If set to `True`, `past_key_values` key value states are returned and can be used to speed up decoding (see
280
+ `past_key_values`).
281
+ output_attentions (`bool`, *optional*):
282
+ Whether or not to return the attentions tensors of all attention layers. See `attentions` under returned
283
+ tensors for more detail.
284
+ output_hidden_states (`bool`, *optional*):
285
+ Whether or not to return the hidden states of all layers. See `hidden_states` under returned tensors for
286
+ more detail.
287
+ return_dict (`bool`, *optional*):
288
+ Whether or not to return a [`~utils.ModelOutput`] instead of a plain tuple.
289
+ cache_position (`torch.LongTensor` of shape `(sequence_length)`, *optional*):
290
+ Indices depicting the position of the input sequence tokens in the sequence. Contrarily to `position_ids`,
291
+ this tensor is not affected by padding. It is used to update the cache in the correct position and to infer
292
+ the complete sequence length.
293
+ """
294
+
295
+
296
+ @add_start_docstrings(
297
+ """The PALIGEMMA model which consists of a vision backbone and a language model.""",
298
+ PALIGEMMA_START_DOCSTRING,
299
+ )
300
+ class SpatialVLAForConditionalGeneration(SpatialVLAPreTrainedModel, GenerationMixin):
301
+ def __init__(self, config: SpatialVLAConfig, vision_model=None, vision_zoe_model=None, projector_model=None, language_model=None):
302
+ super().__init__(config)
303
+ # vision model
304
+ self.vision_tower = vision_model or AutoModel.from_config(config=config.vision_config)
305
+ # projector
306
+ self.multi_modal_projector = projector_model or SpatialVLAMultiModalProjector(config)
307
+ # language model
308
+ self.vocab_size = config.text_config.vocab_size
309
+ if language_model is None:
310
+ language_model = Gemma2ForCausalLM(config=config.text_config) if config.text_config.model_type == "gemma2" else AutoModelForCausalLM.from_config(config=config.text_config)
311
+ # set tile key
312
+ if language_model._tied_weights_keys is not None:
313
+ self._tied_weights_keys = [f"language_model.{k}" for k in language_model._tied_weights_keys]
314
+ self.language_model = language_model
315
+
316
+ if config.use_vision_zoe:
317
+ # zoe model
318
+ self.vision_zoe_model = vision_zoe_model or ZoeDepthForDepthEstimation(config.vision_zoe_config)
319
+ self.position_embedding_3d = Ego3DPositionEmbeddingMLP(
320
+ config.ego3d_patch_reso**2 * 3, num_pos_feats=config.vision_config.hidden_size, n_freqs=config.n_freqs
321
+ )
322
+ # register buffer
323
+ patch_size, reso, image_size = config.vision_config.patch_size, config.ego3d_patch_reso, config.vision_config.image_size
324
+ y, x = torch.meshgrid(torch.arange(0, image_size, patch_size // reso), torch.arange(0, image_size, patch_size // reso), indexing="ij") # (h//sp w//sp)
325
+ y, x = y + patch_size / reso / 2, x + patch_size / reso / 2
326
+ uv_h = torch.stack([x, y, torch.ones_like(x)], dim=0).reshape(3, -1) # (3 hw)
327
+ self.register_buffer("uv_h", uv_h, persistent=False)
328
+
329
+ # NOTE: add shared addtional spatial token embeddings for <ACTION> <IMG>
330
+ if config.use_spatial_token:
331
+ self.spatial_embed_tokens = nn.Embedding(self.config.spatial_token_num, config.text_config.hidden_size)
332
+ else:
333
+ self.spatial_embed_tokens = None
334
+
335
+ self.pad_token_id = self.config.pad_token_id if self.config.pad_token_id is not None else -1
336
+ # self.post_init() # BUG: cause from_pretrained failed!
337
+ # self.position_embedding_3d._reset_parameters()
338
+
339
+
340
+ def backproject_patch(self, K: torch.Tensor, depth: torch.Tensor, patch_size=14, reso=2) -> torch.Tensor:
341
+ """
342
+ Backproject depth map to 3D points in camera coordinate.
343
+ Args:
344
+ K: camera intrinsic matrix (b 3 3)
345
+ depth: depth map (b 1 h w)
346
+ pixel_offset: offset to the pixel coordinate
347
+ """
348
+ # __import__("ipdb").set_trace()
349
+ b, c, h, w = depth.shape
350
+ hp, wp = h // patch_size, w // patch_size
351
+ sub_hp = sub_wp = reso
352
+ patch_depth = torch.nn.functional.interpolate(depth, size=(hp * reso, wp * reso), mode="area").reshape(b, c, -1)
353
+
354
+ # import torchvision; torchvision.utils.save_image(zoe_pixel_values[0], "zoe_image.png")
355
+ p_cam = (inv(K.float()) @ self.uv_h.float()) * patch_depth # (b 3 3) @ (3 hw) -> (b 3 hw) * (b 1 hw) -> (b 3 hw)
356
+ patch_p_cam = p_cam.reshape(b, 3, hp, sub_hp, wp, sub_wp).permute(0, 2, 4, 3, 5, 1).reshape(b, hp * wp, -1)
357
+ return patch_p_cam
358
+
359
+ # Copied from transformers.models.llava.modeling_llava.LlavaForConditionalGeneration.get_input_embeddings with Llava->PaliGemma
360
+ def get_input_embeddings(self):
361
+ return self.language_model.get_input_embeddings()
362
+
363
+ # Copied from transformers.models.llava.modeling_llava.LlavaForConditionalGeneration.set_input_embeddings with Llava->PaliGemma
364
+ def set_input_embeddings(self, value):
365
+ self.language_model.set_input_embeddings(value)
366
+
367
+ # Copied from transformers.models.llava.modeling_llava.LlavaForConditionalGeneration.get_output_embeddings with Llava->PaliGemma
368
+ def get_output_embeddings(self):
369
+ return self.language_model.get_output_embeddings()
370
+
371
+ # Copied from transformers.models.llava.modeling_llava.LlavaForConditionalGeneration.set_output_embeddings with Llava->PaliGemma
372
+ def set_output_embeddings(self, new_embeddings):
373
+ self.language_model.set_output_embeddings(new_embeddings)
374
+
375
+ # Copied from transformers.models.llava.modeling_llava.LlavaForConditionalGeneration.set_decoder with Llava->PaliGemma
376
+ def set_decoder(self, decoder):
377
+ self.language_model.set_decoder(decoder)
378
+
379
+ # Copied from transformers.models.llava.modeling_llava.LlavaForConditionalGeneration.get_decoder with Llava->PaliGemma
380
+ def get_decoder(self):
381
+ return self.language_model.get_decoder()
382
+
383
+ # Copied from transformers.models.llava.modeling_llava.LlavaForConditionalGeneration.tie_weights with Llava->PaliGemma
384
+ def tie_weights(self):
385
+ return self.language_model.tie_weights()
386
+
387
+ def resize_token_embeddings(
388
+ self,
389
+ new_num_tokens: Optional[int] = None,
390
+ pad_to_multiple_of: Optional[int] = None,
391
+ mean_resizing: bool = True,
392
+ ) -> nn.Embedding:
393
+ # TODO: is_deepspeed_zero3_enabled gather
394
+ print(f"resize token embeddings from {self.language_model.get_output_embeddings().weight.shape} to (*,{new_num_tokens})")
395
+ model_embeds = self.language_model.resize_token_embeddings(new_num_tokens, pad_to_multiple_of, mean_resizing)
396
+
397
+ # update base model and current model config
398
+ vocab_size = model_embeds.weight.shape[0]
399
+ self.config.text_config.vocab_size = self.vocab_size = self.config._vocab_size = vocab_size
400
+ self.tie_weights()
401
+ return model_embeds
402
+
403
+ def _update_causal_mask(
404
+ self,
405
+ attention_mask,
406
+ token_type_ids,
407
+ past_key_values,
408
+ cache_position,
409
+ input_ids=None,
410
+ inputs_embeds=None,
411
+ is_training: bool = False,
412
+ ):
413
+ if self.config.text_config._attn_implementation == "flash_attention_2":
414
+ if attention_mask is not None and 0.0 in attention_mask:
415
+ return attention_mask
416
+ return None
417
+
418
+ using_static_cache = isinstance(past_key_values, StaticCache)
419
+ min_dtype = torch.finfo(self.dtype).min
420
+ inputs_lead_dim = input_ids.shape[0] if input_ids is not None else inputs_embeds.shape[0]
421
+ sequence_length = input_ids.shape[1] if input_ids is not None else inputs_embeds.shape[1]
422
+ if using_static_cache:
423
+ target_length = past_key_values.get_max_cache_shape()
424
+ elif isinstance(past_key_values, HybridCache):
425
+ target_length = past_key_values.get_max_cache_shape()
426
+ else:
427
+ target_length = (
428
+ attention_mask.shape[-1]
429
+ if isinstance(attention_mask, torch.Tensor)
430
+ else cache_position[0] + sequence_length + 1
431
+ )
432
+
433
+ if attention_mask is not None and attention_mask.dim() == 4:
434
+ # In this case we assume that the mask comes already in inverted form and requires no inversion or slicing.
435
+ return attention_mask
436
+
437
+ causal_mask = torch.full(
438
+ (sequence_length, target_length), fill_value=min_dtype, dtype=self.dtype, device=cache_position.device
439
+ )
440
+ # Causal diagonal mask only if training, otherwise attend to the whole prefix. Training-specific attn for prefix is handled below
441
+ if sequence_length != 1:
442
+ if is_training:
443
+ causal_mask = torch.triu(causal_mask, diagonal=1)
444
+ else:
445
+ causal_mask[:, :sequence_length] = 0.0
446
+
447
+ causal_mask *= torch.arange(target_length, device=cache_position.device) > cache_position.reshape(-1, 1)
448
+ causal_mask = causal_mask[None, None, :, :].expand(inputs_lead_dim, 1, -1, -1)
449
+ if attention_mask is not None:
450
+ causal_mask = causal_mask.clone() # copy to contiguous memory for in-place edit
451
+ mask_length = attention_mask.shape[-1]
452
+ padding_mask = causal_mask[:, :, :, :mask_length] + attention_mask[:, None, None, :].to(causal_mask.device)
453
+ padding_mask = padding_mask == 0
454
+ causal_mask[:, :, :, :mask_length] = causal_mask[:, :, :, :mask_length].masked_fill(
455
+ padding_mask, min_dtype
456
+ )
457
+ # we are training thus we need to create a full mask on the image + prefix but causal on suffix
458
+ if is_training:
459
+ causal_mask[:, :, :, :mask_length] = causal_mask[:, :, :, :mask_length].masked_fill(
460
+ token_type_ids[:, None, None, :].to(causal_mask.device) == 0, 0
461
+ )
462
+ return causal_mask
463
+
464
+ def get_image_features(self, pixel_values: torch.FloatTensor, intrinsic: torch.FloatTensor):
465
+ """
466
+ Obtains image last hidden states from the vision tower and apply multimodal projection.
467
+
468
+ Args:
469
+ pixel_values (`torch.FloatTensor]` of shape `(batch_size, channels, height, width)`)
470
+ The tensors corresponding to the input images.
471
+ Returns:
472
+ image_features (`torch.Tensor`): Image feature tensor of shape `(num_images, image_length, embed_dim)`).
473
+ """
474
+ # mintrinsic = intrinsic.reshape(-1, 3, 3)
475
+ # siglip vision tower
476
+ siglip_pixel_values = F.normalize(pixel_values, mean=SIGLIP_MEAN, std=SIGLIP_STD)
477
+ image_outputs = self.vision_tower(siglip_pixel_values)
478
+
479
+ # ego3d position encoding
480
+ if self.config.use_vision_zoe:
481
+ zoe_pixel_values, ph, pw = process_zoe(pixel_values, pad_mode="reflect")
482
+ with torch.no_grad():
483
+ pvh, pvw = pixel_values.shape[-2:]
484
+ depth = self.vision_zoe_model(pixel_values=zoe_pixel_values).predicted_depth
485
+ depth = torch.nn.functional.interpolate(
486
+ depth.unsqueeze(1),
487
+ size=(pvh+2*ph, pvw+2*pw),
488
+ mode="bicubic",
489
+ align_corners=True,
490
+ )[..., ph:-ph, pw:-pw]
491
+ # depth = torch.clamp(depth, 0., 4.0) # NOTE: we find that depth w/o clamp performs better
492
+ xyz = self.backproject_patch(
493
+ intrinsic, depth, patch_size=self.config.vision_config.patch_size, reso=self.config.ego3d_patch_reso
494
+ ) # (b, n, 3*4)
495
+ pos_embed_3d = self.position_embedding_3d(xyz)
496
+ selected_image_feature = image_outputs.last_hidden_state + pos_embed_3d
497
+ else:
498
+ selected_image_feature = image_outputs.last_hidden_state
499
+ image_features = self.multi_modal_projector(selected_image_feature)
500
+ image_features = image_features / (self.config.text_config.hidden_size**0.5)
501
+ return image_features
502
+
503
+ @add_start_docstrings_to_model_forward(PALIGEMMA_INPUTS_DOCSTRING)
504
+ @replace_return_docstrings(output_type=SpatialVLACausalLMOutputWithPast, config_class=_CONFIG_FOR_DOC)
505
+ def forward(
506
+ self,
507
+ input_ids: torch.LongTensor = None,
508
+ pixel_values: torch.FloatTensor = None,
509
+ actions: Optional[torch.FloatTensor] = None,
510
+ intrinsic: Optional[torch.Tensor] = None,
511
+ attention_mask: Optional[torch.Tensor] = None,
512
+ position_ids: Optional[torch.LongTensor] = None,
513
+ past_key_values: Optional[Union[List[torch.FloatTensor], Cache]] = None,
514
+ token_type_ids: Optional[torch.LongTensor] = None,
515
+ cache_position: Optional[torch.LongTensor] = None,
516
+ inputs_embeds: Optional[torch.FloatTensor] = None,
517
+ labels: Optional[torch.LongTensor] = None,
518
+ use_cache: Optional[bool] = None,
519
+ output_attentions: Optional[bool] = None,
520
+ output_hidden_states: Optional[bool] = None,
521
+ return_dict: Optional[bool] = None,
522
+ num_logits_to_keep: int = 0,
523
+ ) -> Union[Tuple, SpatialVLACausalLMOutputWithPast]:
524
+ r"""
525
+ Args:
526
+ labels (`torch.LongTensor` of shape `(batch_size, sequence_length)`, *optional*):
527
+ Labels for computing the masked language modeling loss. Indices should either be in `[0, ...,
528
+ config.text_config.vocab_size]` or -100 (see `input_ids` docstring). Tokens with indices set to `-100` are ignored
529
+ (masked), the loss is only computed for the tokens with labels in `[0, ..., config.text_config.vocab_size]`.
530
+
531
+ num_logits_to_keep (`int`, *optional*):
532
+ Calculate logits for the last `num_logits_to_keep` tokens. If `0`, calculate logits for all
533
+ `input_ids` (special case). Only last token logits are needed for generation, and calculating them only for that
534
+ token can save memory, which becomes pretty significant for long sequences or large vocabulary size.
535
+
536
+ Returns:
537
+
538
+ Example:
539
+
540
+ ```python
541
+ >>> from PIL import Image
542
+ >>> import requests
543
+ >>> from transformers import AutoProcessor, PaliGemmaForConditionalGeneration
544
+
545
+ >>> model = PaliGemmaForConditionalGeneration.from_pretrained("google/PaliGemma-test-224px-hf")
546
+ >>> processor = AutoProcessor.from_pretrained("google/PaliGemma-test-224px-hf")
547
+
548
+ >>> prompt = "answer en Where is the cow standing?"
549
+ >>> url = "https://huggingface.co/gv-hf/PaliGemma-test-224px-hf/resolve/main/cow_beach_1.png"
550
+ >>> image = Image.open(requests.get(url, stream=True).raw)
551
+
552
+ >>> inputs = processor(images=image, text=prompt, return_tensors="pt")
553
+
554
+ >>> # Generate
555
+ >>> generate_ids = model.generate(**inputs, max_length=30)
556
+ >>> processor.batch_decode(generate_ids, skip_special_tokens=True, clean_up_tokenization_spaces=False)[0]
557
+ "answer en Where is the cow standing?\nbeach"
558
+ ```"""
559
+ # print(f"**************************************\n \
560
+ # input_ids {input_ids} \n \
561
+ # labels {labels} \n \
562
+ # token_type_ids {token_type_ids} \n \
563
+ # attention_mask {attention_mask} \n \
564
+ # actions {actions} \n \
565
+ # **************************************"
566
+ # )
567
+ # print(f"model.language_model.config._attn_implementation {self.language_model.config._attn_implementation} model.config.vision_config._attn_implementation_internal {self.config.vision_config._attn_implementation_internal} \n \
568
+ # model.vision_tower.config._attn_implementation {self.vision_tower.config._attn_implementation} model.config.vision_config._attn_implementation_internal {self.config.vision_config._attn_implementation_internal}")
569
+ # __import__("ipdb").set_trace()
570
+ if (input_ids is None) ^ (inputs_embeds is not None):
571
+ raise ValueError("You must specify exactly one of input_ids or inputs_embeds")
572
+
573
+ if pixel_values is not None and inputs_embeds is not None:
574
+ raise ValueError(
575
+ "You cannot specify both pixel_values and inputs_embeds at the same time, and must specify either one"
576
+ )
577
+
578
+ output_attentions = output_attentions if output_attentions is not None else self.config.output_attentions
579
+ output_hidden_states = (
580
+ output_hidden_states if output_hidden_states is not None else self.config.output_hidden_states
581
+ )
582
+ return_dict = return_dict if return_dict is not None else self.config.use_return_dict
583
+
584
+ is_training = token_type_ids is not None and labels is not None
585
+
586
+ if inputs_embeds is None:
587
+ inputs_embeds = self.get_input_embeddings()(input_ids).clone() ## avoid checkpint grad True
588
+
589
+ # NOTE: replace the fixed embeddings with trainable spatial embeddings
590
+ # BUG: LoRA causes inputs_embeds requires_grad = True
591
+ # peft: https://github.com/huggingface/peft/blob/ec92cdcc41fe1b141bfe1e0da69b38a7e601cc80/src/peft/peft_model.py#L687
592
+ # hf: https://github.com/huggingface/transformers/blob/05260a1fc1c8571a2b421ce72b680d5f1bc3e5a4/src/transformers/modeling_utils.py#L2545
593
+ # lora w/ prompt: https://discuss.huggingface.co/t/combine-between-lora-and-prompt-tunning/65151
594
+ if self.config.use_spatial_token:
595
+ spatial_selected = (input_ids >= self.config.action_token_begin_idx) & (input_ids < self.config.action_token_begin_idx + self.config.spatial_token_num)
596
+ inputs_embeds[spatial_selected] = inputs_embeds[spatial_selected] * 0.0 + self.spatial_embed_tokens(input_ids[spatial_selected] - self.config.action_token_begin_idx)
597
+
598
+ if cache_position is None:
599
+ past_seen_tokens = past_key_values.get_seq_length() if past_key_values is not None else 0
600
+ cache_position = torch.arange(
601
+ past_seen_tokens, past_seen_tokens + inputs_embeds.shape[1], device=inputs_embeds.device
602
+ )
603
+
604
+ if position_ids is None:
605
+ position_ids = cache_position.unsqueeze(0) + 1 # Paligemma positions are 1-indexed
606
+
607
+ # Merge text and images
608
+ if pixel_values is not None:
609
+ image_features = self.get_image_features(pixel_values, intrinsic)
610
+
611
+ special_image_mask = (input_ids == self.config.image_token_index).unsqueeze(-1)
612
+ special_image_mask = special_image_mask.expand_as(inputs_embeds).to(inputs_embeds.device)
613
+ if inputs_embeds[special_image_mask].numel() != image_features.numel():
614
+ image_tokens_in_text = torch.sum(input_ids == self.config.image_token_index)
615
+ raise ValueError(
616
+ f"Number of images does not match number of special image tokens in the input text. "
617
+ f"Got {image_tokens_in_text} image tokens in the text but {image_features.shape[0] * image_features.shape[1]} "
618
+ "tokens from image embeddings."
619
+ )
620
+ image_features = image_features.to(inputs_embeds.device, inputs_embeds.dtype)
621
+ inputs_embeds = inputs_embeds.masked_scatter(special_image_mask, image_features)
622
+
623
+ # mask out pad-token-ids in labels for BC
624
+ if labels is not None and self.pad_token_id in labels:
625
+ logger.warning_once(
626
+ "`labels` contains `pad_token_id` which will be masked with `config.ignore_index`. ",
627
+ "You have to mask out `pad_token_id` when preparing `labels`, this behavior will be removed in v.4.46.",
628
+ )
629
+ labels = torch.where(input_ids == self.pad_token_id, self.config.ignore_index, labels)
630
+
631
+ causal_mask = self._update_causal_mask(
632
+ attention_mask, token_type_ids, past_key_values, cache_position, input_ids, inputs_embeds, is_training
633
+ )
634
+ outputs = self.language_model(
635
+ attention_mask=causal_mask,
636
+ position_ids=position_ids,
637
+ past_key_values=past_key_values,
638
+ inputs_embeds=inputs_embeds,
639
+ use_cache=use_cache,
640
+ output_attentions=output_attentions,
641
+ output_hidden_states=output_hidden_states,
642
+ return_dict=return_dict,
643
+ cache_position=cache_position,
644
+ num_logits_to_keep=num_logits_to_keep,
645
+ )
646
+
647
+ logits = outputs.logits
648
+ loss = None
649
+ if labels is not None:
650
+ # Upcast to float if we need to compute the loss to avoid potential precision issues
651
+ logits = logits.float()
652
+ shift_logits = logits[..., :-1, :]
653
+ shift_labels = labels[..., 1:]
654
+ if attention_mask is not None:
655
+ # we use the input attention mask to shift the logits and labels, because it is 2D.
656
+ # we also crop attn mask in case it is longer, which happens in PrefixTuning with peft
657
+ shift_attention_mask = attention_mask[:, -shift_logits.shape[1] :].to(logits.device)
658
+ shift_logits = shift_logits[shift_attention_mask.to(logits.device) != 0].contiguous()
659
+ shift_labels = shift_labels[shift_attention_mask.to(shift_labels.device) != 0].contiguous()
660
+ else:
661
+ shift_logits = shift_logits.contiguous()
662
+ shift_labels = shift_labels.contiguous()
663
+ # Flatten the tokens
664
+ loss_fct = nn.CrossEntropyLoss()
665
+
666
+ flat_logits = shift_logits.view(-1, self.config.text_config.vocab_size)
667
+ flat_labels = shift_labels.view(-1).to(shift_logits.device)
668
+ loss = loss_fct(flat_logits, flat_labels)
669
+ if not return_dict:
670
+ output = (logits,) + outputs[1:]
671
+ return (loss,) + output if loss is not None else output
672
+
673
+ return SpatialVLACausalLMOutputWithPast(
674
+ loss=loss,
675
+ logits=logits,
676
+ past_key_values=outputs.past_key_values,
677
+ hidden_states=outputs.hidden_states,
678
+ attentions=outputs.attentions,
679
+ image_hidden_states=image_features if pixel_values is not None else None,
680
+ )
681
+
682
+ def prepare_inputs_for_generation(
683
+ self,
684
+ input_ids,
685
+ past_key_values=None,
686
+ inputs_embeds=None,
687
+ cache_position=None,
688
+ position_ids=None,
689
+ pixel_values=None,
690
+ intrinsic=None,
691
+ attention_mask=None,
692
+ token_type_ids=None,
693
+ use_cache=True,
694
+ num_logits_to_keep=None,
695
+ labels=None,
696
+ **kwargs,
697
+ ):
698
+ # Overwritten -- custom `position_ids` and `pixel_values` handling
699
+ model_inputs = self.language_model.prepare_inputs_for_generation(
700
+ input_ids,
701
+ past_key_values=past_key_values,
702
+ inputs_embeds=inputs_embeds,
703
+ attention_mask=attention_mask,
704
+ position_ids=position_ids,
705
+ cache_position=cache_position,
706
+ use_cache=use_cache,
707
+ num_logits_to_keep=num_logits_to_keep,
708
+ token_type_ids=token_type_ids,
709
+ **kwargs,
710
+ )
711
+
712
+ # position_ids in Paligemma are 1-indexed
713
+ if model_inputs.get("position_ids") is not None:
714
+ model_inputs["position_ids"] += 1
715
+ # If we're in cached decoding stage, pixel values should be None because input ids do not contain special image token anymore
716
+ # Otherwise we need pixel values to be passed to model. NOTE: use_cache=False needs pixel_values always
717
+ if cache_position[0] == 0:
718
+ model_inputs["pixel_values"] = pixel_values
719
+ is_training = token_type_ids is not None and labels is not None
720
+ if cache_position[0] == 0 and isinstance(past_key_values, HybridCache):
721
+ causal_mask = self._update_causal_mask(
722
+ attention_mask, token_type_ids, past_key_values, cache_position, input_ids, inputs_embeds, is_training
723
+ )
724
+ model_inputs["attention_mask"] = causal_mask
725
+ model_inputs["intrinsic"] = intrinsic
726
+ return model_inputs
727
+
728
+ @torch.no_grad()
729
+ def predict_action(
730
+ self,
731
+ model_inputs,
732
+ ) -> torch.Tensor:
733
+ model_inputs = model_inputs.to(torch.bfloat16).to(self.device)
734
+ input_len = model_inputs["input_ids"].shape[-1]
735
+ generation_outputs = self.generate(**model_inputs, max_new_tokens=256, do_sample=False)
736
+ return generation_outputs[:,input_len:]
737
+
738
+ @classmethod
739
+ def from_pretrained(
740
+ cls,
741
+ pretrained_model_name_or_path: Optional[Union[str, os.PathLike]],
742
+ *model_args,
743
+ config: Optional[Union[PretrainedConfig, str, os.PathLike]] = None,
744
+ cache_dir: Optional[Union[str, os.PathLike]] = None,
745
+ ignore_mismatched_sizes: bool = False,
746
+ force_download: bool = False,
747
+ local_files_only: bool = False,
748
+ token: Optional[Union[str, bool]] = None,
749
+ revision: str = "main",
750
+ use_safetensors: Optional[bool] = None,
751
+ weights_only: bool = True,
752
+ **kwargs,
753
+ ):
754
+ model = super().from_pretrained(
755
+ pretrained_model_name_or_path,
756
+ *model_args,
757
+ config=config,
758
+ cache_dir=cache_dir,
759
+ ignore_mismatched_sizes=ignore_mismatched_sizes,
760
+ force_download=force_download,
761
+ local_files_only=local_files_only,
762
+ token=token,
763
+ revision=revision,
764
+ use_safetensors=use_safetensors,
765
+ weights_only=weights_only,
766
+ **kwargs,
767
+ )
768
+ # NOTE: tie the weights of the embed_tokens with lm head (donot work if un_tie_weight)
769
+ # model.language_model.tie_weights()
770
+ # NOTE: tie the data of spatial_embed_tokens with embed_tokens (BUG: forweight sync issue in training)
771
+ if model.config.use_spatial_token:
772
+ model.language_model.model.embed_tokens.weight.data[-model.config.spatial_token_num:] = model.spatial_embed_tokens.weight.data
773
+ return model
preprocessor_config.json ADDED
@@ -0,0 +1,28 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "auto_map": {
3
+ "AutoProcessor": "processing_spatialvla.SpatialVLAProcessor"
4
+ },
5
+ "do_convert_rgb": null,
6
+ "do_normalize": false,
7
+ "do_rescale": true,
8
+ "do_resize": true,
9
+ "image_mean": [
10
+ 0.5,
11
+ 0.5,
12
+ 0.5
13
+ ],
14
+ "image_processor_type": "SiglipImageProcessor",
15
+ "image_seq_length": 256,
16
+ "image_std": [
17
+ 0.5,
18
+ 0.5,
19
+ 0.5
20
+ ],
21
+ "processor_class": "SpatialVLAProcessor",
22
+ "resample": 3,
23
+ "rescale_factor": 0.00392156862745098,
24
+ "size": {
25
+ "height": 224,
26
+ "width": 224
27
+ }
28
+ }
processing_spatialvla.py ADDED
@@ -0,0 +1,439 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # MIT License
2
+ # Copyright (c) 2025 IPEC at Shanghai AI Laboratory
3
+ # Permission is hereby granted, free of charge, to use, copy, modify, merge, publish,
4
+ # distribute, sublicense, and/or sell copies of the Software, subject to the following conditions:
5
+ # The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
6
+ # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND.
7
+ # Based on code licensed under the Apache License, Version 2.0 by Google Inc. and HuggingFace Inc. team (Copyright 2024).
8
+ # coding=utf-8
9
+
10
+ """
11
+ Processor class for PaliGemma.
12
+ """
13
+
14
+ import logging
15
+ from typing import List, Optional, Union, Dict
16
+ import torch
17
+ import numpy as np
18
+
19
+ from transformers.feature_extraction_utils import BatchFeature
20
+ from transformers.image_utils import ImageInput, is_valid_image
21
+ from transformers.processing_utils import (
22
+ ImagesKwargs,
23
+ ProcessingKwargs,
24
+ ProcessorMixin,
25
+ TextKwargs,
26
+ Unpack,
27
+ _validate_images_text_input_order,
28
+ )
29
+ from transformers.tokenization_utils_base import (
30
+ AddedToken,
31
+ PreTokenizedInput,
32
+ TextInput,
33
+ )
34
+ from transformers.utils import logging
35
+ from .action_tokenizer import SphericalCoordinateActionTokenizer
36
+
37
+ logger = logging.get_logger(__name__)
38
+
39
+ IMAGE_TOKEN = "<image>"
40
+ EXTRA_TOKENS = [f"<loc{i:0>4}>" for i in range(1024)] + [f"<seg{i:0>3}>" for i in range(128)]
41
+
42
+
43
+ class PaliGemmaTextKwargs(TextKwargs):
44
+ suffix: Optional[Union[TextInput, PreTokenizedInput, List[TextInput], List[PreTokenizedInput]]]
45
+
46
+
47
+ class PaliGemmaImagesKwargs(ImagesKwargs):
48
+ do_convert_rgb: Optional[bool]
49
+
50
+
51
+ class PaliGemmaProcessorKwargs(ProcessingKwargs, total=False):
52
+ text_kwargs: PaliGemmaTextKwargs
53
+ images_kwargs: PaliGemmaImagesKwargs
54
+ _defaults = {
55
+ "text_kwargs": {
56
+ "padding": False,
57
+ },
58
+ "images_kwargs": {
59
+ "data_format": "channels_first",
60
+ },
61
+ }
62
+
63
+
64
+ # Copied from transformers.models.idefics2.processing_idefics2.is_url
65
+ def is_url(val) -> bool:
66
+ return isinstance(val, str) and val.startswith("http")
67
+
68
+
69
+ # Copied from transformers.models.idefics2.processing_idefics2.is_image_or_image_url
70
+ def is_image_or_image_url(elem):
71
+ return is_url(elem) or is_valid_image(elem)
72
+
73
+
74
+ def _is_str_or_image(elem):
75
+ return isinstance(elem, (str)) or is_image_or_image_url(elem)
76
+
77
+
78
+ def build_string_from_input(prompt, bos_token, image_seq_len, image_token, num_images):
79
+ """
80
+ Builds a string from the input prompt and image tokens.
81
+ For example, for the call:
82
+ build_string_from_input(
83
+ prompt="Prefix str"
84
+ bos_token="<s>",
85
+ image_seq_len=3,
86
+ image_token="<im>",
87
+ )
88
+ The output will be:
89
+ "<im><im><im><s>Initial str"
90
+ Args:
91
+ prompt (`List[Union[str, ImageInput]]`): The input prompt.
92
+ bos_token (`str`): The beginning of sentence token.
93
+ image_seq_len (`int`): The length of the image sequence.
94
+ image_token (`str`): The image token.
95
+ num_images (`int`): Number of images in the prompt.
96
+ """
97
+ return f"{image_token * image_seq_len * num_images}{bos_token}{prompt}\n"
98
+
99
+
100
+ # Copied from transformers.models.llava_next.image_processing_llava_next.make_batched_images
101
+ def make_batched_images(images) -> List[List[ImageInput]]:
102
+ """
103
+ Accepts images in list or nested list format, and makes a list of images for preprocessing.
104
+
105
+ Args:
106
+ images (`Union[List[List[ImageInput]], List[ImageInput], ImageInput]`):
107
+ The input image.
108
+
109
+ Returns:
110
+ list: A list of images.
111
+ """
112
+ if isinstance(images, (list, tuple)) and isinstance(images[0], (list, tuple)) and is_valid_image(images[0][0]):
113
+ return [img for img_list in images for img in img_list]
114
+
115
+ elif isinstance(images, (list, tuple)) and is_valid_image(images[0]):
116
+ return images
117
+
118
+ elif is_valid_image(images):
119
+ return [images]
120
+
121
+ raise ValueError(f"Could not make batched video from {images}")
122
+
123
+
124
+ class SpatialVLAProcessor(ProcessorMixin):
125
+ r"""
126
+ Constructs a PaliGemma processor which wraps a PaliGemma image processor and a PaliGemma tokenizer into a single processor.
127
+
128
+ [`PaliGemmaProcessor`] offers all the functionalities of [`SiglipImageProcessor`] and [`LlamaTokenizerFast`]. See the
129
+ [`~PaliGemmaProcessor.__call__`] and [`~PaliGemmaProcessor.decode`] for more information.
130
+
131
+ Args:
132
+ image_processor ([`SiglipImageProcessor`], *optional*):
133
+ The image processor is a required input.
134
+ tokenizer ([`LlamaTokenizerFast`], *optional*):
135
+ The tokenizer is a required input.
136
+ chat_template (`str`, *optional*): A Jinja template which will be used to convert lists of messages
137
+ in a chat into a tokenizable string.
138
+ """
139
+
140
+ attributes = ["image_processor", "tokenizer"]
141
+ valid_kwargs = ["chat_template"]
142
+ image_processor_class = "SiglipImageProcessor"
143
+ tokenizer_class = ("GemmaTokenizer", "GemmaTokenizerFast")
144
+
145
+ def __init__(
146
+ self,
147
+ image_processor=None,
148
+ tokenizer=None,
149
+ chat_template=None,
150
+ statistics: Optional[dict] = None,
151
+ bin_policy=None,
152
+ intrinsic_config=None,
153
+ action_config=None,
154
+ num_obs_steps=1,
155
+ obs_delta=1,
156
+ action_chunk_size=1,
157
+ min_sigma=0.0,
158
+ **kwargs,
159
+ ):
160
+ if image_processor is None:
161
+ raise ValueError("You need to specify an `image_processor`.")
162
+ if tokenizer is None:
163
+ raise ValueError("You need to specify a `tokenizer`.")
164
+ if not hasattr(image_processor, "image_seq_length"):
165
+ raise ValueError("Image processor is missing an `image_seq_length` attribute.")
166
+
167
+ self.image_seq_length = image_processor.image_seq_length
168
+
169
+ if not hasattr(tokenizer, "image_token"):
170
+ image_token = AddedToken(IMAGE_TOKEN, normalized=False, special=True)
171
+ tokens_to_add = {"additional_special_tokens": [image_token]}
172
+ tokenizer.add_special_tokens(tokens_to_add)
173
+ self.image_token_id = tokenizer.convert_tokens_to_ids(IMAGE_TOKEN)
174
+ else:
175
+ self.image_token_id = tokenizer.image_token_id
176
+
177
+ tokenizer.add_tokens(EXTRA_TOKENS)
178
+ tokenizer.add_bos_token = False
179
+ tokenizer.add_eos_token = False
180
+
181
+ super().__init__(image_processor, tokenizer, chat_template=chat_template)
182
+
183
+ # action tokenizer
184
+ self.statistics = statistics if statistics else {}
185
+ self.bin_policy = bin_policy
186
+ self.min_sigma = min_sigma
187
+ self.intrinsic_config = intrinsic_config
188
+ self.action_config = action_config
189
+ self.num_obs_steps = num_obs_steps
190
+ self.obs_delta = obs_delta
191
+ self.action_chunk_size = action_chunk_size
192
+ self.dataset_intrinsics = {}
193
+ height, width = image_processor.size["height"], image_processor.size["width"]
194
+
195
+ for k, v in intrinsic_config.items():
196
+ K = torch.tensor(v["intrinsic"]).float()
197
+ h, w = v["height"], v["width"]
198
+ K[0, 0] *= width / w
199
+ K[1, 1] *= height / h
200
+ K[0, 2] *= width / w
201
+ K[1, 2] *= height / h
202
+ self.dataset_intrinsics[k] = K
203
+ print(f"scale intrinsic of {k} from {v['intrinsic']} to {K} ...")
204
+
205
+ self.action_tokenizer = SphericalCoordinateActionTokenizer(
206
+ tokenizer=tokenizer, num_bins=action_config["num_bins"],
207
+ bin_policy=bin_policy, use_spherical=action_config["use_spherical"],
208
+ min_sigma=min_sigma,
209
+ )
210
+
211
+ def __call__(
212
+ self,
213
+ images: ImageInput = None,
214
+ text: Union[TextInput, PreTokenizedInput, List[TextInput], List[PreTokenizedInput]] = None,
215
+ audio=None,
216
+ videos=None,
217
+ unnorm_key: Optional[str] = None,
218
+ suffix_actions: Optional[np.array] = None, # (t e)
219
+ **kwargs: Unpack[PaliGemmaProcessorKwargs],
220
+ ) -> BatchFeature:
221
+ """
222
+ Main method to prepare for the model one or several sequences(s) and image(s). This method forwards the `text`
223
+ and `kwargs` arguments to LlamaTokenizerFast's [`~LlamaTokenizerFast.__call__`] if `text` is not `None` to encode
224
+ the text. To prepare the image(s), this method forwards the `images` and `kwrags` arguments to
225
+ SiglipImageProcessor's [`~SiglipImageProcessor.__call__`] if `images` is not `None`. Please refer to the doctsring
226
+ of the above two methods for more information.
227
+
228
+ The usage for PaliGemma fine-tuning preparation is slightly different than usual. suffix passed are suffixes to
229
+ the prompt in `text`, and will be placed after the prompt. This is because attention is handled differently for
230
+ the prefix and the suffix. For instance,
231
+ ```python
232
+ image = PIL_cow_image
233
+ prompt = "answer en Where is the cow standing?"
234
+ suffix = "on the beach"
235
+ inputs = processor(text=prompt, images=image, suffix=suffix)
236
+ ```
237
+ Here `inputs` will contain the `input_ids` and `token_type_ids` that follow
238
+ ```python
239
+ inputs["input_ids"][:, 256:]
240
+ # tensor([[ 2, 6006, 603, 573, 13910, 9980, 235336, 108, 477, 573, 8318]])
241
+ inputs["token_type_ids"][:, 256:]
242
+ tensor([[0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1]])
243
+ ```
244
+ Meaning the last three tokens are of "label" ("suffix") type while the other ones are of "prefix" type.
245
+
246
+
247
+ Args:
248
+ images (`PIL.Image.Image`, `np.ndarray`, `torch.Tensor`, `List[PIL.Image.Image]`, `List[np.ndarray]`, `List[torch.Tensor]`):
249
+ The image or batch of images to be prepared. Each image can be a PIL image, NumPy array or PyTorch
250
+ tensor. In case of a NumPy array/PyTorch tensor, each image should be of shape (C, H, W), where C is a
251
+ number of channels, H and W are image height and width.
252
+ text (`str`, `List[str]`, `List[List[str]]`):
253
+ The sequence or batch of sequences to be encoded. Each sequence can be a string or a list of strings
254
+ (pretokenized string). If the sequences are provided as list of strings (pretokenized), you must set
255
+ `is_split_into_words=True` (to lift the ambiguity with a batch of sequences).
256
+ return_tensors (`str` or [`~utils.TensorType`], *optional*):
257
+ If set, will return tensors of a particular framework. Acceptable values are:
258
+
259
+ - `'tf'`: Return TensorFlow `tf.constant` objects.
260
+ - `'pt'`: Return PyTorch `torch.Tensor` objects.
261
+ - `'np'`: Return NumPy `np.ndarray` objects.
262
+ - `'jax'`: Return JAX `jnp.ndarray` objects.
263
+ suffix (`str`, `List[str]`, `List[List[str]]`):
264
+ The suffixes or batch of suffixes to be encoded. Only necessary for finetuning. See https://github.com/google-research/big_vision/blob/main/big_vision/configs/proj/paligemma/README.md
265
+ for more information. If your prompt is "<image> What is on the image", the suffix corresponds to the expected prediction "a cow sitting on a bench".
266
+
267
+ Returns:
268
+ [`BatchFeature`]: A [`BatchFeature`] with the following fields:
269
+
270
+ - **input_ids** -- List of token ids to be fed to a model. Returned when `text` is not `None`. If `suffix`
271
+ is provided, the `input_ids` will also contain the suffix input ids.
272
+ - **attention_mask** -- List of indices specifying which tokens should be attended to by the model (when
273
+ `return_attention_mask=True` or if *"attention_mask"* is in `self.model_input_names` and if `text` is not
274
+ `None`).
275
+ - **pixel_values** -- Pixel values to be fed to a model. Returned when `images` is not `None`.
276
+ - **labels** -- Labels compatible with training if `suffix` is not None
277
+ """
278
+ # check if images and text inputs are reversed for BC
279
+ images, text = _validate_images_text_input_order(images, text)
280
+
281
+ output_kwargs = self._merge_kwargs(
282
+ PaliGemmaProcessorKwargs,
283
+ tokenizer_init_kwargs=self.tokenizer.init_kwargs,
284
+ **kwargs,
285
+ )
286
+ if suffix_actions is not None:
287
+ action_tokens = self.action_tokenizer(suffix_actions) # (n,3)
288
+ suffix="".join(action_tokens.flatten())
289
+ else:
290
+ suffix = output_kwargs["text_kwargs"].pop("suffix", None)
291
+
292
+ return_token_type_ids = True if suffix is not None else False
293
+
294
+ if images is None:
295
+ raise ValueError("`images` are expected as arguments to a `PaliGemmaProcessor` instance.")
296
+ if text is None:
297
+ logger.warning_once(
298
+ "You are using PaliGemma without a text prefix. It will perform as a picture-captioning model."
299
+ )
300
+ text = ""
301
+
302
+ if _is_str_or_image(text):
303
+ text = [text]
304
+ elif isinstance(text, list) and _is_str_or_image(text[0]):
305
+ pass
306
+
307
+ if text is not None and images is not None:
308
+ if not any(IMAGE_TOKEN in sample for sample in text):
309
+ # logger.warning(
310
+ # "You are passing both `text` and `images` to `PaliGemmaProcessor`. The processor expects special "
311
+ # "image tokens in the text, as many tokens as there are images per each text. It is recommended to "
312
+ # "add `<image>` tokens in the very beginning of your text. For this call, we will infer how many images "
313
+ # "each text has and add special tokens."
314
+ # )
315
+ if isinstance(text, List) and isinstance(images, List):
316
+ if len(images) != len(text):
317
+ raise ValueError(
318
+ f"Received {len(images)} images for {len(text)} prompts. Each prompt should be associated with an image or list of images."
319
+ )
320
+
321
+ # make a nested list of lists to be able to iterate over the images and text below
322
+ if is_valid_image(images):
323
+ images = [[images]]
324
+ elif isinstance(images, list) and is_valid_image(images[0]):
325
+ images = [[image] for image in images]
326
+ elif not (isinstance(images, list) and isinstance(images[0], list) and is_valid_image(images[0][0])):
327
+ raise ValueError("images must be an image, list of images or list of list of images")
328
+
329
+ if suffix is not None and _is_str_or_image(suffix):
330
+ suffix = [suffix]
331
+ if suffix is not None:
332
+ suffix = [sfx + self.tokenizer.eos_token for sfx in suffix]
333
+
334
+ input_strings = [
335
+ build_string_from_input(
336
+ prompt=prompt,
337
+ bos_token=self.tokenizer.bos_token,
338
+ image_seq_len=self.image_seq_length,
339
+ image_token=IMAGE_TOKEN,
340
+ num_images=len(image_list) if isinstance(image_list, list) else 1,
341
+ )
342
+ for prompt, image_list in zip(text, images)
343
+ ]
344
+ images = make_batched_images(images)
345
+ else:
346
+ expanded_samples = []
347
+ for sample in text:
348
+ expanded_sample = sample.replace(IMAGE_TOKEN, IMAGE_TOKEN * self.image_seq_length)
349
+ bos_rfind_index = expanded_sample.rfind(IMAGE_TOKEN)
350
+ bos_index = bos_rfind_index + len(IMAGE_TOKEN) if bos_rfind_index != -1 else 0
351
+ expanded_sample = (
352
+ expanded_sample[:bos_index] + self.tokenizer.bos_token + expanded_sample[bos_index:]
353
+ )
354
+ expanded_samples.append(expanded_sample)
355
+ input_strings = [f"{sample}\n" for sample in expanded_samples]
356
+ pixel_values = self.image_processor(images, **output_kwargs["images_kwargs"])["pixel_values"]
357
+
358
+ # max_length has to account for the image tokens
359
+ if output_kwargs["text_kwargs"].get("max_length", None) is not None:
360
+ output_kwargs["text_kwargs"]["max_length"] += self.image_seq_length
361
+
362
+ inputs = self.tokenizer(
363
+ input_strings,
364
+ text_pair=suffix,
365
+ return_token_type_ids=return_token_type_ids,
366
+ **output_kwargs["text_kwargs"],
367
+ )
368
+
369
+ intrinsic = self.dataset_intrinsics[unnorm_key] if unnorm_key in self.dataset_intrinsics else self.dataset_intrinsics["default"]
370
+ return_data = {**inputs, "pixel_values": pixel_values, "intrinsic": intrinsic}
371
+
372
+ if return_token_type_ids:
373
+ labels = inputs["input_ids"].masked_fill(inputs["token_type_ids"] == 0, -100)
374
+ return_data.update({"labels": labels})
375
+ return BatchFeature(data=return_data)
376
+
377
+ # Copied from transformers.models.clip.processing_clip.CLIPProcessor.batch_decode with CLIP->Gemma
378
+ def batch_decode(self, *args, **kwargs):
379
+ """
380
+ This method forwards all its arguments to GemmaTokenizerFast's [`~PreTrainedTokenizer.batch_decode`]. Please
381
+ refer to the docstring of this method for more information.
382
+ """
383
+ return self.tokenizer.batch_decode(*args, **kwargs)
384
+
385
+ # Copied from transformers.models.clip.processing_clip.CLIPProcessor.decode with CLIP->Gemma
386
+ def decode(self, *args, **kwargs):
387
+ """
388
+ This method forwards all its arguments to GemmaTokenizerFast's [`~PreTrainedTokenizer.decode`]. Please refer to
389
+ the docstring of this method for more information.
390
+ """
391
+ return self.tokenizer.decode(*args, **kwargs)
392
+
393
+ @property
394
+ # Copied from transformers.models.clip.processing_clip.CLIPProcessor.model_input_names with CLIP->PaliGemma
395
+ def model_input_names(self):
396
+ tokenizer_input_names = self.tokenizer.model_input_names
397
+ image_processor_input_names = self.image_processor.model_input_names
398
+ return list(dict.fromkeys(tokenizer_input_names + image_processor_input_names))
399
+
400
+ def decode_actions(
401
+ self,
402
+ generation_outputs: torch.Tensor,
403
+ unnorm_key: Optional[str] = None,
404
+ ) -> Dict[str, torch.Tensor]:
405
+ action_token_num = 3 # translation + rotation + gripper
406
+ predicted_action_token_ids = generation_outputs[0, : action_token_num * self.action_chunk_size].detach().cpu().long().numpy()
407
+ assert self.tokenizer.eos_token != predicted_action_token_ids[-1], "[error] actions contain EOS token, please check you truncation settings!"
408
+
409
+ if predicted_action_token_ids.shape[0] < action_token_num * self.action_chunk_size: # pad with zeros
410
+ print(f"[warning] Padding zero action!")
411
+ predicted_action_token_ids = np.concatenate(
412
+ [
413
+ predicted_action_token_ids,
414
+ np.zeros(action_token_num * self.action_chunk_size - predicted_action_token_ids.shape[0], dtype=np.longlong),
415
+ ]
416
+ )
417
+ predicted_action_token_ids = predicted_action_token_ids.reshape(-1, action_token_num)
418
+ normalized_action_chunks = self.action_tokenizer.decode_token_ids_to_actions(predicted_action_token_ids)
419
+
420
+ # Unnormalize actions
421
+ if unnorm_key is None:
422
+ print(f"🔥 unnorm_key {unnorm_key} is not in statistics, use next one")
423
+ unnorm_key = next(self.statistics.keys())
424
+ action_norm_stats = self.statistics[unnorm_key]["action"]
425
+
426
+ action_dim = len(action_norm_stats["q01"])
427
+ mask = np.array(action_norm_stats.get("mask", np.ones(action_dim)), dtype=bool)
428
+ action_high, action_low = np.array(action_norm_stats["q99"]), np.array(action_norm_stats["q01"])
429
+
430
+ actions = []
431
+ for normalized_actions in normalized_action_chunks:
432
+ action = np.where(
433
+ mask,
434
+ 0.5 * (normalized_actions + 1) * (action_high - action_low) + action_low,
435
+ normalized_actions,
436
+ )
437
+ actions.append(action)
438
+ actions = np.stack(actions)
439
+ return {"actions": actions, "action_ids": predicted_action_token_ids}
processor_config.json ADDED
@@ -0,0 +1,3701 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "action_chunk_size": 4,
3
+ "action_config": {
4
+ "distribution": "gaussian",
5
+ "num_bins": {
6
+ "gripper": 2,
7
+ "rotation": {
8
+ "pitch_bins": 16,
9
+ "roll_bins": 16,
10
+ "yaw_bins": 16
11
+ },
12
+ "total": 8194,
13
+ "translation": {
14
+ "phi_bins": 32,
15
+ "r_bins": 8,
16
+ "theta_bins": 16
17
+ }
18
+ },
19
+ "use_spherical": true
20
+ },
21
+ "auto_map": {
22
+ "AutoProcessor": "processing_spatialvla.SpatialVLAProcessor"
23
+ },
24
+ "bin_policy": {
25
+ "rotation": {
26
+ "pitch_bins": [
27
+ -1.0,
28
+ -0.6785015894338633,
29
+ -0.516796358161167,
30
+ -0.3978678314258641,
31
+ -0.29907867426319246,
32
+ -0.21158608510441518,
33
+ -0.13081651669135252,
34
+ -0.05392877158612959,
35
+ 0.02113881590329744,
36
+ 0.0961313749999302,
37
+ 0.17278161860263358,
38
+ 0.25310821063971767,
39
+ 0.33985580585203445,
40
+ 0.4373796767941653,
41
+ 0.5539451994131283,
42
+ 0.7100308525313351,
43
+ 0.9999999999999999
44
+ ],
45
+ "roll_bins": [
46
+ -1.0,
47
+ -0.7121298287894609,
48
+ -0.5564581819056097,
49
+ -0.440071773405789,
50
+ -0.3426461358467384,
51
+ -0.25595819395001274,
52
+ -0.17566893098554964,
53
+ -0.09904102149491184,
54
+ -0.024059205927849478,
55
+ 0.05100802578115137,
56
+ 0.12790631705350436,
57
+ 0.20869987492610076,
58
+ 0.2962359118858219,
59
+ 0.3951018734752948,
60
+ 0.5141779624401348,
61
+ 0.6762450862353777,
62
+ 1.0
63
+ ],
64
+ "yaw_bins": [
65
+ -1.0,
66
+ -0.6910047644696934,
67
+ -0.5313988287371314,
68
+ -0.4133376866679583,
69
+ -0.3150057290436059,
70
+ -0.22777658299365705,
71
+ -0.14715771012527992,
72
+ -0.07034330907230311,
73
+ 0.004712965738136004,
74
+ 0.07975252682496348,
75
+ 0.15651401950954372,
76
+ 0.23703420508371892,
77
+ 0.32409736463921823,
78
+ 0.4221473708283458,
79
+ 0.5396818128475004,
80
+ 0.6980345545587262,
81
+ 1.0
82
+ ]
83
+ },
84
+ "translation": {
85
+ "phi_bins": [
86
+ -3.1415926535897927,
87
+ -2.5597806593194092,
88
+ -2.1899702111786126,
89
+ -1.9071489188814448,
90
+ -1.6724463283141142,
91
+ -1.4683467869586326,
92
+ -1.2853487663890668,
93
+ -1.1176672338183495,
94
+ -0.961484031585327,
95
+ -0.8141204989748655,
96
+ -0.6736024210639718,
97
+ -0.5384120746595923,
98
+ -0.40733740832383114,
99
+ -0.279375002438531,
100
+ -0.15366425283265983,
101
+ -0.029440234757304742,
102
+ 0.0940021938080639,
103
+ 0.2173378027339352,
104
+ 0.34123726674747146,
105
+ 0.46639302836823826,
106
+ 0.5935473848733163,
107
+ 0.7235258808185444,
108
+ 0.857280204661428,
109
+ 0.9959469801163238,
110
+ 1.1409329906705301,
111
+ 1.2940454053271015,
112
+ 1.4577019170652383,
113
+ 1.6352913749303837,
114
+ 1.8318407243899377,
115
+ 2.0553733807372363,
116
+ 2.320069275631962,
117
+ 2.6552436426949604,
118
+ 3.141592653589793
119
+ ],
120
+ "r_bins": [
121
+ 2.220446049250313e-16,
122
+ 0.19677118231539265,
123
+ 0.3506298590504556,
124
+ 0.4881976731379496,
125
+ 0.621970275186659,
126
+ 0.7620978861167458,
127
+ 0.9228346010157172,
128
+ 1.1393317208802278,
129
+ 1.7320508075688767
130
+ ],
131
+ "theta_bins": [
132
+ 0.0,
133
+ 0.7067187338585303,
134
+ 0.9814199309359143,
135
+ 1.1752042640550222,
136
+ 1.3331175751173345,
137
+ 1.4713205387280388,
138
+ 1.5977846301055496,
139
+ 1.7172771763957553,
140
+ 1.8331248472067783,
141
+ 1.9480194771467687,
142
+ 2.0644993054216925,
143
+ 2.1853608246107656,
144
+ 2.314189357400805,
145
+ 2.456314355008026,
146
+ 2.621028843347318,
147
+ 2.828352346005421,
148
+ 3.141592653589793
149
+ ]
150
+ }
151
+ },
152
+ "intrinsic_config": {
153
+ "bridge_orig/1.0.0": {
154
+ "height": 480,
155
+ "intrinsic": [
156
+ [
157
+ 623.588,
158
+ 0,
159
+ 319.501
160
+ ],
161
+ [
162
+ 0,
163
+ 623.588,
164
+ 239.545
165
+ ],
166
+ [
167
+ 0,
168
+ 0,
169
+ 1
170
+ ]
171
+ ],
172
+ "width": 640
173
+ },
174
+ "default": {
175
+ "height": 480,
176
+ "intrinsic": [
177
+ [
178
+ 623.588,
179
+ 0,
180
+ 319.501
181
+ ],
182
+ [
183
+ 0,
184
+ 623.588,
185
+ 239.545
186
+ ],
187
+ [
188
+ 0,
189
+ 0,
190
+ 1
191
+ ]
192
+ ],
193
+ "width": 640
194
+ }
195
+ },
196
+ "num_obs_steps": 1,
197
+ "obs_delta": 1,
198
+ "processor_class": "SpatialVLAProcessor",
199
+ "statistics": {
200
+ "fractal20220817_data/0.1.0": {
201
+ "action": {
202
+ "mean": [
203
+ 0.006987507455050945,
204
+ 0.006265853065997362,
205
+ -0.012625162489712238,
206
+ 0.04333285242319107,
207
+ -0.005756276659667492,
208
+ 0.0009130403632298112,
209
+ 0.5354204773902893
210
+ ],
211
+ "std": [
212
+ 0.06921109557151794,
213
+ 0.05970889702439308,
214
+ 0.0735311210155487,
215
+ 0.1561058759689331,
216
+ 0.1316441297531128,
217
+ 0.14593777060508728,
218
+ 0.49711623787879944
219
+ ],
220
+ "max": [
221
+ 2.9984593391418457,
222
+ 22.09052848815918,
223
+ 2.7507524490356445,
224
+ 1.570636510848999,
225
+ 1.5321086645126343,
226
+ 1.5691522359848022,
227
+ 1.0
228
+ ],
229
+ "min": [
230
+ -2.0204520225524902,
231
+ -5.497899532318115,
232
+ -2.031663417816162,
233
+ -1.569917917251587,
234
+ -1.569892168045044,
235
+ -1.570419430732727,
236
+ 0.0
237
+ ],
238
+ "q01": [
239
+ -0.22453527510166169,
240
+ -0.14820013284683228,
241
+ -0.231589707583189,
242
+ -0.3517994859814644,
243
+ -0.4193011274933815,
244
+ -0.43643461108207704,
245
+ 0.0
246
+ ],
247
+ "q99": [
248
+ 0.17824687153100965,
249
+ 0.14938379630446405,
250
+ 0.21842354819178575,
251
+ 0.5892666035890578,
252
+ 0.35272657424211445,
253
+ 0.44796681255102094,
254
+ 1.0
255
+ ],
256
+ "mask": [
257
+ true,
258
+ true,
259
+ true,
260
+ true,
261
+ true,
262
+ true,
263
+ false
264
+ ]
265
+ },
266
+ "proprio": {
267
+ "mean": [
268
+ 0.0,
269
+ 0.0,
270
+ 0.0,
271
+ 0.0,
272
+ 0.0,
273
+ 0.0,
274
+ 0.0
275
+ ],
276
+ "std": [
277
+ 0.0,
278
+ 0.0,
279
+ 0.0,
280
+ 0.0,
281
+ 0.0,
282
+ 0.0,
283
+ 0.0
284
+ ],
285
+ "max": [
286
+ 0.0,
287
+ 0.0,
288
+ 0.0,
289
+ 0.0,
290
+ 0.0,
291
+ 0.0,
292
+ 0.0
293
+ ],
294
+ "min": [
295
+ 0.0,
296
+ 0.0,
297
+ 0.0,
298
+ 0.0,
299
+ 0.0,
300
+ 0.0,
301
+ 0.0
302
+ ],
303
+ "q01": [
304
+ 0.0,
305
+ 0.0,
306
+ 0.0,
307
+ 0.0,
308
+ 0.0,
309
+ 0.0,
310
+ 0.0
311
+ ],
312
+ "q99": [
313
+ 0.0,
314
+ 0.0,
315
+ 0.0,
316
+ 0.0,
317
+ 0.0,
318
+ 0.0,
319
+ 0.0
320
+ ]
321
+ },
322
+ "num_transitions": 3786400,
323
+ "num_trajectories": 87212
324
+ },
325
+ "kuka/0.1.0": {
326
+ "action": {
327
+ "mean": [
328
+ -0.00046687963185831904,
329
+ 0.00040137648466043174,
330
+ -0.0012807906605303288,
331
+ 0.0,
332
+ 0.0,
333
+ -0.037225183099508286,
334
+ 0.4131543040275574
335
+ ],
336
+ "std": [
337
+ 0.020832739770412445,
338
+ 0.029158642515540123,
339
+ 0.0642285868525505,
340
+ 0.0,
341
+ 0.0,
342
+ 0.14224639534950256,
343
+ 0.4908643662929535
344
+ ],
345
+ "max": [
346
+ 0.1697135865688324,
347
+ 0.2777623236179352,
348
+ 0.43710532784461975,
349
+ 0.0,
350
+ 0.0,
351
+ 1.9684287309646606,
352
+ 1.0
353
+ ],
354
+ "min": [
355
+ -0.159867063164711,
356
+ -0.2892282009124756,
357
+ -0.2795473635196686,
358
+ 0.0,
359
+ 0.0,
360
+ -1.9875637292861938,
361
+ 0.0
362
+ ],
363
+ "q01": [
364
+ -0.06619441494345665,
365
+ -0.08713878810405731,
366
+ -0.15083016991615295,
367
+ 0.0,
368
+ 0.0,
369
+ -0.5415697038173676,
370
+ 0.0
371
+ ],
372
+ "q99": [
373
+ 0.06601839080452929,
374
+ 0.08732476785779003,
375
+ 0.18168179214000715,
376
+ 0.0,
377
+ 0.0,
378
+ 0.2923380345106127,
379
+ 1.0
380
+ ],
381
+ "mask": [
382
+ true,
383
+ true,
384
+ true,
385
+ true,
386
+ true,
387
+ true,
388
+ false
389
+ ]
390
+ },
391
+ "proprio": {
392
+ "mean": [
393
+ 0.0,
394
+ 0.0,
395
+ 0.0,
396
+ 0.0,
397
+ 0.0,
398
+ 0.0,
399
+ 0.0
400
+ ],
401
+ "std": [
402
+ 0.0,
403
+ 0.0,
404
+ 0.0,
405
+ 0.0,
406
+ 0.0,
407
+ 0.0,
408
+ 0.0
409
+ ],
410
+ "max": [
411
+ 0.0,
412
+ 0.0,
413
+ 0.0,
414
+ 0.0,
415
+ 0.0,
416
+ 0.0,
417
+ 0.0
418
+ ],
419
+ "min": [
420
+ 0.0,
421
+ 0.0,
422
+ 0.0,
423
+ 0.0,
424
+ 0.0,
425
+ 0.0,
426
+ 0.0
427
+ ],
428
+ "q01": [
429
+ 0.0,
430
+ 0.0,
431
+ 0.0,
432
+ 0.0,
433
+ 0.0,
434
+ 0.0,
435
+ 0.0
436
+ ],
437
+ "q99": [
438
+ 0.0,
439
+ 0.0,
440
+ 0.0,
441
+ 0.0,
442
+ 0.0,
443
+ 0.0,
444
+ 0.0
445
+ ]
446
+ },
447
+ "num_transitions": 2455879,
448
+ "num_trajectories": 209880
449
+ },
450
+ "bridge_orig/1.0.0": {
451
+ "action": {
452
+ "mean": [
453
+ 0.00023341714404523373,
454
+ 0.00013004327774979174,
455
+ -0.00012762591359205544,
456
+ -0.0001556579809403047,
457
+ -0.00040393328526988626,
458
+ 0.00023558337124995887,
459
+ 0.5764582753181458
460
+ ],
461
+ "std": [
462
+ 0.009765734896063805,
463
+ 0.013689505867660046,
464
+ 0.012667152099311352,
465
+ 0.028534479439258575,
466
+ 0.03063790127635002,
467
+ 0.07691770792007446,
468
+ 0.4973658621311188
469
+ ],
470
+ "max": [
471
+ 0.41691166162490845,
472
+ 0.25864794850349426,
473
+ 0.21218234300613403,
474
+ 3.122201919555664,
475
+ 1.8618112802505493,
476
+ 6.280478477478027,
477
+ 1.0
478
+ ],
479
+ "min": [
480
+ -0.4007510244846344,
481
+ -0.13874775171279907,
482
+ -0.22553899884223938,
483
+ -3.2010786533355713,
484
+ -1.8618112802505493,
485
+ -6.279075622558594,
486
+ 0.0
487
+ ],
488
+ "q01": [
489
+ -0.02872725307941437,
490
+ -0.04170349963009357,
491
+ -0.026093858778476715,
492
+ -0.08092105075716972,
493
+ -0.09288699507713317,
494
+ -0.20718276381492615,
495
+ 0.0
496
+ ],
497
+ "q99": [
498
+ 0.028309678435325586,
499
+ 0.040855254605412394,
500
+ 0.040161586627364146,
501
+ 0.08192047759890528,
502
+ 0.07792850524187081,
503
+ 0.20382574498653397,
504
+ 1.0
505
+ ],
506
+ "mask": [
507
+ true,
508
+ true,
509
+ true,
510
+ true,
511
+ true,
512
+ true,
513
+ false
514
+ ]
515
+ },
516
+ "proprio": {
517
+ "mean": [
518
+ 0.0,
519
+ 0.0,
520
+ 0.0,
521
+ 0.0,
522
+ 0.0,
523
+ 0.0,
524
+ 0.0
525
+ ],
526
+ "std": [
527
+ 0.0,
528
+ 0.0,
529
+ 0.0,
530
+ 0.0,
531
+ 0.0,
532
+ 0.0,
533
+ 0.0
534
+ ],
535
+ "max": [
536
+ 0.0,
537
+ 0.0,
538
+ 0.0,
539
+ 0.0,
540
+ 0.0,
541
+ 0.0,
542
+ 0.0
543
+ ],
544
+ "min": [
545
+ 0.0,
546
+ 0.0,
547
+ 0.0,
548
+ 0.0,
549
+ 0.0,
550
+ 0.0,
551
+ 0.0
552
+ ],
553
+ "q01": [
554
+ 0.0,
555
+ 0.0,
556
+ 0.0,
557
+ 0.0,
558
+ 0.0,
559
+ 0.0,
560
+ 0.0
561
+ ],
562
+ "q99": [
563
+ 0.0,
564
+ 0.0,
565
+ 0.0,
566
+ 0.0,
567
+ 0.0,
568
+ 0.0,
569
+ 0.0
570
+ ]
571
+ },
572
+ "num_transitions": 2135463,
573
+ "num_trajectories": 60064
574
+ },
575
+ "taco_play/0.1.0": {
576
+ "action": {
577
+ "mean": [
578
+ -0.0038459226489067078,
579
+ 0.009671436622738838,
580
+ 0.01278059184551239,
581
+ -0.0054037850350141525,
582
+ -0.009606562554836273,
583
+ -0.0024807206355035305,
584
+ 0.4263913035392761
585
+ ],
586
+ "std": [
587
+ 0.23254045844078064,
588
+ 0.3629826307296753,
589
+ 0.2869291603565216,
590
+ 0.261770635843277,
591
+ 0.24388927221298218,
592
+ 0.5216501355171204,
593
+ 0.49469029903411865
594
+ ],
595
+ "max": [
596
+ 1.4915844202041626,
597
+ 2.1842432022094727,
598
+ 2.6836395263671875,
599
+ 5.035226821899414,
600
+ 2.665864944458008,
601
+ 4.250768661499023,
602
+ 1.0
603
+ ],
604
+ "min": [
605
+ -4.242457866668701,
606
+ -3.192805051803589,
607
+ -1.3371467590332031,
608
+ -4.202683448791504,
609
+ -2.6722638607025146,
610
+ -3.3467135429382324,
611
+ 0.0
612
+ ],
613
+ "q01": [
614
+ -0.7106140398979186,
615
+ -1.056944659948349,
616
+ -0.5878450274467468,
617
+ -0.7682853937149048,
618
+ -0.7180147767066956,
619
+ -1.5527938604354858,
620
+ 0.0
621
+ ],
622
+ "q99": [
623
+ 0.6482916426658629,
624
+ 1.0051310062408447,
625
+ 0.9480248689651489,
626
+ 0.6926478147506714,
627
+ 0.6351067513227462,
628
+ 1.628010264635086,
629
+ 1.0
630
+ ],
631
+ "mask": [
632
+ true,
633
+ true,
634
+ true,
635
+ true,
636
+ true,
637
+ true,
638
+ false
639
+ ]
640
+ },
641
+ "proprio": {
642
+ "mean": [
643
+ 0.0,
644
+ 0.0,
645
+ 0.0,
646
+ 0.0,
647
+ 0.0,
648
+ 0.0,
649
+ 0.0
650
+ ],
651
+ "std": [
652
+ 0.0,
653
+ 0.0,
654
+ 0.0,
655
+ 0.0,
656
+ 0.0,
657
+ 0.0,
658
+ 0.0
659
+ ],
660
+ "max": [
661
+ 0.0,
662
+ 0.0,
663
+ 0.0,
664
+ 0.0,
665
+ 0.0,
666
+ 0.0,
667
+ 0.0
668
+ ],
669
+ "min": [
670
+ 0.0,
671
+ 0.0,
672
+ 0.0,
673
+ 0.0,
674
+ 0.0,
675
+ 0.0,
676
+ 0.0
677
+ ],
678
+ "q01": [
679
+ 0.0,
680
+ 0.0,
681
+ 0.0,
682
+ 0.0,
683
+ 0.0,
684
+ 0.0,
685
+ 0.0
686
+ ],
687
+ "q99": [
688
+ 0.0,
689
+ 0.0,
690
+ 0.0,
691
+ 0.0,
692
+ 0.0,
693
+ 0.0,
694
+ 0.0
695
+ ]
696
+ },
697
+ "num_transitions": 237798,
698
+ "num_trajectories": 3603
699
+ },
700
+ "jaco_play/0.1.0": {
701
+ "action": {
702
+ "mean": [
703
+ 0.0009658387862145901,
704
+ -0.005800850689411163,
705
+ -0.003950685728341341,
706
+ 0.0,
707
+ 0.0,
708
+ 0.0,
709
+ 0.34934908151626587
710
+ ],
711
+ "std": [
712
+ 0.12234985828399658,
713
+ 0.09678783267736435,
714
+ 0.1115543395280838,
715
+ 0.0,
716
+ 0.0,
717
+ 0.0,
718
+ 0.47682321071624756
719
+ ],
720
+ "max": [
721
+ 0.20000000298023224,
722
+ 0.20000000298023224,
723
+ 0.20000000298023224,
724
+ 0.0,
725
+ 0.0,
726
+ 0.0,
727
+ 1.0
728
+ ],
729
+ "min": [
730
+ -0.20000000298023224,
731
+ -0.20000000298023224,
732
+ -0.20000000298023224,
733
+ 0.0,
734
+ 0.0,
735
+ 0.0,
736
+ 0.0
737
+ ],
738
+ "q01": [
739
+ -0.20000000298023224,
740
+ -0.20000000298023224,
741
+ -0.20000000298023224,
742
+ 0.0,
743
+ 0.0,
744
+ 0.0,
745
+ 0.0
746
+ ],
747
+ "q99": [
748
+ 0.20000000298023224,
749
+ 0.20000000298023224,
750
+ 0.20000000298023224,
751
+ 0.0,
752
+ 0.0,
753
+ 0.0,
754
+ 1.0
755
+ ],
756
+ "mask": [
757
+ true,
758
+ true,
759
+ true,
760
+ true,
761
+ true,
762
+ true,
763
+ false
764
+ ]
765
+ },
766
+ "proprio": {
767
+ "mean": [
768
+ 0.0,
769
+ 0.0,
770
+ 0.0,
771
+ 0.0,
772
+ 0.0,
773
+ 0.0,
774
+ 0.0
775
+ ],
776
+ "std": [
777
+ 0.0,
778
+ 0.0,
779
+ 0.0,
780
+ 0.0,
781
+ 0.0,
782
+ 0.0,
783
+ 0.0
784
+ ],
785
+ "max": [
786
+ 0.0,
787
+ 0.0,
788
+ 0.0,
789
+ 0.0,
790
+ 0.0,
791
+ 0.0,
792
+ 0.0
793
+ ],
794
+ "min": [
795
+ 0.0,
796
+ 0.0,
797
+ 0.0,
798
+ 0.0,
799
+ 0.0,
800
+ 0.0,
801
+ 0.0
802
+ ],
803
+ "q01": [
804
+ 0.0,
805
+ 0.0,
806
+ 0.0,
807
+ 0.0,
808
+ 0.0,
809
+ 0.0,
810
+ 0.0
811
+ ],
812
+ "q99": [
813
+ 0.0,
814
+ 0.0,
815
+ 0.0,
816
+ 0.0,
817
+ 0.0,
818
+ 0.0,
819
+ 0.0
820
+ ]
821
+ },
822
+ "num_transitions": 77965,
823
+ "num_trajectories": 1085
824
+ },
825
+ "berkeley_cable_routing/0.1.0": {
826
+ "action": {
827
+ "mean": [
828
+ -0.07139858603477478,
829
+ 0.023608991876244545,
830
+ 0.10241956263780594,
831
+ 0.0,
832
+ 0.0,
833
+ 0.04967105761170387,
834
+ 0.0
835
+ ],
836
+ "std": [
837
+ 0.18155010044574738,
838
+ 0.18109896779060364,
839
+ 0.21220752596855164,
840
+ 0.0,
841
+ 0.0,
842
+ 0.3475516438484192,
843
+ 0.0
844
+ ],
845
+ "max": [
846
+ 0.9633283019065857,
847
+ 1.0,
848
+ 1.0,
849
+ 0.0,
850
+ 0.0,
851
+ 1.0,
852
+ 0.0
853
+ ],
854
+ "min": [
855
+ -0.9809081554412842,
856
+ -0.9554349184036255,
857
+ -0.9994775056838989,
858
+ 0.0,
859
+ 0.0,
860
+ -1.0,
861
+ 0.0
862
+ ],
863
+ "q01": [
864
+ -0.5534318816661835,
865
+ -0.4797285574674606,
866
+ -0.5314934802055359,
867
+ 0.0,
868
+ 0.0,
869
+ -0.8855219376087189,
870
+ 0.0
871
+ ],
872
+ "q99": [
873
+ 0.42652835428714786,
874
+ 0.5000944086909298,
875
+ 0.639823433756829,
876
+ 0.0,
877
+ 0.0,
878
+ 0.984243879914284,
879
+ 0.0
880
+ ],
881
+ "mask": [
882
+ true,
883
+ true,
884
+ true,
885
+ true,
886
+ true,
887
+ true,
888
+ false
889
+ ]
890
+ },
891
+ "proprio": {
892
+ "mean": [
893
+ 0.0,
894
+ 0.0,
895
+ 0.0,
896
+ 0.0,
897
+ 0.0,
898
+ 0.0,
899
+ 0.0
900
+ ],
901
+ "std": [
902
+ 0.0,
903
+ 0.0,
904
+ 0.0,
905
+ 0.0,
906
+ 0.0,
907
+ 0.0,
908
+ 0.0
909
+ ],
910
+ "max": [
911
+ 0.0,
912
+ 0.0,
913
+ 0.0,
914
+ 0.0,
915
+ 0.0,
916
+ 0.0,
917
+ 0.0
918
+ ],
919
+ "min": [
920
+ 0.0,
921
+ 0.0,
922
+ 0.0,
923
+ 0.0,
924
+ 0.0,
925
+ 0.0,
926
+ 0.0
927
+ ],
928
+ "q01": [
929
+ 0.0,
930
+ 0.0,
931
+ 0.0,
932
+ 0.0,
933
+ 0.0,
934
+ 0.0,
935
+ 0.0
936
+ ],
937
+ "q99": [
938
+ 0.0,
939
+ 0.0,
940
+ 0.0,
941
+ 0.0,
942
+ 0.0,
943
+ 0.0,
944
+ 0.0
945
+ ]
946
+ },
947
+ "num_transitions": 42328,
948
+ "num_trajectories": 1647
949
+ },
950
+ "roboturk/0.1.0": {
951
+ "action": {
952
+ "mean": [
953
+ 0.001444889116100967,
954
+ -0.0015945355407893658,
955
+ -0.0011753803119063377,
956
+ 0.002301239175722003,
957
+ -0.0009382442804053426,
958
+ -0.00011485860886750743,
959
+ 0.5746025443077087
960
+ ],
961
+ "std": [
962
+ 0.0493537075817585,
963
+ 0.06354564428329468,
964
+ 0.06116492301225662,
965
+ 0.0955340564250946,
966
+ 0.08420011401176453,
967
+ 0.06517910957336426,
968
+ 0.4945177137851715
969
+ ],
970
+ "max": [
971
+ 0.39124172925949097,
972
+ 0.4601028263568878,
973
+ 0.4870833456516266,
974
+ 1.816888689994812,
975
+ 1.8240282535552979,
976
+ 1.4824820756912231,
977
+ 1.0
978
+ ],
979
+ "min": [
980
+ -0.6546999216079712,
981
+ -0.6365841031074524,
982
+ -0.4217723608016968,
983
+ -1.6695482730865479,
984
+ -1.8023357391357422,
985
+ -1.4630827903747559,
986
+ 0.0
987
+ ],
988
+ "q01": [
989
+ -0.1342635464668274,
990
+ -0.19996687173843383,
991
+ -0.1482972100377083,
992
+ -0.20720748245716095,
993
+ -0.09676413893699647,
994
+ -0.18075634717941286,
995
+ 0.0
996
+ ],
997
+ "q99": [
998
+ 0.14956976801157001,
999
+ 0.1805950567126275,
1000
+ 0.18841815620660796,
1001
+ 0.21615413755178453,
1002
+ 0.09457383215427405,
1003
+ 0.18543301910162005,
1004
+ 1.0
1005
+ ],
1006
+ "mask": [
1007
+ true,
1008
+ true,
1009
+ true,
1010
+ true,
1011
+ true,
1012
+ true,
1013
+ false
1014
+ ]
1015
+ },
1016
+ "proprio": {
1017
+ "mean": [
1018
+ 0.0,
1019
+ 0.0,
1020
+ 0.0,
1021
+ 0.0,
1022
+ 0.0,
1023
+ 0.0,
1024
+ 0.0
1025
+ ],
1026
+ "std": [
1027
+ 0.0,
1028
+ 0.0,
1029
+ 0.0,
1030
+ 0.0,
1031
+ 0.0,
1032
+ 0.0,
1033
+ 0.0
1034
+ ],
1035
+ "max": [
1036
+ 0.0,
1037
+ 0.0,
1038
+ 0.0,
1039
+ 0.0,
1040
+ 0.0,
1041
+ 0.0,
1042
+ 0.0
1043
+ ],
1044
+ "min": [
1045
+ 0.0,
1046
+ 0.0,
1047
+ 0.0,
1048
+ 0.0,
1049
+ 0.0,
1050
+ 0.0,
1051
+ 0.0
1052
+ ],
1053
+ "q01": [
1054
+ 0.0,
1055
+ 0.0,
1056
+ 0.0,
1057
+ 0.0,
1058
+ 0.0,
1059
+ 0.0,
1060
+ 0.0
1061
+ ],
1062
+ "q99": [
1063
+ 0.0,
1064
+ 0.0,
1065
+ 0.0,
1066
+ 0.0,
1067
+ 0.0,
1068
+ 0.0,
1069
+ 0.0
1070
+ ]
1071
+ },
1072
+ "num_transitions": 187507,
1073
+ "num_trajectories": 1995
1074
+ },
1075
+ "viola/0.1.0": {
1076
+ "action": {
1077
+ "mean": [
1078
+ 0.04761853069067001,
1079
+ -0.029204534366726875,
1080
+ 0.055867329239845276,
1081
+ -0.0026185200549662113,
1082
+ 0.006867341697216034,
1083
+ -0.016821356490254402,
1084
+ 0.7323777675628662
1085
+ ],
1086
+ "std": [
1087
+ 0.39157867431640625,
1088
+ 0.40765219926834106,
1089
+ 0.40077903866767883,
1090
+ 0.10023998469114304,
1091
+ 0.08443189412355423,
1092
+ 0.10375089943408966,
1093
+ 0.442600816488266
1094
+ ],
1095
+ "max": [
1096
+ 1.0,
1097
+ 1.0,
1098
+ 1.0,
1099
+ 0.375,
1100
+ 0.36321428418159485,
1101
+ 0.375,
1102
+ 1.0
1103
+ ],
1104
+ "min": [
1105
+ -1.0,
1106
+ -1.0,
1107
+ -1.0,
1108
+ -0.375,
1109
+ -0.375,
1110
+ -0.375,
1111
+ 0.0
1112
+ ],
1113
+ "q01": [
1114
+ -0.9628571271896362,
1115
+ -1.0,
1116
+ -1.0,
1117
+ -0.26249998807907104,
1118
+ -0.21321429312229156,
1119
+ -0.3385714292526245,
1120
+ 0.0
1121
+ ],
1122
+ "q99": [
1123
+ 0.9114285707473755,
1124
+ 0.868571400642395,
1125
+ 1.0,
1126
+ 0.2817857265472412,
1127
+ 0.2239285707473755,
1128
+ 0.3557142913341522,
1129
+ 1.0
1130
+ ],
1131
+ "mask": [
1132
+ true,
1133
+ true,
1134
+ true,
1135
+ true,
1136
+ true,
1137
+ true,
1138
+ false
1139
+ ]
1140
+ },
1141
+ "proprio": {
1142
+ "mean": [
1143
+ 0.0,
1144
+ 0.0,
1145
+ 0.0,
1146
+ 0.0,
1147
+ 0.0,
1148
+ 0.0,
1149
+ 0.0
1150
+ ],
1151
+ "std": [
1152
+ 0.0,
1153
+ 0.0,
1154
+ 0.0,
1155
+ 0.0,
1156
+ 0.0,
1157
+ 0.0,
1158
+ 0.0
1159
+ ],
1160
+ "max": [
1161
+ 0.0,
1162
+ 0.0,
1163
+ 0.0,
1164
+ 0.0,
1165
+ 0.0,
1166
+ 0.0,
1167
+ 0.0
1168
+ ],
1169
+ "min": [
1170
+ 0.0,
1171
+ 0.0,
1172
+ 0.0,
1173
+ 0.0,
1174
+ 0.0,
1175
+ 0.0,
1176
+ 0.0
1177
+ ],
1178
+ "q01": [
1179
+ 0.0,
1180
+ 0.0,
1181
+ 0.0,
1182
+ 0.0,
1183
+ 0.0,
1184
+ 0.0,
1185
+ 0.0
1186
+ ],
1187
+ "q99": [
1188
+ 0.0,
1189
+ 0.0,
1190
+ 0.0,
1191
+ 0.0,
1192
+ 0.0,
1193
+ 0.0,
1194
+ 0.0
1195
+ ]
1196
+ },
1197
+ "num_transitions": 76324,
1198
+ "num_trajectories": 150
1199
+ },
1200
+ "berkeley_autolab_ur5/0.1.0": {
1201
+ "action": {
1202
+ "mean": [
1203
+ 0.0005683613708242774,
1204
+ 0.0012176961172372103,
1205
+ -0.0005296385497786105,
1206
+ 0.00021029777417425066,
1207
+ 6.069485243642703e-05,
1208
+ 0.0012049867073073983,
1209
+ 0.6298308372497559
1210
+ ],
1211
+ "std": [
1212
+ 0.011533073149621487,
1213
+ 0.007990497164428234,
1214
+ 0.009577799588441849,
1215
+ 0.009432999417185783,
1216
+ 0.016427574679255486,
1217
+ 0.011054049246013165,
1218
+ 0.482679545879364
1219
+ ],
1220
+ "max": [
1221
+ 0.019999999552965164,
1222
+ 0.019999999552965164,
1223
+ 0.019999999552965164,
1224
+ 0.06666667014360428,
1225
+ 0.06666667014360428,
1226
+ 0.06666667014360428,
1227
+ 1.0
1228
+ ],
1229
+ "min": [
1230
+ -0.019999999552965164,
1231
+ -0.019999999552965164,
1232
+ -0.019999999552965164,
1233
+ -0.06666667014360428,
1234
+ -0.06666667014360428,
1235
+ -0.06666667014360428,
1236
+ 0.0
1237
+ ],
1238
+ "q01": [
1239
+ -0.019999999552965164,
1240
+ -0.019999999552965164,
1241
+ -0.019999999552965164,
1242
+ -0.02628571353852749,
1243
+ -0.06666667014360428,
1244
+ -0.03847619146108627,
1245
+ 0.0
1246
+ ],
1247
+ "q99": [
1248
+ 0.019999999552965164,
1249
+ 0.019999999552965164,
1250
+ 0.019999999552965164,
1251
+ 0.031809523701667786,
1252
+ 0.06666667014360428,
1253
+ 0.036571428179740906,
1254
+ 1.0
1255
+ ],
1256
+ "mask": [
1257
+ true,
1258
+ true,
1259
+ true,
1260
+ true,
1261
+ true,
1262
+ true,
1263
+ false
1264
+ ]
1265
+ },
1266
+ "proprio": {
1267
+ "mean": [
1268
+ 0.0,
1269
+ 0.0,
1270
+ 0.0,
1271
+ 0.0,
1272
+ 0.0,
1273
+ 0.0,
1274
+ 0.0
1275
+ ],
1276
+ "std": [
1277
+ 0.0,
1278
+ 0.0,
1279
+ 0.0,
1280
+ 0.0,
1281
+ 0.0,
1282
+ 0.0,
1283
+ 0.0
1284
+ ],
1285
+ "max": [
1286
+ 0.0,
1287
+ 0.0,
1288
+ 0.0,
1289
+ 0.0,
1290
+ 0.0,
1291
+ 0.0,
1292
+ 0.0
1293
+ ],
1294
+ "min": [
1295
+ 0.0,
1296
+ 0.0,
1297
+ 0.0,
1298
+ 0.0,
1299
+ 0.0,
1300
+ 0.0,
1301
+ 0.0
1302
+ ],
1303
+ "q01": [
1304
+ 0.0,
1305
+ 0.0,
1306
+ 0.0,
1307
+ 0.0,
1308
+ 0.0,
1309
+ 0.0,
1310
+ 0.0
1311
+ ],
1312
+ "q99": [
1313
+ 0.0,
1314
+ 0.0,
1315
+ 0.0,
1316
+ 0.0,
1317
+ 0.0,
1318
+ 0.0,
1319
+ 0.0
1320
+ ]
1321
+ },
1322
+ "num_transitions": 97939,
1323
+ "num_trajectories": 1000
1324
+ },
1325
+ "toto/0.1.0": {
1326
+ "action": {
1327
+ "mean": [
1328
+ 0.3854214549064636,
1329
+ 0.007769507821649313,
1330
+ 0.3632742166519165,
1331
+ -0.665202796459198,
1332
+ 0.1890396624803543,
1333
+ 0.0329875648021698,
1334
+ 0.0
1335
+ ],
1336
+ "std": [
1337
+ 0.12211630493402481,
1338
+ 0.19378569722175598,
1339
+ 0.10178232192993164,
1340
+ 0.5725256204605103,
1341
+ 0.298846036195755,
1342
+ 0.32599160075187683,
1343
+ 0.0
1344
+ ],
1345
+ "max": [
1346
+ 0.6839867234230042,
1347
+ 0.4454185664653778,
1348
+ 0.7984078526496887,
1349
+ 2.120781660079956,
1350
+ 1.371164321899414,
1351
+ 1.4118704795837402,
1352
+ 0.0
1353
+ ],
1354
+ "min": [
1355
+ 0.09922284632921219,
1356
+ -0.5180193781852722,
1357
+ 0.13791072368621826,
1358
+ -2.635117530822754,
1359
+ -1.0734480619430542,
1360
+ -1.9282547235488892,
1361
+ 0.0
1362
+ ],
1363
+ "q01": [
1364
+ 0.1756722891330719,
1365
+ -0.3077590811252594,
1366
+ 0.235383919775486,
1367
+ -2.0908505964279174,
1368
+ -0.6191593289375306,
1369
+ -0.7488683319091797,
1370
+ 0.0
1371
+ ],
1372
+ "q99": [
1373
+ 0.6136963081359863,
1374
+ 0.33704194784164443,
1375
+ 0.6681221985816956,
1376
+ 0.7422861719131538,
1377
+ 0.7955395007133507,
1378
+ 0.740464625358582,
1379
+ 0.0
1380
+ ],
1381
+ "mask": [
1382
+ true,
1383
+ true,
1384
+ true,
1385
+ true,
1386
+ true,
1387
+ true,
1388
+ false
1389
+ ]
1390
+ },
1391
+ "proprio": {
1392
+ "mean": [
1393
+ 0.0,
1394
+ 0.0,
1395
+ 0.0,
1396
+ 0.0,
1397
+ 0.0,
1398
+ 0.0,
1399
+ 0.0
1400
+ ],
1401
+ "std": [
1402
+ 0.0,
1403
+ 0.0,
1404
+ 0.0,
1405
+ 0.0,
1406
+ 0.0,
1407
+ 0.0,
1408
+ 0.0
1409
+ ],
1410
+ "max": [
1411
+ 0.0,
1412
+ 0.0,
1413
+ 0.0,
1414
+ 0.0,
1415
+ 0.0,
1416
+ 0.0,
1417
+ 0.0
1418
+ ],
1419
+ "min": [
1420
+ 0.0,
1421
+ 0.0,
1422
+ 0.0,
1423
+ 0.0,
1424
+ 0.0,
1425
+ 0.0,
1426
+ 0.0
1427
+ ],
1428
+ "q01": [
1429
+ 0.0,
1430
+ 0.0,
1431
+ 0.0,
1432
+ 0.0,
1433
+ 0.0,
1434
+ 0.0,
1435
+ 0.0
1436
+ ],
1437
+ "q99": [
1438
+ 0.0,
1439
+ 0.0,
1440
+ 0.0,
1441
+ 0.0,
1442
+ 0.0,
1443
+ 0.0,
1444
+ 0.0
1445
+ ]
1446
+ },
1447
+ "num_transitions": 325699,
1448
+ "num_trajectories": 1003
1449
+ },
1450
+ "language_table/0.1.0": {
1451
+ "action": {
1452
+ "mean": [
1453
+ 0.00014891766477376223,
1454
+ -0.0005636657006107271,
1455
+ 0.0,
1456
+ 0.0,
1457
+ 0.0,
1458
+ 0.0,
1459
+ 1.0
1460
+ ],
1461
+ "std": [
1462
+ 0.030162859708070755,
1463
+ 0.04230763390660286,
1464
+ 0.0,
1465
+ 0.0,
1466
+ 0.0,
1467
+ 0.0,
1468
+ 0.0
1469
+ ],
1470
+ "max": [
1471
+ 0.23357294499874115,
1472
+ 0.24496802687644958,
1473
+ 0.0,
1474
+ 0.0,
1475
+ 0.0,
1476
+ 0.0,
1477
+ 1.0
1478
+ ],
1479
+ "min": [
1480
+ -0.21989956498146057,
1481
+ -0.23736150562763214,
1482
+ 0.0,
1483
+ 0.0,
1484
+ 0.0,
1485
+ 0.0,
1486
+ 1.0
1487
+ ],
1488
+ "q01": [
1489
+ -0.08179590478539467,
1490
+ -0.11795833334326744,
1491
+ 0.0,
1492
+ 0.0,
1493
+ 0.0,
1494
+ 0.0,
1495
+ 1.0
1496
+ ],
1497
+ "q99": [
1498
+ 0.08822273463010788,
1499
+ 0.1191693339496851,
1500
+ 0.0,
1501
+ 0.0,
1502
+ 0.0,
1503
+ 0.0,
1504
+ 1.0
1505
+ ],
1506
+ "mask": [
1507
+ true,
1508
+ true,
1509
+ true,
1510
+ true,
1511
+ true,
1512
+ true,
1513
+ false
1514
+ ]
1515
+ },
1516
+ "proprio": {
1517
+ "mean": [
1518
+ 0.0,
1519
+ 0.0,
1520
+ 0.0,
1521
+ 0.0,
1522
+ 0.0,
1523
+ 0.0,
1524
+ 0.0
1525
+ ],
1526
+ "std": [
1527
+ 0.0,
1528
+ 0.0,
1529
+ 0.0,
1530
+ 0.0,
1531
+ 0.0,
1532
+ 0.0,
1533
+ 0.0
1534
+ ],
1535
+ "max": [
1536
+ 0.0,
1537
+ 0.0,
1538
+ 0.0,
1539
+ 0.0,
1540
+ 0.0,
1541
+ 0.0,
1542
+ 0.0
1543
+ ],
1544
+ "min": [
1545
+ 0.0,
1546
+ 0.0,
1547
+ 0.0,
1548
+ 0.0,
1549
+ 0.0,
1550
+ 0.0,
1551
+ 0.0
1552
+ ],
1553
+ "q01": [
1554
+ 0.0,
1555
+ 0.0,
1556
+ 0.0,
1557
+ 0.0,
1558
+ 0.0,
1559
+ 0.0,
1560
+ 0.0
1561
+ ],
1562
+ "q99": [
1563
+ 0.0,
1564
+ 0.0,
1565
+ 0.0,
1566
+ 0.0,
1567
+ 0.0,
1568
+ 0.0,
1569
+ 0.0
1570
+ ]
1571
+ },
1572
+ "num_transitions": 7045476,
1573
+ "num_trajectories": 442226
1574
+ },
1575
+ "stanford_hydra_dataset_converted_externally_to_rlds/0.1.0": {
1576
+ "action": {
1577
+ "mean": [
1578
+ 0.0007790043600834906,
1579
+ 0.00013707877951674163,
1580
+ -0.000254859565757215,
1581
+ 0.0012903243768960238,
1582
+ -0.004751724191009998,
1583
+ 0.002692892448976636,
1584
+ 0.48855218291282654
1585
+ ],
1586
+ "std": [
1587
+ 0.008022183552384377,
1588
+ 0.009131456725299358,
1589
+ 0.00957438349723816,
1590
+ 0.04122224077582359,
1591
+ 0.03843001648783684,
1592
+ 0.046067025512456894,
1593
+ 0.49978113174438477
1594
+ ],
1595
+ "max": [
1596
+ 0.02499854564666748,
1597
+ 0.02499903365969658,
1598
+ 0.024999922141432762,
1599
+ 0.24974457919597626,
1600
+ 0.24997030198574066,
1601
+ 0.24999946355819702,
1602
+ 1.0
1603
+ ],
1604
+ "min": [
1605
+ -0.024999044835567474,
1606
+ -0.024999700486660004,
1607
+ -0.02499929815530777,
1608
+ -0.24993225932121277,
1609
+ -0.2499666064977646,
1610
+ -0.2499932497739792,
1611
+ 0.0
1612
+ ],
1613
+ "q01": [
1614
+ -0.019992006458342076,
1615
+ -0.02415412735193968,
1616
+ -0.022941758055239916,
1617
+ -0.11085530579090118,
1618
+ -0.12024572037160397,
1619
+ -0.13314770206809043,
1620
+ 0.0
1621
+ ],
1622
+ "q99": [
1623
+ 0.022886231057345868,
1624
+ 0.022358838934451335,
1625
+ 0.02410089675337076,
1626
+ 0.12370114490389822,
1627
+ 0.11323311634361738,
1628
+ 0.18474749639630164,
1629
+ 1.0
1630
+ ],
1631
+ "mask": [
1632
+ true,
1633
+ true,
1634
+ true,
1635
+ true,
1636
+ true,
1637
+ true,
1638
+ false
1639
+ ]
1640
+ },
1641
+ "proprio": {
1642
+ "mean": [
1643
+ 0.0,
1644
+ 0.0,
1645
+ 0.0,
1646
+ 0.0,
1647
+ 0.0,
1648
+ 0.0,
1649
+ 0.0
1650
+ ],
1651
+ "std": [
1652
+ 0.0,
1653
+ 0.0,
1654
+ 0.0,
1655
+ 0.0,
1656
+ 0.0,
1657
+ 0.0,
1658
+ 0.0
1659
+ ],
1660
+ "max": [
1661
+ 0.0,
1662
+ 0.0,
1663
+ 0.0,
1664
+ 0.0,
1665
+ 0.0,
1666
+ 0.0,
1667
+ 0.0
1668
+ ],
1669
+ "min": [
1670
+ 0.0,
1671
+ 0.0,
1672
+ 0.0,
1673
+ 0.0,
1674
+ 0.0,
1675
+ 0.0,
1676
+ 0.0
1677
+ ],
1678
+ "q01": [
1679
+ 0.0,
1680
+ 0.0,
1681
+ 0.0,
1682
+ 0.0,
1683
+ 0.0,
1684
+ 0.0,
1685
+ 0.0
1686
+ ],
1687
+ "q99": [
1688
+ 0.0,
1689
+ 0.0,
1690
+ 0.0,
1691
+ 0.0,
1692
+ 0.0,
1693
+ 0.0,
1694
+ 0.0
1695
+ ]
1696
+ },
1697
+ "num_transitions": 358234,
1698
+ "num_trajectories": 570
1699
+ },
1700
+ "austin_buds_dataset_converted_externally_to_rlds/0.1.0": {
1701
+ "action": {
1702
+ "mean": [
1703
+ -0.07678329944610596,
1704
+ 0.0036849123425781727,
1705
+ 0.05644941329956055,
1706
+ 0.0,
1707
+ 0.0,
1708
+ 0.0,
1709
+ 0.3510494828224182
1710
+ ],
1711
+ "std": [
1712
+ 0.6367746591567993,
1713
+ 0.3788914680480957,
1714
+ 0.47796377539634705,
1715
+ 0.0,
1716
+ 0.0,
1717
+ 0.0,
1718
+ 0.4772108495235443
1719
+ ],
1720
+ "max": [
1721
+ 1.0,
1722
+ 1.0,
1723
+ 1.0,
1724
+ 0.0,
1725
+ 0.0,
1726
+ 0.0,
1727
+ 1.0
1728
+ ],
1729
+ "min": [
1730
+ -1.0,
1731
+ -1.0,
1732
+ -1.0,
1733
+ 0.0,
1734
+ 0.0,
1735
+ 0.0,
1736
+ 0.0
1737
+ ],
1738
+ "q01": [
1739
+ -1.0,
1740
+ -0.9599999785423279,
1741
+ -0.8714285492897034,
1742
+ 0.0,
1743
+ 0.0,
1744
+ 0.0,
1745
+ 0.0
1746
+ ],
1747
+ "q99": [
1748
+ 1.0,
1749
+ 0.8600000143051147,
1750
+ 1.0,
1751
+ 0.0,
1752
+ 0.0,
1753
+ 0.0,
1754
+ 1.0
1755
+ ],
1756
+ "mask": [
1757
+ true,
1758
+ true,
1759
+ true,
1760
+ true,
1761
+ true,
1762
+ true,
1763
+ false
1764
+ ]
1765
+ },
1766
+ "proprio": {
1767
+ "mean": [
1768
+ 0.0,
1769
+ 0.0,
1770
+ 0.0,
1771
+ 0.0,
1772
+ 0.0,
1773
+ 0.0,
1774
+ 0.0
1775
+ ],
1776
+ "std": [
1777
+ 0.0,
1778
+ 0.0,
1779
+ 0.0,
1780
+ 0.0,
1781
+ 0.0,
1782
+ 0.0,
1783
+ 0.0
1784
+ ],
1785
+ "max": [
1786
+ 0.0,
1787
+ 0.0,
1788
+ 0.0,
1789
+ 0.0,
1790
+ 0.0,
1791
+ 0.0,
1792
+ 0.0
1793
+ ],
1794
+ "min": [
1795
+ 0.0,
1796
+ 0.0,
1797
+ 0.0,
1798
+ 0.0,
1799
+ 0.0,
1800
+ 0.0,
1801
+ 0.0
1802
+ ],
1803
+ "q01": [
1804
+ 0.0,
1805
+ 0.0,
1806
+ 0.0,
1807
+ 0.0,
1808
+ 0.0,
1809
+ 0.0,
1810
+ 0.0
1811
+ ],
1812
+ "q99": [
1813
+ 0.0,
1814
+ 0.0,
1815
+ 0.0,
1816
+ 0.0,
1817
+ 0.0,
1818
+ 0.0,
1819
+ 0.0
1820
+ ]
1821
+ },
1822
+ "num_transitions": 34112,
1823
+ "num_trajectories": 50
1824
+ },
1825
+ "nyu_franka_play_dataset_converted_externally_to_rlds/0.1.0": {
1826
+ "action": {
1827
+ "mean": [
1828
+ 0.0010219910182058811,
1829
+ -0.00012002632865915075,
1830
+ 0.00032894135802052915,
1831
+ 0.0015034276293590665,
1832
+ -0.002198528265580535,
1833
+ -0.0016632305923849344,
1834
+ 0.7230083346366882
1835
+ ],
1836
+ "std": [
1837
+ 0.013274150900542736,
1838
+ 0.013215919025242329,
1839
+ 0.01282210648059845,
1840
+ 0.27324533462524414,
1841
+ 0.05702253058552742,
1842
+ 0.03917279839515686,
1843
+ 0.44753193855285645
1844
+ ],
1845
+ "max": [
1846
+ 0.06424188613891602,
1847
+ 0.07027634978294373,
1848
+ 0.06129661202430725,
1849
+ 6.281067848205566,
1850
+ 0.1967729926109314,
1851
+ 0.26377415657043457,
1852
+ 1.0
1853
+ ],
1854
+ "min": [
1855
+ -0.05952230095863342,
1856
+ -0.07232445478439331,
1857
+ -0.06730806827545166,
1858
+ -6.278434753417969,
1859
+ -0.21479034423828125,
1860
+ -0.3627619743347168,
1861
+ 0.0
1862
+ ],
1863
+ "q01": [
1864
+ -0.03199600875377655,
1865
+ -0.032861671447753905,
1866
+ -0.03368805110454559,
1867
+ -0.12080862045288086,
1868
+ -0.12175218224525451,
1869
+ -0.11370223641395569,
1870
+ 0.0
1871
+ ],
1872
+ "q99": [
1873
+ 0.03101520001888276,
1874
+ 0.0373908892273903,
1875
+ 0.03646374464035038,
1876
+ 0.11764093399047852,
1877
+ 0.1258920183777809,
1878
+ 0.09366151213645942,
1879
+ 1.0
1880
+ ],
1881
+ "mask": [
1882
+ true,
1883
+ true,
1884
+ true,
1885
+ true,
1886
+ true,
1887
+ true,
1888
+ false
1889
+ ]
1890
+ },
1891
+ "proprio": {
1892
+ "mean": [
1893
+ 0.0,
1894
+ 0.0,
1895
+ 0.0,
1896
+ 0.0,
1897
+ 0.0,
1898
+ 0.0,
1899
+ 0.0
1900
+ ],
1901
+ "std": [
1902
+ 0.0,
1903
+ 0.0,
1904
+ 0.0,
1905
+ 0.0,
1906
+ 0.0,
1907
+ 0.0,
1908
+ 0.0
1909
+ ],
1910
+ "max": [
1911
+ 0.0,
1912
+ 0.0,
1913
+ 0.0,
1914
+ 0.0,
1915
+ 0.0,
1916
+ 0.0,
1917
+ 0.0
1918
+ ],
1919
+ "min": [
1920
+ 0.0,
1921
+ 0.0,
1922
+ 0.0,
1923
+ 0.0,
1924
+ 0.0,
1925
+ 0.0,
1926
+ 0.0
1927
+ ],
1928
+ "q01": [
1929
+ 0.0,
1930
+ 0.0,
1931
+ 0.0,
1932
+ 0.0,
1933
+ 0.0,
1934
+ 0.0,
1935
+ 0.0
1936
+ ],
1937
+ "q99": [
1938
+ 0.0,
1939
+ 0.0,
1940
+ 0.0,
1941
+ 0.0,
1942
+ 0.0,
1943
+ 0.0,
1944
+ 0.0
1945
+ ]
1946
+ },
1947
+ "num_transitions": 44875,
1948
+ "num_trajectories": 456
1949
+ },
1950
+ "furniture_bench_dataset_converted_externally_to_rlds/0.1.0": {
1951
+ "action": {
1952
+ "mean": [
1953
+ 0.0001461071806261316,
1954
+ 0.0010830992832779884,
1955
+ 0.0006224963581189513,
1956
+ -0.0033032014034688473,
1957
+ -0.002688060747459531,
1958
+ 0.018242614343762398,
1959
+ 0.48854944109916687
1960
+ ],
1961
+ "std": [
1962
+ 0.016107233241200447,
1963
+ 0.014891570433974266,
1964
+ 0.014014236629009247,
1965
+ 0.05827433615922928,
1966
+ 0.11417083442211151,
1967
+ 0.33479660749435425,
1968
+ 0.4999157190322876
1969
+ ],
1970
+ "max": [
1971
+ 0.10000000149011612,
1972
+ 0.10000000149011612,
1973
+ 0.10000000149011612,
1974
+ 0.8651833534240723,
1975
+ 1.0909736156463623,
1976
+ 2.863185405731201,
1977
+ 1.0
1978
+ ],
1979
+ "min": [
1980
+ -0.10495579987764359,
1981
+ -0.10939455777406693,
1982
+ -0.10000000149011612,
1983
+ -0.971906840801239,
1984
+ -1.0475432872772217,
1985
+ -3.06000018119812,
1986
+ 0.0
1987
+ ],
1988
+ "q01": [
1989
+ -0.053988199681043625,
1990
+ -0.05049169331789017,
1991
+ -0.032499241530895236,
1992
+ -0.1953887003660202,
1993
+ -0.41674559473991396,
1994
+ -0.8886768388748169,
1995
+ 0.0
1996
+ ],
1997
+ "q99": [
1998
+ 0.05414841488003723,
1999
+ 0.04965164884924884,
2000
+ 0.060055799782276154,
2001
+ 0.18231668293476103,
2002
+ 0.39867786407470646,
2003
+ 0.8772023963928218,
2004
+ 1.0
2005
+ ],
2006
+ "mask": [
2007
+ true,
2008
+ true,
2009
+ true,
2010
+ true,
2011
+ true,
2012
+ true,
2013
+ false
2014
+ ]
2015
+ },
2016
+ "proprio": {
2017
+ "mean": [
2018
+ 0.0,
2019
+ 0.0,
2020
+ 0.0,
2021
+ 0.0,
2022
+ 0.0,
2023
+ 0.0,
2024
+ 0.0
2025
+ ],
2026
+ "std": [
2027
+ 0.0,
2028
+ 0.0,
2029
+ 0.0,
2030
+ 0.0,
2031
+ 0.0,
2032
+ 0.0,
2033
+ 0.0
2034
+ ],
2035
+ "max": [
2036
+ 0.0,
2037
+ 0.0,
2038
+ 0.0,
2039
+ 0.0,
2040
+ 0.0,
2041
+ 0.0,
2042
+ 0.0
2043
+ ],
2044
+ "min": [
2045
+ 0.0,
2046
+ 0.0,
2047
+ 0.0,
2048
+ 0.0,
2049
+ 0.0,
2050
+ 0.0,
2051
+ 0.0
2052
+ ],
2053
+ "q01": [
2054
+ 0.0,
2055
+ 0.0,
2056
+ 0.0,
2057
+ 0.0,
2058
+ 0.0,
2059
+ 0.0,
2060
+ 0.0
2061
+ ],
2062
+ "q99": [
2063
+ 0.0,
2064
+ 0.0,
2065
+ 0.0,
2066
+ 0.0,
2067
+ 0.0,
2068
+ 0.0,
2069
+ 0.0
2070
+ ]
2071
+ },
2072
+ "num_transitions": 3948057,
2073
+ "num_trajectories": 5100
2074
+ },
2075
+ "ucsd_kitchen_dataset_converted_externally_to_rlds/0.1.0": {
2076
+ "action": {
2077
+ "mean": [
2078
+ 410.375732421875,
2079
+ 116.9518814086914,
2080
+ 192.35031127929688,
2081
+ -121.22441864013672,
2082
+ -33.84892654418945,
2083
+ 50.016136169433594,
2084
+ 0.741813600063324
2085
+ ],
2086
+ "std": [
2087
+ 122.81488037109375,
2088
+ 108.80094909667969,
2089
+ 130.30345153808594,
2090
+ 116.2820053100586,
2091
+ 27.62191390991211,
2092
+ 41.02091979980469,
2093
+ 0.4376337230205536
2094
+ ],
2095
+ "max": [
2096
+ 678.0,
2097
+ 400.0,
2098
+ 507.0,
2099
+ 180.00001525878906,
2100
+ 6.000013828277588,
2101
+ 116.99998474121094,
2102
+ 1.0
2103
+ ],
2104
+ "min": [
2105
+ 172.0,
2106
+ -166.0,
2107
+ -99.99999237060547,
2108
+ -180.00001525878906,
2109
+ -89.0,
2110
+ -96.00010681152344,
2111
+ 0.0
2112
+ ],
2113
+ "q01": [
2114
+ 200.00001052856445,
2115
+ -102.31004211425781,
2116
+ -94.99993370056153,
2117
+ -180.00001525878906,
2118
+ -88.00001525878906,
2119
+ -38.999977111816406,
2120
+ 0.0
2121
+ ],
2122
+ "q99": [
2123
+ 637.0,
2124
+ 368.30999999999995,
2125
+ 493.0,
2126
+ 180.00001525878906,
2127
+ 0.999983012676239,
2128
+ 105.00001525878906,
2129
+ 1.0
2130
+ ],
2131
+ "mask": [
2132
+ true,
2133
+ true,
2134
+ true,
2135
+ true,
2136
+ true,
2137
+ true,
2138
+ false
2139
+ ]
2140
+ },
2141
+ "proprio": {
2142
+ "mean": [
2143
+ 0.0,
2144
+ 0.0,
2145
+ 0.0,
2146
+ 0.0,
2147
+ 0.0,
2148
+ 0.0,
2149
+ 0.0
2150
+ ],
2151
+ "std": [
2152
+ 0.0,
2153
+ 0.0,
2154
+ 0.0,
2155
+ 0.0,
2156
+ 0.0,
2157
+ 0.0,
2158
+ 0.0
2159
+ ],
2160
+ "max": [
2161
+ 0.0,
2162
+ 0.0,
2163
+ 0.0,
2164
+ 0.0,
2165
+ 0.0,
2166
+ 0.0,
2167
+ 0.0
2168
+ ],
2169
+ "min": [
2170
+ 0.0,
2171
+ 0.0,
2172
+ 0.0,
2173
+ 0.0,
2174
+ 0.0,
2175
+ 0.0,
2176
+ 0.0
2177
+ ],
2178
+ "q01": [
2179
+ 0.0,
2180
+ 0.0,
2181
+ 0.0,
2182
+ 0.0,
2183
+ 0.0,
2184
+ 0.0,
2185
+ 0.0
2186
+ ],
2187
+ "q99": [
2188
+ 0.0,
2189
+ 0.0,
2190
+ 0.0,
2191
+ 0.0,
2192
+ 0.0,
2193
+ 0.0,
2194
+ 0.0
2195
+ ]
2196
+ },
2197
+ "num_transitions": 3970,
2198
+ "num_trajectories": 150
2199
+ },
2200
+ "austin_sailor_dataset_converted_externally_to_rlds/0.1.0": {
2201
+ "action": {
2202
+ "mean": [
2203
+ 0.011825386434793472,
2204
+ 0.0064610871486365795,
2205
+ 0.060236409306526184,
2206
+ 0.0,
2207
+ 0.0,
2208
+ 0.0016465834341943264,
2209
+ 0.5260950326919556
2210
+ ],
2211
+ "std": [
2212
+ 0.46348854899406433,
2213
+ 0.41240164637565613,
2214
+ 0.41186293959617615,
2215
+ 0.0,
2216
+ 0.0,
2217
+ 0.0578608438372612,
2218
+ 0.49893733859062195
2219
+ ],
2220
+ "max": [
2221
+ 1.0,
2222
+ 1.0,
2223
+ 1.0,
2224
+ 0.0,
2225
+ 0.0,
2226
+ 0.375,
2227
+ 1.0
2228
+ ],
2229
+ "min": [
2230
+ -1.0,
2231
+ -1.0,
2232
+ -1.0,
2233
+ 0.0,
2234
+ 0.0,
2235
+ -0.375,
2236
+ 0.0
2237
+ ],
2238
+ "q01": [
2239
+ -1.0,
2240
+ -0.9828571677207947,
2241
+ -0.6000000238418579,
2242
+ 0.0,
2243
+ 0.0,
2244
+ -0.17249999940395355,
2245
+ 0.0
2246
+ ],
2247
+ "q99": [
2248
+ 1.0,
2249
+ 0.9457142949104309,
2250
+ 1.0,
2251
+ 0.0,
2252
+ 0.0,
2253
+ 0.17892856895923615,
2254
+ 1.0
2255
+ ],
2256
+ "mask": [
2257
+ true,
2258
+ true,
2259
+ true,
2260
+ true,
2261
+ true,
2262
+ true,
2263
+ false
2264
+ ]
2265
+ },
2266
+ "proprio": {
2267
+ "mean": [
2268
+ 0.0,
2269
+ 0.0,
2270
+ 0.0,
2271
+ 0.0,
2272
+ 0.0,
2273
+ 0.0,
2274
+ 0.0
2275
+ ],
2276
+ "std": [
2277
+ 0.0,
2278
+ 0.0,
2279
+ 0.0,
2280
+ 0.0,
2281
+ 0.0,
2282
+ 0.0,
2283
+ 0.0
2284
+ ],
2285
+ "max": [
2286
+ 0.0,
2287
+ 0.0,
2288
+ 0.0,
2289
+ 0.0,
2290
+ 0.0,
2291
+ 0.0,
2292
+ 0.0
2293
+ ],
2294
+ "min": [
2295
+ 0.0,
2296
+ 0.0,
2297
+ 0.0,
2298
+ 0.0,
2299
+ 0.0,
2300
+ 0.0,
2301
+ 0.0
2302
+ ],
2303
+ "q01": [
2304
+ 0.0,
2305
+ 0.0,
2306
+ 0.0,
2307
+ 0.0,
2308
+ 0.0,
2309
+ 0.0,
2310
+ 0.0
2311
+ ],
2312
+ "q99": [
2313
+ 0.0,
2314
+ 0.0,
2315
+ 0.0,
2316
+ 0.0,
2317
+ 0.0,
2318
+ 0.0,
2319
+ 0.0
2320
+ ]
2321
+ },
2322
+ "num_transitions": 353094,
2323
+ "num_trajectories": 240
2324
+ },
2325
+ "austin_sirius_dataset_converted_externally_to_rlds/0.1.0": {
2326
+ "action": {
2327
+ "mean": [
2328
+ 0.077476866543293,
2329
+ 0.031955525279045105,
2330
+ 0.04244735836982727,
2331
+ 0.0,
2332
+ 0.0,
2333
+ -0.01603454165160656,
2334
+ 0.43260180950164795
2335
+ ],
2336
+ "std": [
2337
+ 0.3906330168247223,
2338
+ 0.2998153865337372,
2339
+ 0.2782270312309265,
2340
+ 0.0,
2341
+ 0.0,
2342
+ 0.08120641857385635,
2343
+ 0.49528202414512634
2344
+ ],
2345
+ "max": [
2346
+ 1.0002285242080688,
2347
+ 0.960608720779419,
2348
+ 1.105179786682129,
2349
+ 0.0,
2350
+ 0.0,
2351
+ 0.341785728931427,
2352
+ 1.0
2353
+ ],
2354
+ "min": [
2355
+ -1.0183025598526,
2356
+ -0.9800000190734863,
2357
+ -0.9774575233459473,
2358
+ 0.0,
2359
+ 0.0,
2360
+ -0.34607142210006714,
2361
+ 0.0
2362
+ ],
2363
+ "q01": [
2364
+ -0.780905865430832,
2365
+ -0.5667179036140442,
2366
+ -0.5254343223571777,
2367
+ 0.0,
2368
+ 0.0,
2369
+ -0.28495091378688814,
2370
+ 0.0
2371
+ ],
2372
+ "q99": [
2373
+ 0.9569637751579284,
2374
+ 0.6971374487876891,
2375
+ 0.8124888157844541,
2376
+ 0.0,
2377
+ 0.0,
2378
+ 0.1971428543329239,
2379
+ 1.0
2380
+ ],
2381
+ "mask": [
2382
+ true,
2383
+ true,
2384
+ true,
2385
+ true,
2386
+ true,
2387
+ true,
2388
+ false
2389
+ ]
2390
+ },
2391
+ "proprio": {
2392
+ "mean": [
2393
+ 0.0,
2394
+ 0.0,
2395
+ 0.0,
2396
+ 0.0,
2397
+ 0.0,
2398
+ 0.0,
2399
+ 0.0
2400
+ ],
2401
+ "std": [
2402
+ 0.0,
2403
+ 0.0,
2404
+ 0.0,
2405
+ 0.0,
2406
+ 0.0,
2407
+ 0.0,
2408
+ 0.0
2409
+ ],
2410
+ "max": [
2411
+ 0.0,
2412
+ 0.0,
2413
+ 0.0,
2414
+ 0.0,
2415
+ 0.0,
2416
+ 0.0,
2417
+ 0.0
2418
+ ],
2419
+ "min": [
2420
+ 0.0,
2421
+ 0.0,
2422
+ 0.0,
2423
+ 0.0,
2424
+ 0.0,
2425
+ 0.0,
2426
+ 0.0
2427
+ ],
2428
+ "q01": [
2429
+ 0.0,
2430
+ 0.0,
2431
+ 0.0,
2432
+ 0.0,
2433
+ 0.0,
2434
+ 0.0,
2435
+ 0.0
2436
+ ],
2437
+ "q99": [
2438
+ 0.0,
2439
+ 0.0,
2440
+ 0.0,
2441
+ 0.0,
2442
+ 0.0,
2443
+ 0.0,
2444
+ 0.0
2445
+ ]
2446
+ },
2447
+ "num_transitions": 279939,
2448
+ "num_trajectories": 559
2449
+ },
2450
+ "dlr_edan_shared_control_converted_externally_to_rlds/0.1.0": {
2451
+ "action": {
2452
+ "mean": [
2453
+ 0.0066478196531534195,
2454
+ -0.0007657355745323002,
2455
+ 0.006522845011204481,
2456
+ 0.0011679773451760411,
2457
+ -0.006395624950528145,
2458
+ -0.011903021484613419,
2459
+ 0.6985887289047241
2460
+ ],
2461
+ "std": [
2462
+ 0.021393585950136185,
2463
+ 0.018142299726605415,
2464
+ 0.03374377265572548,
2465
+ 0.01743541844189167,
2466
+ 0.03394372761249542,
2467
+ 0.04641878604888916,
2468
+ 0.45885783433914185
2469
+ ],
2470
+ "max": [
2471
+ 0.18991442024707794,
2472
+ 0.0739002525806427,
2473
+ 0.18064819276332855,
2474
+ 0.0866486132144928,
2475
+ 0.13464981317520142,
2476
+ 0.16910280287265778,
2477
+ 1.0
2478
+ ],
2479
+ "min": [
2480
+ -0.10054297000169754,
2481
+ -0.08427435159683228,
2482
+ -0.13533438742160797,
2483
+ -0.17556548118591309,
2484
+ -0.18485672771930695,
2485
+ -0.2680685818195343,
2486
+ 0.0
2487
+ ],
2488
+ "q01": [
2489
+ -0.02987122368067503,
2490
+ -0.06013262912631035,
2491
+ -0.08286409199237824,
2492
+ -0.05924444157630205,
2493
+ -0.15986866518855095,
2494
+ -0.15636983573436739,
2495
+ 0.0
2496
+ ],
2497
+ "q99": [
2498
+ 0.08832092039287087,
2499
+ 0.042126184627413736,
2500
+ 0.11311905644834042,
2501
+ 0.0643695573508739,
2502
+ 0.03941855944693088,
2503
+ 0.156646853685379,
2504
+ 1.0
2505
+ ],
2506
+ "mask": [
2507
+ true,
2508
+ true,
2509
+ true,
2510
+ true,
2511
+ true,
2512
+ true,
2513
+ false
2514
+ ]
2515
+ },
2516
+ "proprio": {
2517
+ "mean": [
2518
+ 0.0,
2519
+ 0.0,
2520
+ 0.0,
2521
+ 0.0,
2522
+ 0.0,
2523
+ 0.0,
2524
+ 0.0
2525
+ ],
2526
+ "std": [
2527
+ 0.0,
2528
+ 0.0,
2529
+ 0.0,
2530
+ 0.0,
2531
+ 0.0,
2532
+ 0.0,
2533
+ 0.0
2534
+ ],
2535
+ "max": [
2536
+ 0.0,
2537
+ 0.0,
2538
+ 0.0,
2539
+ 0.0,
2540
+ 0.0,
2541
+ 0.0,
2542
+ 0.0
2543
+ ],
2544
+ "min": [
2545
+ 0.0,
2546
+ 0.0,
2547
+ 0.0,
2548
+ 0.0,
2549
+ 0.0,
2550
+ 0.0,
2551
+ 0.0
2552
+ ],
2553
+ "q01": [
2554
+ 0.0,
2555
+ 0.0,
2556
+ 0.0,
2557
+ 0.0,
2558
+ 0.0,
2559
+ 0.0,
2560
+ 0.0
2561
+ ],
2562
+ "q99": [
2563
+ 0.0,
2564
+ 0.0,
2565
+ 0.0,
2566
+ 0.0,
2567
+ 0.0,
2568
+ 0.0,
2569
+ 0.0
2570
+ ]
2571
+ },
2572
+ "num_transitions": 8928,
2573
+ "num_trajectories": 104
2574
+ },
2575
+ "iamlab_cmu_pickup_insert_converted_externally_to_rlds/0.1.0": {
2576
+ "action": {
2577
+ "mean": [
2578
+ 0.5274373292922974,
2579
+ 0.028582017868757248,
2580
+ 0.18712472915649414,
2581
+ 1.2339569330215454,
2582
+ 0.03226622939109802,
2583
+ -1.4199472665786743,
2584
+ 0.5550631880760193
2585
+ ],
2586
+ "std": [
2587
+ 0.08108346909284592,
2588
+ 0.1116756722331047,
2589
+ 0.07747555524110794,
2590
+ 2.8737244606018066,
2591
+ 0.02774704433977604,
2592
+ 2.7678685188293457,
2593
+ 0.4969509243965149
2594
+ ],
2595
+ "max": [
2596
+ 0.6634981632232666,
2597
+ 0.23428471386432648,
2598
+ 0.4308285415172577,
2599
+ 3.1415927410125732,
2600
+ 0.13647015392780304,
2601
+ 3.141592502593994,
2602
+ 1.0
2603
+ ],
2604
+ "min": [
2605
+ 0.3071657121181488,
2606
+ -0.29754969477653503,
2607
+ 0.06578229367733002,
2608
+ -3.1415927410125732,
2609
+ -0.04584203287959099,
2610
+ -3.141592502593994,
2611
+ 0.0
2612
+ ],
2613
+ "q01": [
2614
+ 0.3148897051811218,
2615
+ -0.20317550599575043,
2616
+ 0.06785467118024827,
2617
+ -3.140952730178833,
2618
+ -0.029743434861302376,
2619
+ -3.141091251373291,
2620
+ 0.0
2621
+ ],
2622
+ "q99": [
2623
+ 0.6472805738449097,
2624
+ 0.20846802592277527,
2625
+ 0.36855655312538155,
2626
+ 3.1409926891326903,
2627
+ 0.11424950212240226,
2628
+ 3.1410969257354737,
2629
+ 1.0
2630
+ ],
2631
+ "mask": [
2632
+ true,
2633
+ true,
2634
+ true,
2635
+ true,
2636
+ true,
2637
+ true,
2638
+ false
2639
+ ]
2640
+ },
2641
+ "proprio": {
2642
+ "mean": [
2643
+ 0.0,
2644
+ 0.0,
2645
+ 0.0,
2646
+ 0.0,
2647
+ 0.0,
2648
+ 0.0,
2649
+ 0.0
2650
+ ],
2651
+ "std": [
2652
+ 0.0,
2653
+ 0.0,
2654
+ 0.0,
2655
+ 0.0,
2656
+ 0.0,
2657
+ 0.0,
2658
+ 0.0
2659
+ ],
2660
+ "max": [
2661
+ 0.0,
2662
+ 0.0,
2663
+ 0.0,
2664
+ 0.0,
2665
+ 0.0,
2666
+ 0.0,
2667
+ 0.0
2668
+ ],
2669
+ "min": [
2670
+ 0.0,
2671
+ 0.0,
2672
+ 0.0,
2673
+ 0.0,
2674
+ 0.0,
2675
+ 0.0,
2676
+ 0.0
2677
+ ],
2678
+ "q01": [
2679
+ 0.0,
2680
+ 0.0,
2681
+ 0.0,
2682
+ 0.0,
2683
+ 0.0,
2684
+ 0.0,
2685
+ 0.0
2686
+ ],
2687
+ "q99": [
2688
+ 0.0,
2689
+ 0.0,
2690
+ 0.0,
2691
+ 0.0,
2692
+ 0.0,
2693
+ 0.0,
2694
+ 0.0
2695
+ ]
2696
+ },
2697
+ "num_transitions": 146241,
2698
+ "num_trajectories": 631
2699
+ },
2700
+ "utaustin_mutex/0.1.0": {
2701
+ "action": {
2702
+ "mean": [
2703
+ 0.06176406517624855,
2704
+ -0.005005490034818649,
2705
+ 0.10216782987117767,
2706
+ -0.03314131125807762,
2707
+ 0.013895022682845592,
2708
+ -0.011317633092403412,
2709
+ 0.5038976669311523
2710
+ ],
2711
+ "std": [
2712
+ 0.187501460313797,
2713
+ 0.4468473196029663,
2714
+ 0.3792876601219177,
2715
+ 0.14097853004932404,
2716
+ 0.06453699618577957,
2717
+ 0.11765265464782715,
2718
+ 0.501045286655426
2719
+ ],
2720
+ "max": [
2721
+ 1.0,
2722
+ 1.0,
2723
+ 1.0,
2724
+ 0.375,
2725
+ 0.375,
2726
+ 0.375,
2727
+ 1.0
2728
+ ],
2729
+ "min": [
2730
+ -1.0,
2731
+ -1.0,
2732
+ -1.0,
2733
+ -0.375,
2734
+ -0.375,
2735
+ -0.375,
2736
+ 0.0
2737
+ ],
2738
+ "q01": [
2739
+ -0.4285714328289032,
2740
+ -0.9800000190734863,
2741
+ -0.5571428537368774,
2742
+ -0.375,
2743
+ -0.15642857551574707,
2744
+ -0.335357129573822,
2745
+ 0.0
2746
+ ],
2747
+ "q99": [
2748
+ 0.5914285778999329,
2749
+ 0.9714285731315613,
2750
+ 1.0,
2751
+ 0.3278571367263794,
2752
+ 0.207857146859169,
2753
+ 0.25607141852378845,
2754
+ 1.0
2755
+ ],
2756
+ "mask": [
2757
+ true,
2758
+ true,
2759
+ true,
2760
+ true,
2761
+ true,
2762
+ true,
2763
+ false
2764
+ ]
2765
+ },
2766
+ "proprio": {
2767
+ "mean": [
2768
+ 0.0,
2769
+ 0.0,
2770
+ 0.0,
2771
+ 0.0,
2772
+ 0.0,
2773
+ 0.0,
2774
+ 0.0
2775
+ ],
2776
+ "std": [
2777
+ 0.0,
2778
+ 0.0,
2779
+ 0.0,
2780
+ 0.0,
2781
+ 0.0,
2782
+ 0.0,
2783
+ 0.0
2784
+ ],
2785
+ "max": [
2786
+ 0.0,
2787
+ 0.0,
2788
+ 0.0,
2789
+ 0.0,
2790
+ 0.0,
2791
+ 0.0,
2792
+ 0.0
2793
+ ],
2794
+ "min": [
2795
+ 0.0,
2796
+ 0.0,
2797
+ 0.0,
2798
+ 0.0,
2799
+ 0.0,
2800
+ 0.0,
2801
+ 0.0
2802
+ ],
2803
+ "q01": [
2804
+ 0.0,
2805
+ 0.0,
2806
+ 0.0,
2807
+ 0.0,
2808
+ 0.0,
2809
+ 0.0,
2810
+ 0.0
2811
+ ],
2812
+ "q99": [
2813
+ 0.0,
2814
+ 0.0,
2815
+ 0.0,
2816
+ 0.0,
2817
+ 0.0,
2818
+ 0.0,
2819
+ 0.0
2820
+ ]
2821
+ },
2822
+ "num_transitions": 361883,
2823
+ "num_trajectories": 1500
2824
+ },
2825
+ "berkeley_fanuc_manipulation/0.1.0": {
2826
+ "action": {
2827
+ "mean": [
2828
+ 0.0007744057802483439,
2829
+ -0.00031240080716088414,
2830
+ -0.0015001941937953234,
2831
+ -0.0007515158504247665,
2832
+ -0.00015832878125365824,
2833
+ 0.00014327642566058785,
2834
+ 0.699295699596405
2835
+ ],
2836
+ "std": [
2837
+ 0.0034070133697241545,
2838
+ 0.00499219074845314,
2839
+ 0.005344326142221689,
2840
+ 0.007599010597914457,
2841
+ 0.004081932827830315,
2842
+ 0.008568963967263699,
2843
+ 0.45868709683418274
2844
+ ],
2845
+ "max": [
2846
+ 0.009999999776482582,
2847
+ 0.009999999776482582,
2848
+ 0.009999999776482582,
2849
+ 0.03490658476948738,
2850
+ 0.03490658476948738,
2851
+ 0.03490658476948738,
2852
+ 1.0
2853
+ ],
2854
+ "min": [
2855
+ -0.009999999776482582,
2856
+ -0.009999999776482582,
2857
+ -0.009999999776482582,
2858
+ -0.03490658476948738,
2859
+ -0.03490658476948738,
2860
+ -0.03490658476948738,
2861
+ 0.0
2862
+ ],
2863
+ "q01": [
2864
+ -0.009999999776482582,
2865
+ -0.009999999776482582,
2866
+ -0.009999999776482582,
2867
+ -0.03490658476948738,
2868
+ 0.0,
2869
+ -0.03490658476948738,
2870
+ 0.0
2871
+ ],
2872
+ "q99": [
2873
+ 0.009999999776482582,
2874
+ 0.009999999776482582,
2875
+ 0.009999999776482582,
2876
+ 0.03490658476948738,
2877
+ 0.0,
2878
+ 0.03490658476948738,
2879
+ 1.0
2880
+ ],
2881
+ "mask": [
2882
+ true,
2883
+ true,
2884
+ true,
2885
+ true,
2886
+ true,
2887
+ true,
2888
+ false
2889
+ ]
2890
+ },
2891
+ "proprio": {
2892
+ "mean": [
2893
+ 0.0,
2894
+ 0.0,
2895
+ 0.0,
2896
+ 0.0,
2897
+ 0.0,
2898
+ 0.0,
2899
+ 0.0
2900
+ ],
2901
+ "std": [
2902
+ 0.0,
2903
+ 0.0,
2904
+ 0.0,
2905
+ 0.0,
2906
+ 0.0,
2907
+ 0.0,
2908
+ 0.0
2909
+ ],
2910
+ "max": [
2911
+ 0.0,
2912
+ 0.0,
2913
+ 0.0,
2914
+ 0.0,
2915
+ 0.0,
2916
+ 0.0,
2917
+ 0.0
2918
+ ],
2919
+ "min": [
2920
+ 0.0,
2921
+ 0.0,
2922
+ 0.0,
2923
+ 0.0,
2924
+ 0.0,
2925
+ 0.0,
2926
+ 0.0
2927
+ ],
2928
+ "q01": [
2929
+ 0.0,
2930
+ 0.0,
2931
+ 0.0,
2932
+ 0.0,
2933
+ 0.0,
2934
+ 0.0,
2935
+ 0.0
2936
+ ],
2937
+ "q99": [
2938
+ 0.0,
2939
+ 0.0,
2940
+ 0.0,
2941
+ 0.0,
2942
+ 0.0,
2943
+ 0.0,
2944
+ 0.0
2945
+ ]
2946
+ },
2947
+ "num_transitions": 62613,
2948
+ "num_trajectories": 415
2949
+ },
2950
+ "cmu_stretch/0.1.0": {
2951
+ "action": {
2952
+ "mean": [
2953
+ 0.0003630445571616292,
2954
+ 0.0,
2955
+ 0.0016466928645968437,
2956
+ 0.0,
2957
+ 0.0,
2958
+ 0.0,
2959
+ 0.3987048268318176
2960
+ ],
2961
+ "std": [
2962
+ 0.004081855062395334,
2963
+ 0.0,
2964
+ 0.003774340031668544,
2965
+ 0.0,
2966
+ 0.0,
2967
+ 0.0,
2968
+ 0.489638090133667
2969
+ ],
2970
+ "max": [
2971
+ 0.02338407188653946,
2972
+ 0.0,
2973
+ 0.023404927924275398,
2974
+ 0.0,
2975
+ 0.0,
2976
+ 0.0,
2977
+ 1.0
2978
+ ],
2979
+ "min": [
2980
+ -0.019353797659277916,
2981
+ 0.0,
2982
+ -0.02019215188920498,
2983
+ 0.0,
2984
+ 0.0,
2985
+ 0.0,
2986
+ 0.0
2987
+ ],
2988
+ "q01": [
2989
+ -0.011175686959177256,
2990
+ 0.0,
2991
+ -0.0032206363626755773,
2992
+ 0.0,
2993
+ 0.0,
2994
+ 0.0,
2995
+ 0.0
2996
+ ],
2997
+ "q99": [
2998
+ 0.014501785952597848,
2999
+ 0.0,
3000
+ 0.015056106168776728,
3001
+ 0.0,
3002
+ 0.0,
3003
+ 0.0,
3004
+ 1.0
3005
+ ],
3006
+ "mask": [
3007
+ true,
3008
+ true,
3009
+ true,
3010
+ true,
3011
+ true,
3012
+ true,
3013
+ false
3014
+ ]
3015
+ },
3016
+ "proprio": {
3017
+ "mean": [
3018
+ 0.0,
3019
+ 0.0,
3020
+ 0.0,
3021
+ 0.0,
3022
+ 0.0,
3023
+ 0.0,
3024
+ 0.0
3025
+ ],
3026
+ "std": [
3027
+ 0.0,
3028
+ 0.0,
3029
+ 0.0,
3030
+ 0.0,
3031
+ 0.0,
3032
+ 0.0,
3033
+ 0.0
3034
+ ],
3035
+ "max": [
3036
+ 0.0,
3037
+ 0.0,
3038
+ 0.0,
3039
+ 0.0,
3040
+ 0.0,
3041
+ 0.0,
3042
+ 0.0
3043
+ ],
3044
+ "min": [
3045
+ 0.0,
3046
+ 0.0,
3047
+ 0.0,
3048
+ 0.0,
3049
+ 0.0,
3050
+ 0.0,
3051
+ 0.0
3052
+ ],
3053
+ "q01": [
3054
+ 0.0,
3055
+ 0.0,
3056
+ 0.0,
3057
+ 0.0,
3058
+ 0.0,
3059
+ 0.0,
3060
+ 0.0
3061
+ ],
3062
+ "q99": [
3063
+ 0.0,
3064
+ 0.0,
3065
+ 0.0,
3066
+ 0.0,
3067
+ 0.0,
3068
+ 0.0,
3069
+ 0.0
3070
+ ]
3071
+ },
3072
+ "num_transitions": 25016,
3073
+ "num_trajectories": 135
3074
+ },
3075
+ "bc_z/0.1.0": {
3076
+ "action": {
3077
+ "mean": [
3078
+ -0.009958645328879356,
3079
+ 0.0008958434336818755,
3080
+ 0.00499522453173995,
3081
+ 0.000297540333122015,
3082
+ -0.008734511211514473,
3083
+ -0.03068969026207924,
3084
+ 0.8344562649726868
3085
+ ],
3086
+ "std": [
3087
+ 0.030533093959093094,
3088
+ 0.0231416504830122,
3089
+ 0.020642085000872612,
3090
+ 0.04156165570020676,
3091
+ 0.04643021523952484,
3092
+ 0.07697845250368118,
3093
+ 0.36111101508140564
3094
+ ],
3095
+ "max": [
3096
+ 0.2165454924106598,
3097
+ 0.1251407265663147,
3098
+ 0.10772687941789627,
3099
+ 0.33544227480888367,
3100
+ 0.28117990493774414,
3101
+ 0.40614867210388184,
3102
+ 1.0
3103
+ ],
3104
+ "min": [
3105
+ -0.1677047461271286,
3106
+ -0.14630407094955444,
3107
+ -0.10066790133714676,
3108
+ -0.29421567916870117,
3109
+ -0.32101404666900635,
3110
+ -0.4635624885559082,
3111
+ 0.0
3112
+ ],
3113
+ "q01": [
3114
+ -0.09220654994249344,
3115
+ -0.06456145539879798,
3116
+ -0.049121275544166565,
3117
+ -0.11594625547528267,
3118
+ -0.14152548640966414,
3119
+ -0.2251061636209488,
3120
+ 0.0
3121
+ ],
3122
+ "q99": [
3123
+ 0.07628866866230968,
3124
+ 0.058019736707210584,
3125
+ 0.052540797740221024,
3126
+ 0.11740604028105736,
3127
+ 0.11703975558280955,
3128
+ 0.16729306846857078,
3129
+ 1.0
3130
+ ],
3131
+ "mask": [
3132
+ true,
3133
+ true,
3134
+ true,
3135
+ true,
3136
+ true,
3137
+ true,
3138
+ false
3139
+ ]
3140
+ },
3141
+ "proprio": {
3142
+ "mean": [
3143
+ 0.0,
3144
+ 0.0,
3145
+ 0.0,
3146
+ 0.0,
3147
+ 0.0,
3148
+ 0.0,
3149
+ 0.0
3150
+ ],
3151
+ "std": [
3152
+ 0.0,
3153
+ 0.0,
3154
+ 0.0,
3155
+ 0.0,
3156
+ 0.0,
3157
+ 0.0,
3158
+ 0.0
3159
+ ],
3160
+ "max": [
3161
+ 0.0,
3162
+ 0.0,
3163
+ 0.0,
3164
+ 0.0,
3165
+ 0.0,
3166
+ 0.0,
3167
+ 0.0
3168
+ ],
3169
+ "min": [
3170
+ 0.0,
3171
+ 0.0,
3172
+ 0.0,
3173
+ 0.0,
3174
+ 0.0,
3175
+ 0.0,
3176
+ 0.0
3177
+ ],
3178
+ "q01": [
3179
+ 0.0,
3180
+ 0.0,
3181
+ 0.0,
3182
+ 0.0,
3183
+ 0.0,
3184
+ 0.0,
3185
+ 0.0
3186
+ ],
3187
+ "q99": [
3188
+ 0.0,
3189
+ 0.0,
3190
+ 0.0,
3191
+ 0.0,
3192
+ 0.0,
3193
+ 0.0,
3194
+ 0.0
3195
+ ]
3196
+ },
3197
+ "num_transitions": 6015535,
3198
+ "num_trajectories": 43264
3199
+ },
3200
+ "fmb_dataset/1.0.0": {
3201
+ "action": {
3202
+ "mean": [
3203
+ 0.05902976542711258,
3204
+ -0.06476633995771408,
3205
+ -0.09787469357252121,
3206
+ 0.004325387068092823,
3207
+ 0.00028963759541511536,
3208
+ -0.04457257315516472,
3209
+ 0.7336440086364746
3210
+ ],
3211
+ "std": [
3212
+ 0.28809186816215515,
3213
+ 0.2820416986942291,
3214
+ 0.4626740515232086,
3215
+ 0.3266514539718628,
3216
+ 0.10842999070882797,
3217
+ 0.34400978684425354,
3218
+ 0.4435289800167084
3219
+ ],
3220
+ "max": [
3221
+ 1.399999976158142,
3222
+ 1.0,
3223
+ 1.399999976158142,
3224
+ 1.0,
3225
+ 1.0,
3226
+ 1.0,
3227
+ 1.0
3228
+ ],
3229
+ "min": [
3230
+ -1.399999976158142,
3231
+ -1.399999976158142,
3232
+ -1.0,
3233
+ -1.0,
3234
+ -1.0,
3235
+ -1.0,
3236
+ 0.0
3237
+ ],
3238
+ "q01": [
3239
+ -0.8257142901420593,
3240
+ -1.399999976158142,
3241
+ -1.0,
3242
+ -1.0,
3243
+ -0.3028571307659149,
3244
+ -1.0,
3245
+ 0.0
3246
+ ],
3247
+ "q99": [
3248
+ 1.0,
3249
+ 0.5257142782211304,
3250
+ 1.0,
3251
+ 1.0,
3252
+ 0.3400000035762787,
3253
+ 1.0,
3254
+ 1.0
3255
+ ],
3256
+ "mask": [
3257
+ true,
3258
+ true,
3259
+ true,
3260
+ true,
3261
+ true,
3262
+ true,
3263
+ false
3264
+ ]
3265
+ },
3266
+ "proprio": {
3267
+ "mean": [
3268
+ 0.0,
3269
+ 0.0,
3270
+ 0.0,
3271
+ 0.0,
3272
+ 0.0,
3273
+ 0.0,
3274
+ 0.0
3275
+ ],
3276
+ "std": [
3277
+ 0.0,
3278
+ 0.0,
3279
+ 0.0,
3280
+ 0.0,
3281
+ 0.0,
3282
+ 0.0,
3283
+ 0.0
3284
+ ],
3285
+ "max": [
3286
+ 0.0,
3287
+ 0.0,
3288
+ 0.0,
3289
+ 0.0,
3290
+ 0.0,
3291
+ 0.0,
3292
+ 0.0
3293
+ ],
3294
+ "min": [
3295
+ 0.0,
3296
+ 0.0,
3297
+ 0.0,
3298
+ 0.0,
3299
+ 0.0,
3300
+ 0.0,
3301
+ 0.0
3302
+ ],
3303
+ "q01": [
3304
+ 0.0,
3305
+ 0.0,
3306
+ 0.0,
3307
+ 0.0,
3308
+ 0.0,
3309
+ 0.0,
3310
+ 0.0
3311
+ ],
3312
+ "q99": [
3313
+ 0.0,
3314
+ 0.0,
3315
+ 0.0,
3316
+ 0.0,
3317
+ 0.0,
3318
+ 0.0,
3319
+ 0.0
3320
+ ]
3321
+ },
3322
+ "num_transitions": 1137459,
3323
+ "num_trajectories": 8612
3324
+ },
3325
+ "dobbe/0.0.1": {
3326
+ "action": {
3327
+ "mean": [
3328
+ -0.00011206958151888102,
3329
+ 0.0011229681549593806,
3330
+ -0.00010193959315074608,
3331
+ -7.37128357286565e-05,
3332
+ -0.0006753374473191798,
3333
+ -5.664441778208129e-05,
3334
+ 0.6318688988685608
3335
+ ],
3336
+ "std": [
3337
+ 0.042660679668188095,
3338
+ 0.04428431764245033,
3339
+ 0.12224890291690826,
3340
+ 0.005388470832258463,
3341
+ 0.011246936395764351,
3342
+ 0.006288259290158749,
3343
+ 0.3973240256309509
3344
+ ],
3345
+ "max": [
3346
+ 38.590423583984375,
3347
+ 17.932697296142578,
3348
+ 4.843764305114746,
3349
+ 1.4372116327285767,
3350
+ 0.4340403974056244,
3351
+ 1.2057193517684937,
3352
+ 0.9998947381973267
3353
+ ],
3354
+ "min": [
3355
+ -5.700923442840576,
3356
+ -21.605947494506836,
3357
+ -123.72489929199219,
3358
+ -1.7229845523834229,
3359
+ -0.4998578727245331,
3360
+ -0.8867913484573364,
3361
+ 1.4196479014572105e-06
3362
+ ],
3363
+ "q01": [
3364
+ -0.01119564864784479,
3365
+ -0.014266146533191203,
3366
+ -0.0071747214533388615,
3367
+ -0.009444301575422287,
3368
+ -0.03990109823644161,
3369
+ -0.017422311007976532,
3370
+ 4.003279136668425e-05
3371
+ ],
3372
+ "q99": [
3373
+ 0.01015154086053368,
3374
+ 0.017181577533483497,
3375
+ 0.007216989761218411,
3376
+ 0.010380979906767595,
3377
+ 0.03556173853576176,
3378
+ 0.018032474815845446,
3379
+ 0.9982578039169312
3380
+ ],
3381
+ "mask": [
3382
+ true,
3383
+ true,
3384
+ true,
3385
+ true,
3386
+ true,
3387
+ true,
3388
+ false
3389
+ ]
3390
+ },
3391
+ "proprio": {
3392
+ "mean": [
3393
+ 0.0,
3394
+ 0.0,
3395
+ 0.0,
3396
+ 0.0,
3397
+ 0.0,
3398
+ 0.0,
3399
+ 0.0
3400
+ ],
3401
+ "std": [
3402
+ 0.0,
3403
+ 0.0,
3404
+ 0.0,
3405
+ 0.0,
3406
+ 0.0,
3407
+ 0.0,
3408
+ 0.0
3409
+ ],
3410
+ "max": [
3411
+ 0.0,
3412
+ 0.0,
3413
+ 0.0,
3414
+ 0.0,
3415
+ 0.0,
3416
+ 0.0,
3417
+ 0.0
3418
+ ],
3419
+ "min": [
3420
+ 0.0,
3421
+ 0.0,
3422
+ 0.0,
3423
+ 0.0,
3424
+ 0.0,
3425
+ 0.0,
3426
+ 0.0
3427
+ ],
3428
+ "q01": [
3429
+ 0.0,
3430
+ 0.0,
3431
+ 0.0,
3432
+ 0.0,
3433
+ 0.0,
3434
+ 0.0,
3435
+ 0.0
3436
+ ],
3437
+ "q99": [
3438
+ 0.0,
3439
+ 0.0,
3440
+ 0.0,
3441
+ 0.0,
3442
+ 0.0,
3443
+ 0.0,
3444
+ 0.0
3445
+ ]
3446
+ },
3447
+ "num_transitions": 1139911,
3448
+ "num_trajectories": 5208
3449
+ },
3450
+ "droid/1.0.0": {
3451
+ "action": {
3452
+ "mean": [
3453
+ 0.027425529435276985,
3454
+ -0.0026820411439985037,
3455
+ 0.01595238223671913,
3456
+ 0.0035501928068697453,
3457
+ -0.030532635748386383,
3458
+ -0.006685464642941952,
3459
+ 0.5860344171524048
3460
+ ],
3461
+ "std": [
3462
+ 0.25387412309646606,
3463
+ 0.18426834046840668,
3464
+ 0.22532416880130768,
3465
+ 0.21757009625434875,
3466
+ 0.22572560608386993,
3467
+ 0.2867794930934906,
3468
+ 0.4287726879119873
3469
+ ],
3470
+ "max": [
3471
+ 0.9999998211860657,
3472
+ 0.999991774559021,
3473
+ 0.9999973177909851,
3474
+ 0.9999874830245972,
3475
+ 0.9999954104423523,
3476
+ 0.9999998807907104,
3477
+ 1.0
3478
+ ],
3479
+ "min": [
3480
+ -0.9999999403953552,
3481
+ -0.9999951124191284,
3482
+ -0.9999960660934448,
3483
+ -0.9999980330467224,
3484
+ -0.9999982118606567,
3485
+ -0.9999998807907104,
3486
+ 0.0
3487
+ ],
3488
+ "q01": [
3489
+ -0.7776297926902771,
3490
+ -0.5803514122962952,
3491
+ -0.5795090794563293,
3492
+ -0.6464047729969025,
3493
+ -0.7041108310222626,
3494
+ -0.8895104378461838,
3495
+ 0.0
3496
+ ],
3497
+ "q99": [
3498
+ 0.7597932070493698,
3499
+ 0.5726242214441299,
3500
+ 0.7351000607013702,
3501
+ 0.6705610305070877,
3502
+ 0.6464948207139969,
3503
+ 0.8897542208433151,
3504
+ 1.0
3505
+ ],
3506
+ "mask": [
3507
+ true,
3508
+ true,
3509
+ true,
3510
+ true,
3511
+ true,
3512
+ true,
3513
+ false
3514
+ ]
3515
+ },
3516
+ "proprio": {
3517
+ "mean": [
3518
+ 0.0,
3519
+ 0.0,
3520
+ 0.0,
3521
+ 0.0,
3522
+ 0.0,
3523
+ 0.0,
3524
+ 0.0
3525
+ ],
3526
+ "std": [
3527
+ 0.0,
3528
+ 0.0,
3529
+ 0.0,
3530
+ 0.0,
3531
+ 0.0,
3532
+ 0.0,
3533
+ 0.0
3534
+ ],
3535
+ "max": [
3536
+ 0.0,
3537
+ 0.0,
3538
+ 0.0,
3539
+ 0.0,
3540
+ 0.0,
3541
+ 0.0,
3542
+ 0.0
3543
+ ],
3544
+ "min": [
3545
+ 0.0,
3546
+ 0.0,
3547
+ 0.0,
3548
+ 0.0,
3549
+ 0.0,
3550
+ 0.0,
3551
+ 0.0
3552
+ ],
3553
+ "q01": [
3554
+ 0.0,
3555
+ 0.0,
3556
+ 0.0,
3557
+ 0.0,
3558
+ 0.0,
3559
+ 0.0,
3560
+ 0.0
3561
+ ],
3562
+ "q99": [
3563
+ 0.0,
3564
+ 0.0,
3565
+ 0.0,
3566
+ 0.0,
3567
+ 0.0,
3568
+ 0.0,
3569
+ 0.0
3570
+ ]
3571
+ },
3572
+ "num_transitions": 27044326,
3573
+ "num_trajectories": 92233
3574
+ },
3575
+ "rh20t_rlds/1.0.0": {
3576
+ "action": {
3577
+ "mean": [
3578
+ -5.332157638779582e+28,
3579
+ -1.5128827327837974e+29,
3580
+ -1.832736619079747e+28,
3581
+ 0.5735913515090942,
3582
+ -0.00847744569182396,
3583
+ -0.5566052198410034,
3584
+ 0.3186892569065094
3585
+ ],
3586
+ "std": [
3587
+ Infinity,
3588
+ Infinity,
3589
+ Infinity,
3590
+ 2.2581026554107666,
3591
+ 0.1548534482717514,
3592
+ 2.2581026554107666,
3593
+ 0.39917993545532227
3594
+ ],
3595
+ "max": [
3596
+ 7.582831568163597e+35,
3597
+ 7.557172735451728e+35,
3598
+ 2.2717764477020827e+27,
3599
+ 3.1415927410125732,
3600
+ 1.5116956233978271,
3601
+ 3.1415927410125732,
3602
+ 1.0
3603
+ ],
3604
+ "min": [
3605
+ -3.5543094244408723e+36,
3606
+ -8.723098019507117e+36,
3607
+ -9.648338287048974e+35,
3608
+ -3.1415927410125732,
3609
+ -1.5062522888183594,
3610
+ -3.1415927410125732,
3611
+ 0.0
3612
+ ],
3613
+ "q01": [
3614
+ 0.36028257966041566,
3615
+ -0.272584410905838,
3616
+ 0.005985925104469062,
3617
+ -3.1411514282226562,
3618
+ -0.5925320792198181,
3619
+ -3.1415159702301025,
3620
+ 0.0
3621
+ ],
3622
+ "q99": [
3623
+ 0.7534684538841248,
3624
+ 0.31738221645355225,
3625
+ 0.33061375379562374,
3626
+ 3.141425132751465,
3627
+ 0.47507260441780086,
3628
+ 3.141479730606079,
3629
+ 1.0
3630
+ ],
3631
+ "mask": [
3632
+ true,
3633
+ true,
3634
+ true,
3635
+ true,
3636
+ true,
3637
+ true,
3638
+ false
3639
+ ]
3640
+ },
3641
+ "proprio": {
3642
+ "mean": [
3643
+ 0.0,
3644
+ 0.0,
3645
+ 0.0,
3646
+ 0.0,
3647
+ 0.0,
3648
+ 0.0,
3649
+ 0.0
3650
+ ],
3651
+ "std": [
3652
+ 0.0,
3653
+ 0.0,
3654
+ 0.0,
3655
+ 0.0,
3656
+ 0.0,
3657
+ 0.0,
3658
+ 0.0
3659
+ ],
3660
+ "max": [
3661
+ 0.0,
3662
+ 0.0,
3663
+ 0.0,
3664
+ 0.0,
3665
+ 0.0,
3666
+ 0.0,
3667
+ 0.0
3668
+ ],
3669
+ "min": [
3670
+ 0.0,
3671
+ 0.0,
3672
+ 0.0,
3673
+ 0.0,
3674
+ 0.0,
3675
+ 0.0,
3676
+ 0.0
3677
+ ],
3678
+ "q01": [
3679
+ 0.0,
3680
+ 0.0,
3681
+ 0.0,
3682
+ 0.0,
3683
+ 0.0,
3684
+ 0.0,
3685
+ 0.0
3686
+ ],
3687
+ "q99": [
3688
+ 0.0,
3689
+ 0.0,
3690
+ 0.0,
3691
+ 0.0,
3692
+ 0.0,
3693
+ 0.0,
3694
+ 0.0
3695
+ ]
3696
+ },
3697
+ "num_transitions": 52644433,
3698
+ "num_trajectories": 104392
3699
+ }
3700
+ }
3701
+ }
special_tokens_map.json ADDED
@@ -0,0 +1,39 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "additional_special_tokens": [
3
+ {
4
+ "content": "<image>",
5
+ "lstrip": false,
6
+ "normalized": false,
7
+ "rstrip": false,
8
+ "single_word": false
9
+ }
10
+ ],
11
+ "bos_token": {
12
+ "content": "<bos>",
13
+ "lstrip": false,
14
+ "normalized": false,
15
+ "rstrip": false,
16
+ "single_word": false
17
+ },
18
+ "eos_token": {
19
+ "content": "<eos>",
20
+ "lstrip": false,
21
+ "normalized": false,
22
+ "rstrip": false,
23
+ "single_word": false
24
+ },
25
+ "pad_token": {
26
+ "content": "<pad>",
27
+ "lstrip": false,
28
+ "normalized": false,
29
+ "rstrip": false,
30
+ "single_word": false
31
+ },
32
+ "unk_token": {
33
+ "content": "<unk>",
34
+ "lstrip": false,
35
+ "normalized": false,
36
+ "rstrip": false,
37
+ "single_word": false
38
+ }
39
+ }
test_huggingface.py ADDED
@@ -0,0 +1,35 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import os
2
+ import argparse
3
+ from pathlib import Path
4
+ import shutil
5
+ import os
6
+ import argparse
7
+ from pathlib import Path
8
+ import shutil
9
+ import torch
10
+ from PIL import Image
11
+ from transformers import AutoModel, AutoProcessor
12
+
13
+ parser = argparse.ArgumentParser("Huggingface AutoModel Tesing")
14
+ parser.add_argument("--model_name_or_path", default="", help="pretrained model name or path.")
15
+ parser.add_argument("--num_images", type=int, default=1, help="num_images for testing.")
16
+
17
+ args = parser.parse_args()
18
+ if __name__ == "__main__":
19
+ model_name_or_path = Path(args.model_name_or_path)
20
+ processor = AutoProcessor.from_pretrained(args.model_name_or_path, trust_remote_code=True)
21
+ print(processor.statistics)
22
+
23
+ model = AutoModel.from_pretrained(args.model_name_or_path, trust_remote_code=True, torch_dtype=torch.bfloat16).eval().cuda()
24
+
25
+ image = Image.open("example.png").convert("RGB")
26
+ images = [image] * args.num_images
27
+ prompt = "What action should the robot take to pick the cpu?"
28
+ inputs = processor(images=images, text=prompt, unnorm_key="bridge_orig/1.0.0", return_tensors="pt")
29
+ print(inputs)
30
+
31
+ generation_outputs = model.predict_action(inputs)
32
+ print(generation_outputs, processor.batch_decode(generation_outputs))
33
+
34
+ actions = processor.decode_actions(generation_outputs, unnorm_key="bridge_orig/1.0.0")
35
+ print(actions)
tokenizer.json ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:2523a63c898ebf0a32c7282a2e459ef2c950a846c5f3172305089e4149b6b6c3
3
+ size 36157680
tokenizer_config.json ADDED
The diff for this file is too large to render. See raw diff