Upload simple MLP demo model with LeRobot model card
Browse files- README.md +42 -51
- config.json +7 -2
- model.safetensors +1 -1
README.md
CHANGED
|
@@ -1,75 +1,66 @@
|
|
| 1 |
---
|
| 2 |
-
|
|
|
|
| 3 |
license: apache-2.0
|
| 4 |
model_name: simple_mlp
|
|
|
|
| 5 |
tags:
|
|
|
|
| 6 |
- pytorch
|
| 7 |
-
- neural-network
|
| 8 |
- mlp
|
| 9 |
-
-
|
|
|
|
|
|
|
|
|
|
| 10 |
---
|
| 11 |
|
| 12 |
-
#
|
| 13 |
|
| 14 |
-
|
| 15 |
|
| 16 |
-
## Model Details
|
| 17 |
|
| 18 |
-
|
| 19 |
-
- **Architecture**: feedforward
|
| 20 |
-
- **Input Size**: 10
|
| 21 |
-
- **Hidden Size**: 64
|
| 22 |
-
- **Output Size**: 1
|
| 23 |
-
- **Activation**: relu
|
| 24 |
|
| 25 |
-
## Model Architecture
|
| 26 |
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
(0): Linear(in_features=10, out_features=64, bias=True)
|
| 30 |
-
(1): ReLU()
|
| 31 |
-
(2): Linear(in_features=64, out_features=64, bias=True)
|
| 32 |
-
(3): ReLU()
|
| 33 |
-
(4): Linear(in_features=64, out_features=1, bias=True)
|
| 34 |
-
)
|
| 35 |
-
```
|
| 36 |
|
| 37 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 38 |
|
| 39 |
-
|
| 40 |
-
import torch
|
| 41 |
-
from huggingface_hub import hf_hub_download
|
| 42 |
-
from safetensors.torch import load_model
|
| 43 |
|
| 44 |
-
|
| 45 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 46 |
|
| 47 |
-
|
| 48 |
-
model = SimpleMLP(
|
| 49 |
-
input_size=10,
|
| 50 |
-
hidden_size=64,
|
| 51 |
-
output_size=1
|
| 52 |
-
)
|
| 53 |
|
| 54 |
-
#
|
| 55 |
-
load_model(model, model_path)
|
| 56 |
-
model.eval()
|
| 57 |
|
| 58 |
-
|
| 59 |
-
|
| 60 |
-
|
|
|
|
|
|
|
|
|
|
| 61 |
```
|
| 62 |
|
| 63 |
-
|
| 64 |
|
| 65 |
-
|
| 66 |
-
- Training samples: 100
|
| 67 |
-
- Epochs: 50
|
| 68 |
-
- Optimizer: Adam
|
| 69 |
-
- Learning rate: 0.001
|
| 70 |
-
- Loss function: MSE Loss
|
| 71 |
|
| 72 |
-
##
|
| 73 |
|
| 74 |
-
-
|
| 75 |
-
- `config.json`: Model configuration
|
|
|
|
| 1 |
---
|
| 2 |
+
datasets: demo/synthetic_data
|
| 3 |
+
library_name: lerobot
|
| 4 |
license: apache-2.0
|
| 5 |
model_name: simple_mlp
|
| 6 |
+
pipeline_tag: robotics
|
| 7 |
tags:
|
| 8 |
+
- demo
|
| 9 |
- pytorch
|
|
|
|
| 10 |
- mlp
|
| 11 |
+
- robotics
|
| 12 |
+
- neural-network
|
| 13 |
+
- lerobot
|
| 14 |
+
- simple_mlp
|
| 15 |
---
|
| 16 |
|
| 17 |
+
# Model Card for simple_mlp
|
| 18 |
|
| 19 |
+
<!-- Provide a quick summary of what the model is/does. -->
|
| 20 |
|
|
|
|
| 21 |
|
| 22 |
+
_Model type not recognized — please update this template._
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 23 |
|
|
|
|
| 24 |
|
| 25 |
+
This policy has been trained and pushed to the Hub using [LeRobot](https://github.com/huggingface/lerobot).
|
| 26 |
+
See the full documentation at [LeRobot Docs](https://huggingface.co/docs/lerobot/index).
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 27 |
|
| 28 |
+
---
|
| 29 |
+
|
| 30 |
+
## How to Get Started with the Model
|
| 31 |
+
|
| 32 |
+
For a complete walkthrough, see the [training guide](https://huggingface.co/docs/lerobot/il_robots#train-a-policy).
|
| 33 |
+
Below is the short version on how to train and run inference/eval:
|
| 34 |
|
| 35 |
+
### Train from scratch
|
|
|
|
|
|
|
|
|
|
| 36 |
|
| 37 |
+
```bash
|
| 38 |
+
lerobot-train \
|
| 39 |
+
--dataset.repo_id=${HF_USER}/<dataset> \
|
| 40 |
+
--policy.type=act \
|
| 41 |
+
--output_dir=outputs/train/<desired_policy_repo_id> \
|
| 42 |
+
--job_name=lerobot_training \
|
| 43 |
+
--policy.device=cuda \
|
| 44 |
+
--policy.repo_id=${HF_USER}/<desired_policy_repo_id>
|
| 45 |
+
--wandb.enable=true
|
| 46 |
+
```
|
| 47 |
|
| 48 |
+
_Writes checkpoints to `outputs/train/<desired_policy_repo_id>/checkpoints/`._
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 49 |
|
| 50 |
+
### Evaluate the policy/run inference
|
|
|
|
|
|
|
| 51 |
|
| 52 |
+
```bash
|
| 53 |
+
lerobot-record \
|
| 54 |
+
--robot.type=so100_follower \
|
| 55 |
+
--dataset.repo_id=<hf_user>/eval_<dataset> \
|
| 56 |
+
--policy.path=<hf_user>/<desired_policy_repo_id> \
|
| 57 |
+
--episodes=10
|
| 58 |
```
|
| 59 |
|
| 60 |
+
Prefix the dataset repo with **eval\_** and supply `--policy.path` pointing to a local or hub checkpoint.
|
| 61 |
|
| 62 |
+
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 63 |
|
| 64 |
+
## Model Details
|
| 65 |
|
| 66 |
+
- **License:** apache-2.0
|
|
|
config.json
CHANGED
|
@@ -1,8 +1,13 @@
|
|
| 1 |
{
|
| 2 |
"model_type": "simple_mlp",
|
|
|
|
| 3 |
"input_size": 10,
|
| 4 |
"hidden_size": 64,
|
| 5 |
"output_size": 1,
|
| 6 |
-
"
|
| 7 |
-
"
|
|
|
|
|
|
|
|
|
|
|
|
|
| 8 |
}
|
|
|
|
| 1 |
{
|
| 2 |
"model_type": "simple_mlp",
|
| 3 |
+
"architecture": "mlp",
|
| 4 |
"input_size": 10,
|
| 5 |
"hidden_size": 64,
|
| 6 |
"output_size": 1,
|
| 7 |
+
"activation": "relu",
|
| 8 |
+
"epochs": 50,
|
| 9 |
+
"learning_rate": 0.001,
|
| 10 |
+
"optimizer": "adam",
|
| 11 |
+
"loss_function": "mse",
|
| 12 |
+
"dataset_size": 100
|
| 13 |
}
|
model.safetensors
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
size 20172
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:7ac5536f7d0a519640464c7e2df15c86138b12b12859d132616f5918625678d2
|
| 3 |
size 20172
|