Batch size for validation set?

Hi, does anyone know what batch_size for validation set means for following code:

        indices = list(range(len(train_data)))
        np.random.shuffle(indices)
        split = int(np.floor(valid_size * len(train_data)))
        train_idx, valid_idx = indices[split:], indices[:split]
        train_loader = DataLoader(dataset, batch_size=50,
                                  sampler=SubsetRandomSampler(train_idx))
        valid_loader = DataLoader(dataset, batch_size=50,
                                  sampler=SubsetRandomSampler(valid_idx))

Does it mean that only 50 data in the validation set are used for validation or the complete dataset are used but 50 data are evaluated each time?

Thanks!

Hi,

It means that the data will be drawn by batches of 50. As you usually can’t put the whole validation dataset at once in your neural net, you do it in minibatch, similarly as you do for training.