training deep leaning models x_train,x_testy_train,y_test train_test_split(new_ df[predictors],new_df[target],test_size #convert pandas dataframefirst to numpy and then to torch tensors x_train tch from_numpy(x_train valuesx_test tch from_numpy(x_test valuesy_train tch from_numpy(y_train valuesreshape(- , y_test tch from_numpy(y_test valuesreshape(- , #print the dataset size to verify print("x_train shape:",x_train shapeprint("x_test shape:",x_test shapeprint("y_train shape:",y_train shapeprint("y_test shape:",y_test shapeout[]x_train shapetorch size([ ]x_test shapetorch size([ ]y_train shapetorch size([ ]y_test shapetorch size([ ]we now have the dataset ready for our deep learning experiments before designing our networklet' put in place few essential building blocks that can be reused for our experiments listing - demonstrates the boilerplate code for training model in pytorch note in the exercises in the bookwe will always divide the dataset into training and validation (as opposed to dividing it into trainingvalidationand testingas discussed previously in real-life production experimentswe recommend readers have separate test dataset that can fulfill the required checks before going live in production systems