
Explore reinforcement learning with pytorch through self-play and self-training breakthroughs like alpha go zero. See practical cases, popular algorithms, and open gym tools to experiment freely.
Learn reinforcement learning with concepts of agent, environment, observations, actions, and rewards, including delayed feedback, and compare with supervised and unsupervised learning.
Prepare your environment for reinforcement learning with PyTorch by detailing Linux installation steps and Depue drivers installation, and note that installation processes change over time.
Here to clarify the doubts and to have clear understanding about terms:
So technically until done flag is set to True.
For example we do our training for 500 episodes... so we play game 500 times...
Practice with the frozen lake version zero environment in OpenAI Gym, where the agent navigates a four-square grid with holes toward a goal, observes random actions, and begins learning.
Learn how to record and visualize your reinforcement learning agent's behavior in OpenAI Gym environments, including headless server video setup and essential installation steps.
Explore the Bellman equation by breaking down the q value function, policy, and gamma-discounted rewards, and learn how to evaluate state-action pairs to find the optimal value.
In a deterministic environment, define a 16x4 Q-table, initialize with zeros, and update it with the Bowman equation using gamma to select the best actions.
Use thought Max to extract the maximum value and its index from muxing values, guiding the best move for each state in a deterministic environment.
Implement a reinforcement learning lab in PyTorch for deterministic environments, building q-values, random action selection, state updates, and performance reporting with rewards visualization across multiple runs.
Visualize reinforcement learning results for deterministic environments with matplotlib bar graphs, configuring x and y axes and colors, and report episodes success rates and average steps.
Apply a stochastic environment reinforcement learning lab by adapting the Q-learning update with a learning rate alpha and discount gamma, balancing current observations and past experience to improve policy.
Implement epsilon-greedy action selection in a PyTorch reinforcement learning lab, balancing 10% random exploration with 90% optimized moves, and analyze learning improvements and gamma effects.
Implement adaptive e-greedy by starting with a high exploration rate around 0.7 and decaying toward 0.1, with a greedy decay of 0.999. This approach reduces random moves over time.
Explore tuning reinforcement learning parameters in a PyTorch homework setting, comparing gamma, alpha, and exploration rate to observe effects on learning from current observations, experience, and deterministic environments.
Here it's worth mentioning that when we set random seed for our environment - in configuration provided in this video
env.action_space.sample()
will still get fully random (not repeatable) results.
This is due to that fact that for sample moves for some reasons Gym uses different approach to get randomness. More details here:
https://github.com/openai/gym/blob/339415aa03a9b039a51f67798a44f8cd21464091/gym/spaces/box.py#L28-L29
So if you also need to "fix" randomness of sample moves - you have to use:
from gym.spaces.prng import seed
seed(seed_value)
Learn to run reinforcement learning experiments with the CartPole environment, seed randomness for reproducibility, and compare simple algorithms on a standard laptop, observing an average of about 22 steps.
The video revisits epsilon decay in reinforcement learning with PyTorch, showing how to visualize and compare two epsilon calculation methods and adjust decay parameters.
Learn to migrate to PyTorch 0.4.0, implement device-agnostic code, and adapt to updated data specifications and deprecated features, with practical script updates and remote plotting considerations.
Implement a neural network for an OpenAI Gym environment, define inputs from observation space and actions, and build an agent with select_action and optimize to learn via the Bohman equation.
Explore how deep reinforcement learning, via deep q-networks, solves complex Atari games and surpasses hand-crafted features, fueled by advances in deep learning and computer vision.
Tune reinforcement learning parameters to observe their impact on results, adjusting the learning rate and other settings. Set clear goals to prioritize speed or stable performance.
Implement an experience replay memory for reinforcement learning in PyTorch by building a memory class with push, sample, and __len__ methods, handling capacity and overwriting old entries.
Learn to implement experience replay in PyTorch, align predicted and target values with tensor squeeze, and evaluate performance in a CartPole environment, achieving stable improvements.
Implement a PyTorch DQN lab with a target network and a 500-step update cadence. Load target parameters from the main network and tune gamma and clipping for stability.
Implement a double DQN using a learning network to pick actions and a target network to evaluate their values, with double dip Q and stabilized target frequency.
Explore the dueling network architecture for deep Q-learning, separating state value and state-dependent action advantages into two streams. See how combining them improves efficiency and stability on Atari tasks.
Investigate stability-focused dueling DQN experiments, compare two model variants, tune parameters and update frequency, and extend the network with deeper value and advantage streams to achieve stable 200-point performance.
File atari_wrappers.py (from OpenAI github page) has to be downloaded to the same location as all other files. It has to be in same directory - because then we will be able to import it directly in our code.
Develop a convolutional network in pytorch for a Pong agent, detailing conv layers, flattening, and outputs for advantage and value in reinforcement learning.
Preprocess and stack 42 Pong frames from experience replay into 84×84 tensors, convert to float, and verify max action scores from the neural network to drive decisions.
Here I also recommend giving a try with update_target_frequency = 2000. I noticed that sometimes it give even better results (game is resolved faster)!
Experiment with potential improvements in reinforcement learning by stacking four frames with Atari wrappers, adjusting CNN input channels, tuning hyperparameters, and exploring rainbow and experience replay methods.
Dive into reinforcement learning with PyTorch, and practice building a learning agent from scratch, tuning results, and adapting code as framework updates roll out.
UPDATE:
All the code and installation instructions have been updated and verified to work with Pytorch 1.6 !!
Artificial Intelligence is dynamically edging its way into our lives. It is already broadly available and we use it - sometimes even not knowing it - on daily basis. Soon it will be our permanent, every day companion.
And where can we place Reinforcement Learning in AI world? Definitely this is one of the most promising and fastest growing technologies that can eventually lead us to General Artificial Intelligence! We can see multiple examples where AI can achieve amazing results - from reaching super human level while playing games to solving real life problems (robotics, healthcare, etc).
Without a doubt it's worth to know and understand it!
And that's why this course has been created.
We will go through multiple topics, focusing on most important and practical details. We will start from very basic information, gradually building our understanding, and finally reaching the point where we will make our agent learn in human-like way - only from video input!
What's important - of course we need to cover some theory - but we will mainly focus on practical part. Goal is to understand WHY and HOW.
In order to evaluate our algorithms we will use environments from - very popular - OpenAI Gym. We will start from basic text games, through more complex ones, up to challenging Atari games
What will be covered during the course ?
- Introduction to Reinforcement Learning
- Markov Decision Process
- Deterministic and stochastic environments
- Bellman Equation
- Q Learning
- Exploration vs Exploitation
- Scaling up
- Neural Networks as function approximators
- Deep Reinforcement Learning
- DQN
- Improvements to DQN
- Learning from video input
- Reproducing some of most popular RL solutions
- Tuning parameters and general recommendations
See you in the class!