Run this model with HF Jobs
Run ShaswatRobotics/world_model_test on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.
Paste one of these prompts into your coding agent:
Fine-tune on my dataset
Use HF Jobs to fine-tune https://huggingface.co/ShaswatRobotics/world_model_test. Ask me which dataset to train on, then push the fine-tuned model to a new model repo. Run `hf jobs --help` first to learn the CLI.
Run batch inference
Use HF Jobs to run batch inference with https://huggingface.co/ShaswatRobotics/world_model_test on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.
Instructions to use ShaswatRobotics/world_model_test with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- TF-Keras
How to use ShaswatRobotics/world_model_test with TF-Keras:
# Note: 'keras<3.x' or 'tf_keras' must be installed (legacy), and from_pretrained_keras was removed in huggingface_hub 1.0. # See https://github.com/keras-team/tf-keras for more details. # !pip install "huggingface_hub<1.0" tf_keras from huggingface_hub import from_pretrained_keras model = from_pretrained_keras("ShaswatRobotics/world_model_test") - Notebooks
- Google Colab
- Kaggle
Upload random_torch.py
Browse files123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778"""PyTorch WM models covering ALL CallModes"""
import osimport torchimport torch.nn as nn
OBS_DIM = 105ACTION_DIM = 8LATENT_DIM = 32HIDDEN_DIM = 256
OUT_DIR = "weights_torch_signatures"os.makedirs(OUT_DIR, exist_ok=True)
# ---------------- Encoder ----------------class Encoder(nn.Module): def __init__(self): super().__init__() self.net = nn.Sequential( nn.Linear(OBS_DIM, HIDDEN_DIM), nn.ReLU(), nn.Linear(HIDDEN_DIM, LATENT_DIM), )
def forward(self, obs): return self.net(obs)
# ---------------- Positional / Kwargs ----------------class TransitionPositional(nn.Module): def __init__(self): super().__init__() self.net = nn.Sequential( nn.Linear(LATENT_DIM + ACTION_DIM, HIDDEN_DIM), nn.ReLU(), nn.Linear(HIDDEN_DIM, LATENT_DIM), )
def forward(self, z, a): return self.net(torch.cat([z, a], dim=-1))
# ---------------- Tuple ----------------class TransitionTuple(nn.Module): def __init__(self): super().__init__() self.net = nn.Sequential( nn.Linear(LATENT_DIM + ACTION_DIM, HIDDEN_DIM), nn.ReLU(), nn.Linear(HIDDEN_DIM, LATENT_DIM), )
def forward(self, inputs): z, a = inputs return self.net(torch.cat([z, a], dim=-1))
# ---------------- Concat ----------------class TransitionConcat(nn.Module): def __init__(self): super().__init__() self.net = nn.Sequential( nn.Linear(LATENT_DIM + ACTION_DIM, HIDDEN_DIM), nn.ReLU(), nn.Linear(HIDDEN_DIM, LATENT_DIM), )
def forward(self, za): return self.net(za)
def save(model, name): torch.save(model.state_dict(), f"{OUT_DIR}/{name}.pth")
save(Encoder(), "encoder")save(TransitionPositional(), "transition_positional")save(TransitionTuple(), "transition_tuple")save(TransitionConcat(), "transition_concat")
print("✅ PyTorch models saved")ant/pwm/random_torch.pyAdded+78