Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Please write the code for part one in python. No pusedo code please. Objectives: python. No pusedo code please. To implement a reinforcement based on
Please write the code for part one in
python. No pusedo code please.
Objectives:
python. No pusedo code please.
To implement a reinforcement based on taskbased rewards
To take a continuous environment and discretize it so that it is suitable for a
reinforcement learning task
This is the CartPole task. The idea here is to balance this pole using a onedimensional robot it
can only move left and right The robot's state has components:
: the location of the robot is the center, is the leftmost part of the board, is
the rightmost part of the board
OpenAI Gym:
You do not have to implement the problem domain yourself, there is a resource called openAl
gym which has a set of common training examples. Gym can be installed with the following
command:After running the provided command, you may also be asked to install some additional
packages for the video encoding. You'll see an error message with instructions to follow.
State Discretization:
We will discretize the space in order to simplify the reinforcement learning algorithm. One
example can be as follows:
x: one bucket for one for random
Choose random action
Else:
Choose action that gives max value
Your Task :
Now that you've implemented learning for one task, you will move the mountain car task.
Instead actions right this task has three null, right The task also has different
state variables
: the location the robot the left, approximately the valley, the
rightmost part the board, the location the flag
xdot: the velocity the robot can from
This will require you change the number bins for state descritization well the
alpha and gamma values. Additionally, you need implement the exploration
exploitation part for this problem well.
Once your model trained will saved the table 'car. file. Make sure that you
don't change this file name. one for one for
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started