feat: Add the second exercise (first throw)
All checks were successful
SonarQube Scan / SonarQube Trigger (push) Successful in 24s

This commit is contained in:
Namu
2025-09-28 20:40:47 +02:00
parent 14e79c9cf2
commit e26f2ff15d
2 changed files with 123 additions and 2 deletions

4
tp2.py
View File

@@ -38,8 +38,8 @@ def train_and_save(weights_path="acrobot_dqn.pth", episodes=2000, update_target_
n_states, n_actions = env.observation_space.shape[0], env.action_space.n
# les DQN
policy_net = DQN(n_states, n_actions) #
target_net = DQN(n_states, n_actions)
policy_net = DQN(n_states, n_actions) # Q Network
target_net = DQN(n_states, n_actions) # Target network
target_net.load_state_dict(policy_net.state_dict()) # same weights at start
target_net.eval()