Gentle explanation and implementation of SARSA and Q-learning in the context of CartPole game. Intro to Reinforcement Learning: Temporal Difference Learning, SARSA Vs. Q-learning
Reinforcement learning (RL) is surely a rising field, with the huge influence from the performance of AlphaZero (the best chess engine as of now). RL is a subfield of machine learning that teaches agents to perform in an environment to maximize rewards overtime.
Among RL’s model-free methods is temporal difference (TD) learning, with SARSA and Q-learning (QL) being two of the most used algorithms. I chose to explore SARSA and QL to highlight a subtle difference between on-policy learning and off-learning, which we will discuss later in the post.
This post assumes you have basic knowledge of the agent, environment, action, and rewards within RL's scope. A brief introduction can be found here.
The outline of this post include:
We will compare these two algorithms via the CartPole game implementation. This post's code can be found here :QL code ,SARSA code , and the fully functioning code . (the fully-functioning code has both algorithms implemented and trained on cart pole game)
The TD learning will be a bit mathematical, but feel free to skim through and jump directly to QL and SARSA.
What is the difference between machine learning and artificial intelligence and deep learning? Supervised learning is best for classification and regressions Machine Learning models. You can read more about them in this article.
Artificial Intelligence (AI) will and is currently taking over an important role in our lives — not necessarily through intelligent robots.
Enroll now at best Artificial Intelligence training in Noida, - the best Institute in India for Artificial Intelligence Online Training Course and Certification.
Enroll now at CETPA, the best Institute in India for Artificial Intelligence Online Training Course and Certification for students & working professionals & avail 50% instant discount.
Watch this video on Artificial Intelligence vs Machine Learning vs Deep Learning in Hindi! Artificial Intelligence, Machine Learning and Deep Learning are some of the most popular and sought-after domains today. We understand Artificial Intelligence as a computer being programmed with the ability to learn from experience, adjust to new commands and to perform human-like tasks, and Machine Learning as a subset of AI. Deep Learning is also an AI function which pretty much imitates the functioning of the human brain to process data for recognizing speech, translation of languages, detection of objects and making decisions.