def cost_fig(cost_data, plot_height, plot_width, epoch_axis=True):
 fig = figure(plot_height=plot_height, plot_width=plot_width, title='Cost', x_axis_label=x_label(epoch_axis), y_axis_label='Cross Entropy Error (%)')
 num_colors_required = len(cost_data)
 assert (num_colors_required <= 11), 'Insufficient colors in predefined palette.'
 colors = list(brewer['Spectral'][max(3, len(cost_data))])
 if (num_colors_required < 3):
  colors[0] = brewer['Spectral'][6][0]
  if (num_colors_required == 2):
   colors[1] = brewer['Spectral'][6][(-1)]
 for (name, x, y) in cost_data:
  fig.line(x, y, legend=name, color=colors.pop(0), line_width=2)
 return fig

def cost_fig ( cost_data , plot_height , plot_width , epoch_axis = True ) : fig = figure ( plot_height = plot_height , plot_width = plot_width , title = 'Cost' , x_axis_label = x_label ( epoch_axis ) , y_axis_label = 'Cross Entropy Error (%)' ) num_colors_required = len ( cost_data ) assert ( num_colors_required <= 11 ) , 'Insufficient colors in predefined palette.' colors = list ( brewer [ 'Spectral' ] [ max ( 3 , len ( cost_data ) ) ] ) if ( num_colors_required < 3 ) : colors [ 0 ] = brewer [ 'Spectral' ] [ 6 ] [ 0 ] if ( num_colors_required == 2 ) : colors [ 1 ] = brewer [ 'Spectral' ] [ 6 ] [ ( - 1 ) ] for ( name , x , y ) in cost_data : fig . line ( x , y , legend = name , color = colors . pop ( 0 ) , line_width = 2 ) return fig
generate a figure with lines for each element in cost_data .