Conversation
| def _make_train_and_valid_dataloader(self): | ||
| """Creates the training and validation data loader.""" | ||
|
|
||
| # Training data | ||
| train_data = torch.rand(self._train_size, self._dim) | ||
| train_labels = torch.zeros(self._train_size, self._dim) | ||
| train_dataset = data.TensorDataset(train_data, train_labels) | ||
| train_loader = self._make_dataloader(train_dataset, shuffle=True) | ||
|
|
||
| # Validation data | ||
| valid_data = torch.rand(self._valid_size, self._dim) | ||
| valid_labels = torch.zeros(self._valid_size, self._dim) | ||
| valid_dataset = data.TensorDataset(valid_data, valid_labels) | ||
| valid_loader = self._make_dataloader(valid_dataset) | ||
|
|
||
| return train_loader, valid_loader | ||
|
|
||
| def _make_test_dataloader(self): | ||
| """Creates the test data loader.""" | ||
|
|
||
| # Test data | ||
| test_data = torch.rand(self._test_size, self._dim) | ||
| test_labels = torch.zeros(self._test_size, self._dim) | ||
| test_dataset = data.TensorDataset(test_data, test_labels) | ||
| test_loader = self._make_dataloader(test_dataset) | ||
|
|
||
| return test_loader |
There was a problem hiding this comment.
Question: Is it necessary to set random seeds here, or does this happen outside these function in DeepOBS?
There was a problem hiding this comment.
I'm not sure if DeepOBS takes care of this. But in this case, since the problem is noise-free (inputs are multiplied by zero in the first layer of the network), it doesn't matter, does it?
| labels = labels.to(device) | ||
|
|
||
| # Compare the model's loss with the manually computed loss | ||
| loss_model = loss_function(net(input), labels) |
There was a problem hiding this comment.
Ideally, one should call nf_quadratic.get_batch_loss_and_accuracy_func()() here for the test to be sensitive to changes in the latter. For that one would need access to input, labels. Not sure how to do that.
There was a problem hiding this comment.
True, but I don't know how to do this either
|
@f-dangel, I tried to incorporate all your comments. Maybe double-check the unresolved conversations before merging this. |
No description provided.