ZibinDong commited on
Commit
65b1621
·
verified ·
1 Parent(s): 984862d

Upload folder using huggingface_hub

Browse files
Files changed (1) hide show
  1. README.md +237 -0
README.md CHANGED
@@ -0,0 +1,237 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ library_name: transformers
3
+ tags: []
4
+ ---
5
+ # Model Card for Model ID
6
+
7
+ <!-- Provide a quick summary of what the model is/does. -->
8
+
9
+
10
+
11
+ ## Model Details
12
+
13
+ ### Model Description
14
+
15
+ ActionCodec model trained on 3 embodiments:
16
+ - franka_libero_20hz_1s
17
+ - widowx_bridge_5hz_3s
18
+ - franka_droid_15hz_1s
19
+
20
+ ### Model Sources [optional]
21
+
22
+ <!-- Provide the basic links for the model. -->
23
+
24
+ TODO
25
+
26
+ ## Uses
27
+
28
+ <!-- Address questions around how the model is intended to be used, including the foreseeable users of the model and those affected by the model. -->
29
+
30
+ ### Direct Use
31
+
32
+ <!-- This section is for the model use without fine-tuning or plugging into a larger ecosystem/app. -->
33
+
34
+ ```python
35
+ import numpy as np
36
+ from transformers import AutoModel
37
+ np.set_printoptions(suppress=True)
38
+ if __name__ == "__main__":
39
+ tokenizer = AutoModel.from_pretrained("ZibinDong/ActionCodec-Base", trust_remote_code=True)
40
+ q99 = np.array([0.9375, 0.91071427, 0.9375, 0.20357142, 0.26357144, 0.375, 1.0])
41
+ q01 = np.array([-0.87857145, -0.87589288, -0.9375, -0.15107143, -0.20678571, -0.27964285, 0.0])
42
+ # an example action from physical-intelligence/libero
43
+ action = np.array(
44
+ [
45
+ [0.3268, 0.2089, -0.3295, 0.0000, -0.0868, -0.0611, 1.0000],
46
+ [0.3696, 0.1955, -0.2866, 0.0000, -0.0793, -0.0643, 1.0000],
47
+ [0.3857, 0.1929, -0.2759, 0.0000, -0.0782, -0.0654, 1.0000],
48
+ [0.3964, 0.2089, -0.2786, 0.0000, -0.0761, -0.0654, 1.0000],
49
+ [0.3321, 0.1741, -0.3268, 0.0000, -0.0793, -0.0686, 1.0000],
50
+ [0.2250, 0.0964, -0.4232, 0.0000, -0.0932, -0.0761, 1.0000],
51
+ [0.0723, 0.0000, -0.5625, 0.0000, -0.1339, -0.0879, 1.0000],
52
+ [0.0536, 0.0000, -0.5652, 0.0000, -0.1521, -0.0921, 1.0000],
53
+ [0.0750, 0.0000, -0.5464, 0.0000, -0.1511, -0.0964, 1.0000],
54
+ [0.0723, 0.0000, -0.5411, 0.0000, -0.1414, -0.0986, 1.0000],
55
+ [0.0402, 0.0000, -0.5196, 0.0000, -0.1350, -0.1007, 1.0000],
56
+ [0.0080, 0.0000, -0.4795, 0.0000, -0.1189, -0.1018, 1.0000],
57
+ [0.0000, 0.0000, -0.4527, 0.0000, -0.0986, -0.1018, 1.0000],
58
+ [0.0000, 0.0000, -0.4313, 0.0000, -0.0846, -0.1018, 1.0000],
59
+ [-0.0455, -0.0268, -0.3509, 0.0000, -0.0568, -0.1018, 1.0000],
60
+ [-0.0964, -0.0482, -0.3321, 0.0000, -0.0439, -0.1039, 1.0000],
61
+ [-0.1768, -0.0562, -0.3402, 0.0000, -0.0300, -0.1050, 1.0000],
62
+ [-0.2438, -0.0429, -0.3187, 0.0000, -0.0193, -0.0996, 1.0000],
63
+ [-0.3054, -0.0054, -0.2893, 0.0000, -0.0139, -0.0932, 1.0000],
64
+ [-0.3509, 0.0000, -0.2598, 0.0000, -0.0054, -0.0879, 1.0000],
65
+ ],
66
+ )[None]
67
+ # normalization
68
+ normalized_action = np.copy(action)
69
+ normalized_action[..., :-1] = normalized_action[..., :-1] / np.maximum(np.abs(q99), np.abs(q01))[..., :-1]
70
+ normalized_action[..., -1] = normalized_action[..., -1] * 2.0 - 1.0 # scale to [-1, 1]
71
+ normalized_action = normalized_action.clip(-1.0, 1.0)
72
+ # tokenization
73
+ tokens = tokenizer.encode(normalized_action) # numpy (b, n, d) -> list of ints
74
+ print(tokens)
75
+ # decoding
76
+ decoded_action, padding_mask = tokenizer.decode(tokens) # list of ints -> numpy (b, n, d)
77
+ # calculate reconstruction error
78
+ mse_error = np.mean((normalized_action - decoded_action) ** 2)
79
+ l1_error = np.mean(np.abs(normalized_action - decoded_action))
80
+ print(f"Reconstruction MSE error: {mse_error:.6f}")
81
+ print(f"Reconstruction L1 error: {l1_error:.6f}")
82
+ ```
83
+
84
+ ### Downstream Use [optional]
85
+
86
+ <!-- This section is for the model use when fine-tuned for a task, or when plugged into a larger ecosystem/app -->
87
+
88
+ TODO
89
+
90
+ ### Out-of-Scope Use
91
+
92
+ <!-- This section addresses misuse, malicious use, and uses that the model will not work well for. -->
93
+
94
+ TODO
95
+
96
+ ## Bias, Risks, and Limitations
97
+
98
+ <!-- This section is meant to convey both technical and sociotechnical limitations. -->
99
+
100
+ TODO
101
+
102
+ ### Recommendations
103
+
104
+ <!-- This section is meant to convey recommendations with respect to the bias, risk, and technical limitations. -->
105
+
106
+ TODO
107
+
108
+ ## How to Get Started with the Model
109
+
110
+ Use the code below to get started with the model.
111
+
112
+ TODO
113
+
114
+ ## Training Details
115
+
116
+ ### Training Data
117
+
118
+ <!-- This should link to a Dataset Card, perhaps with a short stub of information on what the training data is all about as well as documentation related to data pre-processing or additional filtering. -->
119
+
120
+ [More Information Needed]
121
+
122
+ ### Training Procedure
123
+
124
+ <!-- This relates heavily to the Technical Specifications. Content here should link to that section when it is relevant to the training procedure. -->
125
+
126
+ #### Preprocessing [optional]
127
+
128
+ [More Information Needed]
129
+
130
+
131
+ #### Training Hyperparameters
132
+
133
+ - **Training regime:** [More Information Needed] <!--fp32, fp16 mixed precision, bf16 mixed precision, bf16 non-mixed precision, fp16 non-mixed precision, fp8 mixed precision -->
134
+
135
+ #### Speeds, Sizes, Times [optional]
136
+
137
+ <!-- This section provides information about throughput, start/end time, checkpoint size if relevant, etc. -->
138
+
139
+ [More Information Needed]
140
+
141
+ ## Evaluation
142
+
143
+ <!-- This section describes the evaluation protocols and provides the results. -->
144
+
145
+ ### Testing Data, Factors & Metrics
146
+
147
+ #### Testing Data
148
+
149
+ <!-- This should link to a Dataset Card if possible. -->
150
+
151
+ [More Information Needed]
152
+
153
+ #### Factors
154
+
155
+ <!-- These are the things the evaluation is disaggregating by, e.g., subpopulations or domains. -->
156
+
157
+ [More Information Needed]
158
+
159
+ #### Metrics
160
+
161
+ <!-- These are the evaluation metrics being used, ideally with a description of why. -->
162
+
163
+ [More Information Needed]
164
+
165
+ ### Results
166
+
167
+ [More Information Needed]
168
+
169
+ #### Summary
170
+
171
+
172
+
173
+ ## Model Examination [optional]
174
+
175
+ <!-- Relevant interpretability work for the model goes here -->
176
+
177
+ [More Information Needed]
178
+
179
+ ## Environmental Impact
180
+
181
+ <!-- Total emissions (in grams of CO2eq) and additional considerations, such as electricity usage, go here. Edit the suggested text below accordingly -->
182
+
183
+ Carbon emissions can be estimated using the [Machine Learning Impact calculator](https://mlco2.github.io/impact#compute) presented in [Lacoste et al. (2019)](https://arxiv.org/abs/1910.09700).
184
+
185
+ - **Hardware Type:** [More Information Needed]
186
+ - **Hours used:** [More Information Needed]
187
+ - **Cloud Provider:** [More Information Needed]
188
+ - **Compute Region:** [More Information Needed]
189
+ - **Carbon Emitted:** [More Information Needed]
190
+
191
+ ## Technical Specifications [optional]
192
+
193
+ ### Model Architecture and Objective
194
+
195
+ [More Information Needed]
196
+
197
+ ### Compute Infrastructure
198
+
199
+ [More Information Needed]
200
+
201
+ #### Hardware
202
+
203
+ [More Information Needed]
204
+
205
+ #### Software
206
+
207
+ [More Information Needed]
208
+
209
+ ## Citation [optional]
210
+
211
+ <!-- If there is a paper or blog post introducing the model, the APA and Bibtex information for that should go in this section. -->
212
+
213
+ **BibTeX:**
214
+
215
+ [More Information Needed]
216
+
217
+ **APA:**
218
+
219
+ [More Information Needed]
220
+
221
+ ## Glossary [optional]
222
+
223
+ <!-- If relevant, include terms and calculations in this section that can help readers understand the model or model card. -->
224
+
225
+ [More Information Needed]
226
+
227
+ ## More Information [optional]
228
+
229
+ [More Information Needed]
230
+
231
+ ## Model Card Authors [optional]
232
+
233
+ [More Information Needed]
234
+
235
+ ## Model Card Contact
236
+
237
+ [More Information Needed]