Python Forum
General Coding help:Reinforcement learning - Printable Version

+- Python Forum (https://python-forum.io)
+-- Forum: Python Coding (https://python-forum.io/forum-7.html)
+--- Forum: Data Science (https://python-forum.io/forum-44.html)
+--- Thread: General Coding help:Reinforcement learning (/thread-13400.html)



General Coding help:Reinforcement learning - kala - Oct-13-2018

To implement Q-learning to solve the Taxi problem with optimal policy.The taxi problem source code is in https://github.com/openai/gym/blob/master/gym/envs/toy_text/taxi.py

import gym import random import numpy import time
env = gym.make("Taxi-v2")
next_state = -1000*numpy.ones((501,6)) next_reward = -1000*numpy.ones((501,6))

#Training

Am new to Python, and I want to code this training part, Could someone help me with the code and its explanation so that my learning would be logical.


Thank you


RE: General Coding help:Reinforcement learning - ichabod801 - Oct-13-2018

Typically each square and each move is assigned a point value. If you make a move to a square with a good value, you increase the point value for the move and the square the move is from. You make tons of tries at the problem, keeping track of all the point values, and moving randomly, weighted by the point values. The more tries you make, the more your point values converge to the best path.