# Import libraries import seaborn as sns import numpy as np import matplotlib.pyplot as plt % matplotlib inline #Create x linspace x = np . linspace ( 1 , 50 , 990 ) #Create dummy functions to represent performance trad_alg = np . log ( x ) small_nn = np . log ( x * np . linspace ( 1 , 3 , 990 )) medium_nn = np . log ( x * np . linspace ( 1 , 6 , 990 )) large_nn = np . log ( x * np . linspace ( 1 , 10 , 990 )) * np . linspace ( 1 , 1.3 , 990 ) #Plot dummy functions fig = plt . figure ( figsize = ( 10 , 6 )) g = sns . regplot ( x , trad_alg , fit_reg = False , label = 'Traditional Algorithms' ) sns . regplot ( x , small_nn , fit_reg = False , label = 'Small NN' ) sns . regplot ( x , medium_nn , fit_reg = False , label = 'Medium NN' ) sns . regplot ( x , large_nn , fit_reg = False , label = 'Large NN' ) #Set labels and remove numbers for axes plt . xlabel ( 'Amount of labeled data (m)' ) plt . ylabel ( 'Performance' ) plt . legend () g . set ( yticks = []) g . set ( xticks = []); #Add annotation g . text ( 0 , - 2 , "|- - With small amounts of data - -|

NN complexity does not

greatly corresepond to

improved performance" , fontsize = 12 ) #Create title plt . title ( 'Large Neural Nets with Large Training Sets have the Best Performance' );