Contents
  1. What Do train, test, and eval Mean in Deep Learning
  2. Why Use dataloader

What Do train, test, and eval Mean in Deep Learning

  1. Train: Model training refers to using training data to adjust a model so that it can learn valuable patterns from the data. During training, the model receives input data, computes its predictions, and compares them with the ground truth to evaluate its accuracy. Then, based on its error, the model’s parameters are updated through an optimization algorithm to improve its accuracy. This process is repeated until the error on the training data reaches an acceptable threshold.

  2. Test: Testing refers to evaluating a model’s accuracy using an independent dataset. The model has not seen this data during training, so it is used to evaluate the model’s ability to generalize. The test data is used as input to generate predictions, which are compared with the ground truth to evaluate the model’s accuracy.

  3. Eval: Evaluation is similar to testing, but it may differ. Evaluation may be more fine-grained and can cover more evaluation metrics, such as precision, recall, F1 score, and so on. The evaluation process is used to assess the model’s performance.

Why Use dataloader

The reference code is as follows:

dataloader = torch.utils.data.DataLoader(dataset, batch_size=1, shuffle=True, num_workers=opt.workers)

Use dataloader to create a data loader (the dataset object, the amount of data read each time, whether to shuffle the data randomly, and the number of threads used when reading data).

It can divide the data into small batches, making model training easier while reducing memory usage and enabling multithreaded parallel processing.