| | --- |
| | library_name: transformers |
| | tags: [] |
| | --- |
| | # Model Card for Model ID |
| |
|
| | <!-- Provide a quick summary of what the model is/does. --> |
| |
|
| |
|
| |
|
| | ## Model Details |
| |
|
| | ### Model Description |
| |
|
| | ActionCodec model trained on 5 embodiments: |
| | - franka_libero_20hz_1s |
| | - widowx_bridge_5hz_2s |
| | - franka_droid_15hz_1s |
| | - so100_community_30hz_1s |
| | - franka_vlabench_20hz_1s |
| | |
| | ### Model Sources [optional] |
| | |
| | <!-- Provide the basic links for the model. --> |
| | |
| | TODO |
| | |
| | ## Uses |
| | |
| | <!-- Address questions around how the model is intended to be used, including the foreseeable users of the model and those affected by the model. --> |
| | |
| | ### Direct Use |
| | |
| | <!-- This section is for the model use without fine-tuning or plugging into a larger ecosystem/app. --> |
| | |
| | ```python |
| | import numpy as np |
| | from transformers import AutoModel |
| | np.set_printoptions(suppress=True) |
| | if __name__ == "__main__": |
| | tokenizer = AutoModel.from_pretrained("ZibinDong/ActionCodec-5e-RVQft", trust_remote_code=True) |
| | q99 = np.array([0.9375, 0.91071427, 0.9375, 0.20357142, 0.26357144, 0.375, 1.0]) |
| | q01 = np.array([-0.87857145, -0.87589288, -0.9375, -0.15107143, -0.20678571, -0.27964285, 0.0]) |
| | # an example action from physical-intelligence/libero |
| | action = np.array( |
| | [ |
| | [0.3268, 0.2089, -0.3295, 0.0000, -0.0868, -0.0611, 1.0000], |
| | [0.3696, 0.1955, -0.2866, 0.0000, -0.0793, -0.0643, 1.0000], |
| | [0.3857, 0.1929, -0.2759, 0.0000, -0.0782, -0.0654, 1.0000], |
| | [0.3964, 0.2089, -0.2786, 0.0000, -0.0761, -0.0654, 1.0000], |
| | [0.3321, 0.1741, -0.3268, 0.0000, -0.0793, -0.0686, 1.0000], |
| | [0.2250, 0.0964, -0.4232, 0.0000, -0.0932, -0.0761, 1.0000], |
| | [0.0723, 0.0000, -0.5625, 0.0000, -0.1339, -0.0879, 1.0000], |
| | [0.0536, 0.0000, -0.5652, 0.0000, -0.1521, -0.0921, 1.0000], |
| | [0.0750, 0.0000, -0.5464, 0.0000, -0.1511, -0.0964, 1.0000], |
| | [0.0723, 0.0000, -0.5411, 0.0000, -0.1414, -0.0986, 1.0000], |
| | [0.0402, 0.0000, -0.5196, 0.0000, -0.1350, -0.1007, 1.0000], |
| | [0.0080, 0.0000, -0.4795, 0.0000, -0.1189, -0.1018, 1.0000], |
| | [0.0000, 0.0000, -0.4527, 0.0000, -0.0986, -0.1018, 1.0000], |
| | [0.0000, 0.0000, -0.4313, 0.0000, -0.0846, -0.1018, 1.0000], |
| | [-0.0455, -0.0268, -0.3509, 0.0000, -0.0568, -0.1018, 1.0000], |
| | [-0.0964, -0.0482, -0.3321, 0.0000, -0.0439, -0.1039, 1.0000], |
| | [-0.1768, -0.0562, -0.3402, 0.0000, -0.0300, -0.1050, 1.0000], |
| | [-0.2438, -0.0429, -0.3187, 0.0000, -0.0193, -0.0996, 1.0000], |
| | [-0.3054, -0.0054, -0.2893, 0.0000, -0.0139, -0.0932, 1.0000], |
| | [-0.3509, 0.0000, -0.2598, 0.0000, -0.0054, -0.0879, 1.0000], |
| | ], |
| | )[None] |
| | # normalization |
| | normalized_action = np.copy(action) |
| | normalized_action[..., :-1] = normalized_action[..., :-1] / np.maximum(np.abs(q99), np.abs(q01))[..., :-1] |
| | normalized_action[..., -1] = normalized_action[..., -1] * 2.0 - 1.0 # scale to [-1, 1] |
| | normalized_action = normalized_action.clip(-1.0, 1.0) |
| | # tokenization |
| | tokens = tokenizer.encode(normalized_action) # numpy (b, n, d) -> list of ints |
| | print(tokens) |
| | # decoding |
| | decoded_action, padding_mask = tokenizer.decode(tokens) # list of ints -> numpy (b, n, d) |
| | # calculate reconstruction error |
| | mse_error = np.mean((normalized_action - decoded_action) ** 2) |
| | l1_error = np.mean(np.abs(normalized_action - decoded_action)) |
| | print(f"Reconstruction MSE error: {mse_error:.6f}") |
| | print(f"Reconstruction L1 error: {l1_error:.6f}") |
| | ``` |
| | |
| | ### Downstream Use [optional] |
| |
|
| | <!-- This section is for the model use when fine-tuned for a task, or when plugged into a larger ecosystem/app --> |
| |
|
| | TODO |
| |
|
| | ### Out-of-Scope Use |
| |
|
| | <!-- This section addresses misuse, malicious use, and uses that the model will not work well for. --> |
| |
|
| | TODO |
| |
|
| | ## Bias, Risks, and Limitations |
| |
|
| | <!-- This section is meant to convey both technical and sociotechnical limitations. --> |
| |
|
| | TODO |
| |
|
| | ### Recommendations |
| |
|
| | <!-- This section is meant to convey recommendations with respect to the bias, risk, and technical limitations. --> |
| |
|
| | TODO |
| |
|
| | ## How to Get Started with the Model |
| |
|
| | Use the code below to get started with the model. |
| |
|
| | TODO |
| |
|
| | ## Training Details |
| |
|
| | ### Training Data |
| |
|
| | <!-- 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. --> |
| |
|
| | [More Information Needed] |
| |
|
| | ### Training Procedure |
| |
|
| | <!-- This relates heavily to the Technical Specifications. Content here should link to that section when it is relevant to the training procedure. --> |
| |
|
| | #### Preprocessing [optional] |
| |
|
| | [More Information Needed] |
| |
|
| |
|
| | #### Training Hyperparameters |
| |
|
| | - **Training regime:** [More Information Needed] <!--fp32, fp16 mixed precision, bf16 mixed precision, bf16 non-mixed precision, fp16 non-mixed precision, fp8 mixed precision --> |
| |
|
| | #### Speeds, Sizes, Times [optional] |
| |
|
| | <!-- This section provides information about throughput, start/end time, checkpoint size if relevant, etc. --> |
| |
|
| | [More Information Needed] |
| |
|
| | ## Evaluation |
| |
|
| | <!-- This section describes the evaluation protocols and provides the results. --> |
| |
|
| | ### Testing Data, Factors & Metrics |
| |
|
| | #### Testing Data |
| |
|
| | <!-- This should link to a Dataset Card if possible. --> |
| |
|
| | [More Information Needed] |
| |
|
| | #### Factors |
| |
|
| | <!-- These are the things the evaluation is disaggregating by, e.g., subpopulations or domains. --> |
| |
|
| | [More Information Needed] |
| |
|
| | #### Metrics |
| |
|
| | <!-- These are the evaluation metrics being used, ideally with a description of why. --> |
| |
|
| | [More Information Needed] |
| |
|
| | ### Results |
| |
|
| | [More Information Needed] |
| |
|
| | #### Summary |
| |
|
| |
|
| |
|
| | ## Model Examination [optional] |
| |
|
| | <!-- Relevant interpretability work for the model goes here --> |
| |
|
| | [More Information Needed] |
| |
|
| | ## Environmental Impact |
| |
|
| | <!-- Total emissions (in grams of CO2eq) and additional considerations, such as electricity usage, go here. Edit the suggested text below accordingly --> |
| |
|
| | 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). |
| |
|
| | - **Hardware Type:** [More Information Needed] |
| | - **Hours used:** [More Information Needed] |
| | - **Cloud Provider:** [More Information Needed] |
| | - **Compute Region:** [More Information Needed] |
| | - **Carbon Emitted:** [More Information Needed] |
| |
|
| | ## Technical Specifications [optional] |
| |
|
| | ### Model Architecture and Objective |
| |
|
| | [More Information Needed] |
| |
|
| | ### Compute Infrastructure |
| |
|
| | [More Information Needed] |
| |
|
| | #### Hardware |
| |
|
| | [More Information Needed] |
| |
|
| | #### Software |
| |
|
| | [More Information Needed] |
| |
|
| | ## Citation [optional] |
| |
|
| | <!-- If there is a paper or blog post introducing the model, the APA and Bibtex information for that should go in this section. --> |
| |
|
| | **BibTeX:** |
| |
|
| | [More Information Needed] |
| |
|
| | **APA:** |
| |
|
| | [More Information Needed] |
| |
|
| | ## Glossary [optional] |
| |
|
| | <!-- If relevant, include terms and calculations in this section that can help readers understand the model or model card. --> |
| |
|
| | [More Information Needed] |
| |
|
| | ## More Information [optional] |
| |
|
| | [More Information Needed] |
| |
|
| | ## Model Card Authors [optional] |
| |
|
| | [More Information Needed] |
| |
|
| | ## Model Card Contact |
| |
|
| | [More Information Needed] |