feed-forward neural networks to get more accurate predictions for our given problemwe would need to train the network-- to backpropagate the loss and update the weights with respect to the loss function fortunatelypytorch provides these essential building blocks in an extremely easy to use and intuitive way listing - illustrates defining the lossoptimizerand training loop for the neural network listing - defining the lossoptimizerand training function for the neural network #define function for training network def train_network(model,optimizer,loss_function ,num_epochs,batch_size,x_train,y_train)#explicitly start model training model train(loss_across_epochs [for epoch in range(num_epochs)train_loss 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