mirror of
https://github.com/fastai/fastbook.git
synced 2025-04-08 03:40:42 +00:00
remove Normalize as stats are grabbed automatically (#502)
* remove Normalize * clean
This commit is contained in:
parent
a251aae293
commit
035016fb0c
@ -1654,8 +1654,7 @@
|
|||||||
" get_items=get_image_files,\n",
|
" get_items=get_image_files,\n",
|
||||||
" get_y=get_ctr,\n",
|
" get_y=get_ctr,\n",
|
||||||
" splitter=FuncSplitter(lambda o: o.parent.name=='13'),\n",
|
" splitter=FuncSplitter(lambda o: o.parent.name=='13'),\n",
|
||||||
" batch_tfms=[*aug_transforms(size=(240,320)), \n",
|
" batch_tfms=aug_transforms(size=(240,320)), \n",
|
||||||
" Normalize.from_stats(*imagenet_stats)]\n",
|
|
||||||
")"
|
")"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
@ -2169,11 +2168,11 @@
|
|||||||
"split_at_heading": true
|
"split_at_heading": true
|
||||||
},
|
},
|
||||||
"kernelspec": {
|
"kernelspec": {
|
||||||
"display_name": "Python 3",
|
"display_name": "Python 3 (ipykernel)",
|
||||||
"language": "python",
|
"language": "python",
|
||||||
"name": "python3"
|
"name": "python3"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"nbformat": 4,
|
"nbformat": 4,
|
||||||
"nbformat_minor": 2
|
"nbformat_minor": 4
|
||||||
}
|
}
|
||||||
|
@ -326,7 +326,7 @@
|
|||||||
"source": [
|
"source": [
|
||||||
"def binary_cross_entropy(inputs, targets):\n",
|
"def binary_cross_entropy(inputs, targets):\n",
|
||||||
" inputs = inputs.sigmoid()\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_items=get_image_files,\n",
|
||||||
" get_y=get_ctr,\n",
|
" get_y=get_ctr,\n",
|
||||||
" splitter=FuncSplitter(lambda o: o.parent.name=='13'),\n",
|
" splitter=FuncSplitter(lambda o: o.parent.name=='13'),\n",
|
||||||
" batch_tfms=[*aug_transforms(size=(240,320)), \n",
|
" batch_tfms=aug_transforms(size=(240,320)), \n",
|
||||||
" Normalize.from_stats(*imagenet_stats)]\n",
|
|
||||||
")"
|
")"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
@ -682,7 +681,7 @@
|
|||||||
"1. When is it okay to tune a hyperparameter on the validation set?\n",
|
"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. 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 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
|
"split_at_heading": true
|
||||||
},
|
},
|
||||||
"kernelspec": {
|
"kernelspec": {
|
||||||
"display_name": "Python 3",
|
"display_name": "Python 3 (ipykernel)",
|
||||||
"language": "python",
|
"language": "python",
|
||||||
"name": "python3"
|
"name": "python3"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"nbformat": 4,
|
"nbformat": 4,
|
||||||
"nbformat_minor": 2
|
"nbformat_minor": 4
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user