add RL training which doesnt work that wall yet, and start to make UI for model training

This commit is contained in:
csd4ni3l
2025-11-15 15:56:56 +01:00
parent 032f38f4ce
commit 32477def6a
9 changed files with 524 additions and 17 deletions

20
train.py Normal file
View File

@@ -0,0 +1,20 @@
from stable_baselines3 import PPO
from utils.ml import SpaceInvadersEnv
env = SpaceInvadersEnv()
model = PPO(
"MlpPolicy",
env,
n_steps=2048,
batch_size=64,
n_epochs=10,
learning_rate=3e-4,
verbose=1,
device="cpu",
gamma=0.99,
ent_coef=0.02,
clip_range=0.2,
gae_lambda=0.95
)
model.learn(1_000_000)
model.save("invader_agent")