training deep leaning models listing - defining the function to evaluate the model performance #define function for evaluating nn def evaluate_model(model,x_test,y_test,x_train,y_train,loss_list)model eval(#explicitly set to evaluate mode #predict on train and validation datasets y_test_prob model(x_testy_test_pred =np where(y_test_prob> , , y_train_prob model(x_trainy_train_pred =np where(y_train_prob> , , #compute training and validation metrics print("\ model performance -"print("training accuracy-",round(accuracy_score(y_trainy_train_pred), )print("training precision-",round(precision_score (y_train,y_train_pred), )print("training recall-",round(recall_score(y_trainy_train_pred), )print("training rocauc"round(roc_auc_score(y_train ,y_train_prob detach(numpy()), )print("validation accuracy-",round(accuracy_score(y_testy_test_pred), )print("validation precision-",round(precision_score(y_testy_test_pred), )print("validation recall-",round(recall_score(y_testy_test_pred), )print("validation rocauc"round(roc_auc_score(y_test ,y_test_prob detach(numpy()), )print("\ "