Downloads · 30 days
8
17% of all-time downloads
loayahmed123/world-models-spaceinvaders2
world-models-spaceinvaders2 is a reinforcement learning model from loayahmed123. Use it for the reinforcement learning task on the model card, and read the license before you ship it in a product. It is set up for pytorch.
This is a World Models agent trained on the SpaceInvadersNoFrameskip-v4 environment.
Downloads · 30 days
8
17% of all-time downloads
All-time downloads
46
Public
Repo size
8.9 MB
Likes
0
Public
Click a slice to open those files.
.pt8.7 MB · 97%
From the Hugging Face model README
This is a World Models agent trained on the SpaceInvadersNoFrameskip-v4 environment.
World Models is a model-based reinforcement learning approach that learns a compressed representation of the environment and trains a controller to maximize reward in the learned model.
The architecture consists of three components:
import torch
import gymnasium as gym
# Load models
vae = VAE(latent_dim=32)
vae.load_state_dict(torch.load('vae_model.pt'))
rnn = MDNRNN(latent_dim=32, action_dim=6)
rnn.load_state_dict(torch.load('mdnrnn_model.pt'))
controller = Controller(latent_dim=32, hidden_dim=256)
controller.load_state_dict(torch.load('controller_model.pt'))
# Run agent
env = gym.make('SpaceInvadersNoFrameskip-v4')
# ... (see repository for full inference code)
@article{ha2018worldmodels,
title={World Models},
author={Ha, David and Schmidhuber, J{\"u}rgen},
journal={arXiv preprint arXiv:1803.10122},
year={2018}
}