join ( IMAGES_PATH, fig_id + "." + fig_extension ) print ( "Saving figure", fig_id ) if tight_layout : plt. makedirs ( IMAGES_PATH, exist_ok = True ) def save_fig ( fig_id, tight_layout = True, fig_extension = "png", resolution = 300 ): path = os. Three-dimensional displays first appeared on computer screens in the 1960s, and very large machines could manipulate those images in real time, but it was not until 1980 that a video-game player could maneuver at will through an imaginary landscape, wreak. join ( PROJECT_ROOT_DIR, "images", CHAPTER_ID ) os. rc ( 'animation', html = 'jshtml' ) # Where to save the figures PROJECT_ROOT_DIR = "." CHAPTER_ID = "rl" IMAGES_PATH = os. rc ( 'ytick', labelsize = 12 ) # To get smooth animations import matplotlib.animation as animation mpl.
Import matplotlib as mpl import matplotlib.pyplot as plt mpl. set_seed ( 42 ) # To plot pretty figures % matplotlib inline CNNs can be very slow without a GPU." ) if IS_COLAB : print ( "Go to Runtime > Change runtime and select a GPU hardware accelerator." ) # Common imports import numpy as np import os # to make this notebook's output stable across runs np. Features a full orchestra, swelling from woodwind and strings to include brass and percussion sections, and a piano. is_gpu_available (): print ( "No GPU was detected. !pip install -q -U tf-agents-nightly pyvirtualdisplay gym IS_COLAB = True except Exception : IS_COLAB = False # TensorFlow ≥2.0 is required import tensorflow as tf from tensorflow import keras assert tf. !apt update & apt install -y libpq-dev libsdl2-dev swig xorg-dev xvfb _version_ >= "0.20" try : # %tensorflow_version only exists in Colab. version_info >= ( 3, 5 ) # Scikit-Learn ≥0.20 is required import sklearn assert sklearn. #collapse-show # Python ≥3.5 is required import sys assert sys.