June 2018
Intermediate to advanced
318 pages
9h 24m
English
Now let's learn how to train a robot to walk using Gym along with some fundamentals.
The strategy is that X points will be given as a reward when the robot moves forward, and if the robot fails to move then Y points will be reduced. So the robot will learn to walk in the event of maximizing the reward.
First, we will import the library, then we will create a simulation instance by the make function. Open AI Gym provides an environment called BipedalWalker-v2 for training robotic agents in a simple terrain:
import gymenv = gym.make('BipedalWalker-v2')
Then, for each episode (agent-environment interaction between the initial and final state), we will initialize the environment using the reset method:
for episode Read now
Unlock full access