Skip to content

Commit eff523e

Browse files
committed
📚 Fix & shorten tutorials
1 parent 4258111 commit eff523e

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

auto_tutorials_source/tutorial_bayesian.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -84,9 +84,10 @@ def optim_lenet(model: nn.Module) -> dict:
8484
# We mock the arguments for the trainer
8585
with ArgvContext(
8686
"file.py",
87-
"--max_epochs 1",
88-
"--enable_progress_bar=False",
89-
"--verbose=False",
87+
"--max_epochs",
88+
"1",
89+
"--enable_progress_bar",
90+
"False",
9091
):
9192
args = init_args(datamodule=MNISTDataModule)
9293

auto_tutorials_source/tutorial_scaler.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,12 +71,15 @@
7171
#
7272
# When computing the ECE, you need to provide the likelihoods associated with the inputs.
7373
# To do this, just call PyTorch's softmax.
74+
#
75+
# To avoid lengthy computations (without GPU), we restrict the calibration computation to a subset
76+
# of the test set.
7477

7578
from torch.utils.data import DataLoader, random_split
7679

7780
# Split datasets
7881
dataset = dm.test
79-
cal_dataset, test_dataset = random_split(dataset, [1000, len(dataset) - 1000])
82+
cal_dataset, test_dataset, other = random_split(dataset, [1000, 1000, len(dataset) - 2000])
8083
test_dataloader = DataLoader(test_dataset, batch_size=32)
8184

8285
# Initialize the ECE

0 commit comments

Comments
 (0)