Editing
Reinforcement Learning
(section)
Jump to navigation
Jump to search
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
== <span style="color: #FFFFFF;">Applying</span> == '''Setting up a basic RL training loop with Gymnasium and Stable-Baselines3:''' <syntaxhighlight lang="python"> import gymnasium as gym from stable_baselines3 import PPO # Create environment env = gym.make("CartPole-v1") # Instantiate agent with PPO algorithm model = PPO( "MlpPolicy", env, learning_rate=3e-4, n_steps=2048, batch_size=64, n_epochs=10, gamma=0.99, verbose=1 ) # Train for 100,000 steps model.learn(total_timesteps=100_000) # Evaluate obs, _ = env.reset() for _ in range(1000): action, _ = model.predict(obs, deterministic=True) obs, reward, done, truncated, _ = env.step(action) if done or truncated: obs, _ = env.reset() </syntaxhighlight> ; Common RL algorithm selection guide : '''Discrete actions + simple environments''' β DQN, Double DQN : '''Continuous control (robotics, locomotion)''' β SAC (Soft Actor-Critic), TD3 : '''General purpose, on-policy''' β PPO, A3C : '''RLHF for LLMs''' β PPO with KL divergence penalty from reference model : '''Game environments''' β AlphaZero-style MCTS + RL for perfect-information games </div> <div style="background-color: #8B4500; color: #FFFFFF; padding: 20px; border-radius: 8px; margin-bottom: 15px;">
Summary:
Please note that all contributions to BloomWiki may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
BloomWiki:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Navigation menu
Personal tools
Not logged in
Talk
Contributions
Create account
Log in
Namespaces
Page
Discussion
English
Views
Read
Edit
View history
More
Search
Navigation
Main page
Recent changes
Random page
Help about MediaWiki
Tools
What links here
Related changes
Special pages
Page information