January 2019
Intermediate to advanced
342 pages
9h 17m
English
The main.py script puts together the logic of the environment, DQN, and agent appropriately, enabling the car to learn driving through reinforcement learning. Detailed code is as follows:
import sys#sys.path.append('/home/santanu/ML_DS_Catalog-/Python-Artificial-Intelligence-Projects_backup/Python-Artificial-Intelligence-Projects/Chapter09/Scripts/')from gym import envsfrom Agents import Agent,RandomAgentfrom helper_functions import action_list,model_savefrom environment import environmentimport argparseimport numpy as npimport randomfrom sum_tree import sum_treefrom sklearn.externals import joblib'''This is the main module for training and testing the CarRacing Application from gym'''if __name__ == "__main__": #Define ...Read now
Unlock full access