Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added activation functions to MLP models. #45

Merged
merged 9 commits into from
May 31, 2024
5 changes: 3 additions & 2 deletions exercises/01_penguin_classification.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -143,10 +143,11 @@
"outputs": [],
"source": [
"from torchvision.transforms import Compose\n",
"\n",
"# import some useful functions here, see https://pytorch.org/docs/stable/torch.html\n",
"# where `tensor` and `eye` are used for constructing tensors,\n",
"# and using a lower-precision float32 is advised for performance\n",
"from torch import tensor, eye, float32 \n",
"from torch import tensor, eye, float32\n",
"\n",
"# Apply the transforms we need to the PenguinDataset to get out input\n",
"# targets as Tensors."
Expand Down Expand Up @@ -396,7 +397,7 @@
"\n",
"# Print the raw output from the net\n",
"\n",
"# Transform the raw output back to human-readable format\n"
"# Transform the raw output back to human-readable format"
]
}
],
Expand Down
3 changes: 2 additions & 1 deletion exercises/03_mnist_classification.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@
"from torchvision.transforms import ToTensor, Compose\n",
"from torch import Tensor, tensor\n",
"\n",
"\n",
"def get_img_tfms(training: bool) -> Compose:\n",
" \"\"\"Return a composition of image transforms.\n",
"\n",
Expand Down Expand Up @@ -141,7 +142,7 @@
" The target as a one-hot-encoded vector.\n",
"\n",
" \"\"\"\n",
" return #???\n",
" return # ???\n",
"\n",
"\n",
"train_set = MNIST(\n",
Expand Down
1 change: 1 addition & 0 deletions src/ml_workshop/_ellipse.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Ellipse-drawing dataset."""

from typing import Tuple, Optional, Any

from numpy.random import default_rng
Expand Down
108 changes: 51 additions & 57 deletions worked-solutions/01_penguin_classification_solutions.ipynb

Large diffs are not rendered by default.

130 changes: 60 additions & 70 deletions worked-solutions/02_penguin_regression_solutions.ipynb

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion worked-solutions/03_mnist_classification_solutions.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -829,7 +829,7 @@
" Notes\n",
" -----\n",
" - This function assumes the ``preds`` have had the softmax applied to them\n",
" along dimension 1, and that the predicted class is therefore \n",
" along dimension 1, and that the predicted class is therefore\n",
" ``preds.argmax(dim=1)``.\n",
"\n",
" \"\"\"\n",
Expand Down
Loading