Skip to content
Snippets Groups Projects
Commit 970816e7 authored by Ghelfi Manon's avatar Ghelfi Manon
Browse files

Update README.md

parent fd2cd011
Branches
No related tags found
No related merge requests found
......@@ -33,6 +33,23 @@ Aprés mettre identifié grace à la commande : `huggingface-cli login`
## Weights & Biases
**(TODO: trouver comment mettre des données utiles)**
```
import wandb
import gym
from stable_baselines3 import A2C
wandb.init(project='a2c_CartPole')
env = gym.make('CartPole-v1')
model = A2C("MlpPolicy", env, verbose=1)
model.learn(total_timesteps=500000)
observations = [env.reset() for _ in range(100)]
actions, _states = model.predict(observations)
accuracy = sum([a == env.action_space.label[i] for i, a in enumerate(actions)]) / len(actions)
wandb.log({"model": model, 'accuracy':accuracy})
model.save("a2c_CartPole")
```
## panda-gym
**(TODO: réussir à import et verifier le code puis le telecharger sur Hugging Face Hub)**
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment