From 035016fb0cc826542aef77864f36df88a5055d06 Mon Sep 17 00:00:00 2001 From: Hamel Husain Date: Sun, 6 Mar 2022 15:48:34 -0800 Subject: [PATCH] remove Normalize as stats are grabbed automatically (#502) * remove Normalize * clean --- 06_multicat.ipynb | 7 +++---- clean/06_multicat.ipynb | 11 +++++------ 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/06_multicat.ipynb b/06_multicat.ipynb index deeb28e..e014d8a 100644 --- a/06_multicat.ipynb +++ b/06_multicat.ipynb @@ -1654,8 +1654,7 @@ " get_items=get_image_files,\n", " get_y=get_ctr,\n", " splitter=FuncSplitter(lambda o: o.parent.name=='13'),\n", - " batch_tfms=[*aug_transforms(size=(240,320)), \n", - " Normalize.from_stats(*imagenet_stats)]\n", + " batch_tfms=aug_transforms(size=(240,320)), \n", ")" ] }, @@ -2169,11 +2168,11 @@ "split_at_heading": true }, "kernelspec": { - "display_name": "Python 3", + "display_name": "Python 3 (ipykernel)", "language": "python", "name": "python3" } }, "nbformat": 4, - "nbformat_minor": 2 + "nbformat_minor": 4 } diff --git a/clean/06_multicat.ipynb b/clean/06_multicat.ipynb index 830e304..581aaa7 100644 --- a/clean/06_multicat.ipynb +++ b/clean/06_multicat.ipynb @@ -326,7 +326,7 @@ "source": [ "def binary_cross_entropy(inputs, targets):\n", " inputs = inputs.sigmoid()\n", - " return -torch.where(targets==1, inputs, 1-inputs).log().mean()" + " return -torch.where(targets==1, 1-inputs, inputs).log().mean()" ] }, { @@ -534,8 +534,7 @@ " get_items=get_image_files,\n", " get_y=get_ctr,\n", " splitter=FuncSplitter(lambda o: o.parent.name=='13'),\n", - " batch_tfms=[*aug_transforms(size=(240,320)), \n", - " Normalize.from_stats(*imagenet_stats)]\n", + " batch_tfms=aug_transforms(size=(240,320)), \n", ")" ] }, @@ -682,7 +681,7 @@ "1. When is it okay to tune a hyperparameter on the validation set?\n", "1. How is `y_range` implemented in fastai? (See if you can implement it yourself and test it without peeking!)\n", "1. What is a regression problem? What loss function should you use for such a problem?\n", - "1. What do you need to do to make sure the fastai library applies the same data augmentation to your inputs images and your target point coordinates?" + "1. What do you need to do to make sure the fastai library applies the same data augmentation to your input images and your target point coordinates?" ] }, { @@ -713,11 +712,11 @@ "split_at_heading": true }, "kernelspec": { - "display_name": "Python 3", + "display_name": "Python 3 (ipykernel)", "language": "python", "name": "python3" } }, "nbformat": 4, - "nbformat_minor": 2 + "nbformat_minor": 4 }