January 2019
Intermediate to advanced
342 pages
9h 17m
English
The environment for the self-driving car is CarRacing-v0 from the OpenAI Gym. The states presented to the agent from this OpenAI environment are images from the front of the simulated car in CarRacing-v0. The environment also returns a reward based on the action taken by the agent at a given state. We penalize the reward if the car treads on grass and also normalize the reward to be in the range of (-1,1) for stable training. The detailed code for the environment is as below
import gymfrom gym import envsimport numpy as npfrom helper_functions import rgb2gray,action_list,sel_action,sel_action_indexfrom keras import backend as K seed_gym = 3action_repeat_num = 8patience_count = 200epsilon_greedy = ...
Read now
Unlock full access