def __init__(selfdatasetvalidation_proportion learning_rate= )"""creates neural network for datasetlayers is the list of layers ""self dataset dataset self output_type dataset target ftype self learning_rate learning_rate self input_features dataset input_features self num_outputs len(self input_featuresvalidation_num int(len(self dataset train)*validation_proportionif validation_num random shuffle(self dataset trainself validation_set self dataset train[-validation_num:self training_set self dataset train[:-validation_numelseself validation_set [self training_set self dataset train self layers [self bn number of batches run def add_layer(self,layer)"""add layer to the network each layer gets number of inputs from the previous layers outputs ""self layers append(layerself num_outputs layer num_outputs def predictor(self,ex)"""predicts the value of the first output for example ex ""values [ (exfor in self input_featuresfor layer in self layersvalues layer output_values(valuesreturn sigmoid(values[ ]if self output_type =="booleanelse softmax(valuesself dataset target frangeif self output_type ="categoricalelse values[ def predictor_string(self)return "not implementedthe learn method learns network learnnn py -(continued def learn(selfepochs= batch_size= num_iter nonereport_each= )"""learns parameters for neural network using stochastic gradient decent epochs is the number of times through the data (on averagebatch_size is the maximum size of each batch version june