I have a general question on dgl model evaluation using cross validation (CV).
I noticed that the model performance were different when I define model inside or outside the CV loop.
My question is whether I should define my model inside/outside CV loop?
Here is a pseudo-example of how I used k_folds.
model = GCNClassifier(settings) #should I define it outside? for train_idx, test_idx in k_folds(n_splits = num_folds): dataset_train = Dataset[train_idx] dataset_test = Dataset[test_idx] train_loader = DataLoader(dataset = dataset_train) test_loader = DataLoader(dataset = dataset_test) model = GCNClassifier(settings) # or should I define it inside? for epoch in range(1, n+1): train(model, optimizer, epoch, train_loader) test(model, test_loader)