training deep leaning models listing - defining the function to train the model #define function to train the network def train_network(model,optimizer,loss_function,num_epochsbatch_size,x_train,y_train,lambda_l = )loss_across_epochs [for epoch in range(num_epochs)train_loss #explicitly start model training model train(for in range( ,x_train shape[ ],batch_size)#extract train batch from and input_data x_train[ :min(x_train shape[ ], +batch_size)labels y_train[ :min(x_train shape[ ], +batch_ size)#set the gradients to zero before starting to do backpropragation optimizer zero_grad(#forward pass output_data model(input_data#caculate loss loss loss_function(output_datalabelsl _loss