




版權說明:本文檔由用戶提供并上傳,收益歸屬內容提供方,若內容存在侵權,請進行舉報或認領
文檔簡介
1、Convnets in TensorFlowCS 20: TensorFlow for Deep Learning ResearchLecture 72/7/201712AgendaConvolutions without trainingConvnet with MNIST!tf.layers3Understanding convolutions4Convolutions in math and physics5a function derived from two given functions by integration that expresses how the shape of
2、one is modified by the otherConvolutions in math and physics6Brian Amberg derivative work (Wikipedia)Convolutions in math and physics7How an input is transformed by a kernel* *also called filter/feature mapConvolutions in machine learning8We can use one single convolutional layer to modify a certain
3、 imageConvolutions in machine learning9 Kernel for blurring100.06250.1250.06250.1250.250.1250.06250.1250.0625Matrix multiplication of this kernel with a 3 x 3 patch of an image is a weighted sum of neighboring pixels= blurring effectConvolution without training110.06250.1250.06250.1250.250.1250.0625
4、0.1250.0625tf.nn.conv2dinputKernel for blurringoutputConvolutions in TensorFlow12We can use one single convolutional layer to modify a certain imagetf.nn.conv2d( input, filter, strides, padding, use_cudnn_on_gpu=True, data_format=NHWC, dilations=1, 1, 1, 1, name=None)Convolutions in TensorFlow13We c
5、an use one single convolutional layer to modify a certain imagetf.nn.conv2d( input,Batch size (N) x Height (H) x Width (W) x Channels (C) filter,Height x Width x Input Channels x Output Channels strides,4 element 1-D tensor, strides in each direction padding,SAME or VALID use_cudnn_on_gpu=True, data
6、_format=NHWC, dilations=1, 1, 1, 1, name=None)Convolutions in TensorFlow14We can use one single convolutional layer to modify a certain imagetf.nn.conv2d( image, kernel, strides=1, 3, 3, 1, padding=SAME,)Some basic kernels15inputsharpenedgetop sobelembossSee kernels.py and 07_run_kernels.pySome basi
7、c kernels16inputsharpenedgetop sobelembossConvolutions in machine learning17Dont hard-code the values of your kernels.Learn the optimal kernels through training!ConvNet with MNIST18Model1928x28x15x5x1x32Conv + relu28x28x32Maxpool (2x2x1)Conv + reluMaxpool (2x2x1)Fully + reluFully + softmaxWeight5x5x
8、32x647*7*64 x 10241024 x 1014x14x3214x14x647 x 7 x 641 x 10241 x 10Strides for all convolutional layers: 1, 1, 1, 1Convolutional layer2028x28x15x5x1x32Conv + relu28x28x32Maxpool (2x2x1)Conv + reluMaxpool (2x2x1)Fully + reluFully + softmaxWeight5x5x32x647*7*64 x 10241024 x 1014x14x3214x14x647 x 7 x 6
9、41 x 10241 x 10conv = tf.nn.conv2d(images,kernel,strides=1, 1, 1, 1,padding=SAME)Convolutional layer: padding21Input width = 13Filter width = 6Stride = 5Convolutional layer: Dimension2228x28x15x5x1x32Conv + relu28x28x32Maxpool (2x2x1)Conv + reluMaxpool (2x2x1)Fully + reluFully + softmaxWeight5x5x32x
10、647*7*64 x 10241024 x 1014x14x3214x14x647 x 7 x 641 x 10241 x 10(WF+2P)/S+ 1W: input width/depthF: filter width/depthP: paddingS: strideConvolutional layer: Dimension23(WF+2P)/S+ 1W: input width/depthF: filter width/depthP: paddingS: strideImage credit: CS231n Lecture 7Convolutional layer: Dimension
11、2428x28x15x5x1x32Conv + relu28x28x32Maxpool (2x2x1)Conv + reluMaxpool (2x2x1)Fully + reluFully + softmaxWeight5x5x32x647*7*64 x 10241024 x 1014x14x3214x14x647 x 7 x 641 x 10241 x 10(WF+2P)/S+ 1(28 - 5 + 2*2)/1 + 1 = 28W: input width/depthF: filter width/depthP: paddingS: strideConvolutional layer: D
12、imension2528x28x15x5x1x32Conv + relu28x28x32Maxpool (2x2x1)Conv + reluMaxpool (2x2x1)Fully + reluFully + softmaxWeight5x5x32x647*7*64 x 10241024 x 1014x14x3214x14x647 x 7 x 641 x 10241 x 10(WF+2P)/S+ 1(28 - 5 + 2*2)/1 + 1 = 28W: input width/depthF: filter width/depthP: paddingS: strideTF computes pa
13、dding for us!Maxpooling2628x28x15x5x1x32Conv + relu28x28x32Maxpool (2x2x1)Conv + reluMaxpool (2x2x1)Fully + reluFully + softmaxWeight5x5x32x647*7*64 x 10241024 x 1014x14x3214x14x647 x 7 x 641 x 10241 x 10pool1 = tf.nn.max_pool(conv1,ksize=1, 2, 2, 1,strides=1, 2, 2, 1,padding=SAME)Maxpooling27Slide
14、credit: CS231n Lecture 71124567832101234Single depth slicexymax pool with 2x2 filters and stride 26834Maxpooling: Dimension2828x28x15x5x1x32Conv + relu28x28x32Maxpool (2x2x1)Conv + reluMaxpool (2x2x1)Fully + reluFully + softmaxWeight5x5x32x647*7*64 x 10241024 x 1014x14x3214x14x647 x 7 x 641 x 10241
15、x 10(WK+2P)/S+ 1W: input width/depthK: window width/depthP: paddingS: strideMaxpooling: Dimension2928x28x15x5x1x32Conv + relu28x28x32Maxpool (2x2x1)Conv + reluMaxpool (2x2x1)Fully + reluFully + softmaxWeight5x5x32x647*7*64 x 10241024 x 1014x14x3214x14x647 x 7 x 641 x 10241 x 10(WK+2P)/S+ 1(28 - 2 +
16、2*0) / 2 + 1 = 14W: input width/depthK: window width/depthP: paddingS: strideFully connected3028x28x15x5x1x32Conv + relu28x28x32Maxpool (2x2x1)Conv + reluMaxpool (2x2x1)Fully + reluFully + softmaxWeight5x5x32x647*7*64 x 10241024 x 1014x14x3214x14x647 x 7 x 641 x 10241 x 10fc = tf.matmul(pool2, w) +
17、bSoftmax3128x28x15x5x1x32Conv + relu28x28x32Maxpool (2x2x1)Conv + reluMaxpool (2x2x1)Fully + reluFully + softmaxWeight5x5x32x647*7*64 x 10241024 x 1014x14x3214x14x647 x 7 x 641 x 10241 x 10Loss functiontf.nn.softmax_cross_entropy_with_logits(labels=Y, logits=logits)Predicttf.nn.softmax(logits_batch)
18、Interactive coding3207_convnet_mnist_starter.py from GitHub!Update utils.py33Training progress34Test accuracy increases while training loss decreases!Accuracy35EpochsAccuracy10.913120.936330.947850.9573100.971250.9818tf.layers36tf.layers37Weve been learning it the hard waytf.layers.conv2d38conv1 = tf.layers.conv2d(inputs=self.img, filters=32, kernel_size=5, 5, padding=SAME, activation=tf.nn.relu, name=con
溫馨提示
- 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯系上傳者。文件的所有權益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網頁內容里面會有圖紙預覽,若沒有圖紙預覽就沒有圖紙。
- 4. 未經權益所有人同意不得將文件中的內容挪作商業或盈利用途。
- 5. 人人文庫網僅提供信息存儲空間,僅對用戶上傳內容的表現方式做保護處理,對用戶上傳分享的文檔內容本身不做任何修改或編輯,并不能對任何下載內容負責。
- 6. 下載文件中如有侵權或不適當內容,請與我們聯系,我們立即糾正。
- 7. 本站不保證下載資源的準確性、安全性和完整性, 同時也不承擔用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。
最新文檔
- 數字貨幣與金融風險管理:2025年金融體系安全防護策略報告
- 2025年工業互聯網平臺光通信技術升級對光通信設備企業的影響報告
- 胸腹聯合傷的急救護理
- 食管癌放療病人的護理
- 普外科腹腔引流管護理
- 2024年新高考英語總復習進階練02 定語從句(名校模擬卷)50題(上海專用原卷版)
- 安全員C證安全員作業模擬考試題庫
- 夏季健康教育課件
- 上海閔行職業技術學院《會計信息系統》2023-2024學年第二學期期末試卷
- 邵陽市重點中學2024-2025學年高二下物理期末檢測模擬試題含解析
- 2025年行政執法證考試必考題庫及答案(共四套)
- 《律師事務所管理辦法》(全文)
- 校長國培計劃培訓成果匯報
- 湖南出版中南傳媒招聘筆試真題2023
- 2025年河北省職業院校高職組“食品安全與質量檢測”技能大賽參考試題庫(含答案)
- 中國血管性認知障礙診治指南(2024版)解讀
- 2024版房屋市政工程生產安全重大事故隱患判定標準內容解讀
- 浙江省臺州市2023-2024學年六年級上學期語文期末試卷(含答案)
- 遵紀守法從我做起主題班會課件
- DB4102-T 002-2024 黃河鯉池塘養殖技術規范
- 45001-2020職業健康安全管理體系危險源識別與風險評價及應對措施表(各部門)
評論
0/150
提交評論