Generative AI on Enterprise Cloud with NiFi and Milvus
C4_W2.pdf
1. Copyright Notice
These slides are distributed under the Creative Commons License.
DeepLearning.AI makes these slides available for educational purposes. You may not use or distribute
these slides for commercial purposes. You may make copies of these slides and use or distribute them for
educational purposes as long as you cite DeepLearning.AI as the source of the slides.
For the rest of the details of the license, see https://creativecommons.org/licenses/by-sa/2.0/legalcode
5. Andrew Ng
LeNet - 5
⋮ ⋮
"
#
32×32 ×1 28×28×6 14×14×6 10×10×16 5×5×16
120 84
5 × 5
s = 1
f = 2
s = 2
avg pool
5 × 5
s = 1
avg pool
f = 2
s = 2
[LeCun et al., 1998. Gradient-based learning applied to document recognition]
6. Andrew Ng
AlexNet
= ⋮ ⋮
227×227 ×3
55×55 ×96 27×27 ×96 27×27 ×256 13×13 ×256
13×13 ×384 13×13 ×384 13×13 ×256 6×6 ×256 9216 4096
⋮
4096
11 × 11
s = 4
3 × 3
s = 2
MAX-POOL
5 × 5
same
3 × 3
s = 2
MAX-POOL
3 × 3
same
3 × 3 3 × 3 3 × 3
s = 2
MAX-POOL
Softmax
1000
[Krizhevsky et al., 2012. ImageNet classification with deep convolutional neural networks]
7. Andrew Ng
VGG - 16
224×224 ×3
CONV = 3×3 filter, s = 1, same MAX-POOL = 2×2 , s = 2
[CONV 64]
×2
224×224×64
POOL
112×112 ×64
[CONV 128]
×2
112×112 ×128
POOL
56×56 ×128
[CONV 256]
×3
56×56 ×256
POOL
28×28 ×256
[CONV 512]
×3
28×28 ×512
POOL
14×14×512
[CONV 512]
×3
14×14 ×512
POOL
7×7×512 FC
4096
FC
4096
Softmax
1000
[Simonyan & Zisserman 2015. Very deep convolutional networks for large-scale image recognition]
9. Andrew Ng
Residual block
![#] ![#%&]
'[#%(] = *[#%(] ![#] + ,[#%(] ![#%(] = -('[#%(]) '[#%&] = *[#%&]![#%(] + ,[#%&] ![#%&] = -('[#%&])
![#%(]
[He et al., 2015. Deep residual networks for image recognition]
10. Andrew Ng
Residual Network
x ![#]
# layers
training
error
Plain
# layers
training
error
ResNet
[He et al., 2015. Deep residual networks for image recognition]
26. Andrew Ng
Motivation for MobileNets
• Low computational cost at deployment
• Useful for mobile and embedded vision
applications
• Key idea: Normal vs. depthwise-
separable convolutions
[Howard et al. 2017, MobileNets: Efficient Convolutional Neural Networks for Mobile Vision Applications]
32. Andrew Ng
Depthwise Separable Convolution
* =
Normal Convolution
* =
*
Depthwise Separable Convolution
Depthwise Pointwise
33. Andrew Ng
Cost Summary
[Howard et al. 2017, MobileNets: Efficient Convolutional Neural Networks for Mobile Vision Applications]
Cost of depthwise separable convolution
Cost of normal convolution
36. MobileNet
Andrew Ng
[Sandler et al. 2019, MobileNetV2: Inverted Residuals and Linear Bottlenecks]
MobileNet v1
MobileNet v2
Depthwise Projection
Expansion
Residual Connection
37. Andrew Ng
MobileNet v2 Bottleneck
[Sandler et al. 2019, MobileNetV2: Inverted Residuals and Linear Bottlenecks]
Residual Connection
Expansion Depthwise Pointwise
38. MobileNet
Andrew Ng
[Sandler et al. 2019, MobileNetV2: Inverted Residuals and Linear Bottlenecks]
MobileNet v1
MobileNet v2
Depthwise Projection
Expansion
Residual Connection
39. Andrew Ng
MobileNet v2 Full Architecture
[Sandler et al. 2019, MobileNetV2: Inverted Residuals and Linear Bottlenecks]
conv2d
conv2d
1 x 1
avgpool
7 x 7
conv2d
1 x 1
50. Andrew Ng
Tips for doing well on benchmarks/winning
competitions
Ensembling
• Train several networks independently and average their outputs
Multi-crop at test time
• Run classifier on multiple versions of test images and average results
51. Andrew Ng
Use open source code
• Use architectures of networks published in the literature
• Use pretrained models and fine-tune on your dataset
• Use open source implementations if possible