Python知識(shí)分享網(wǎng) - 專業(yè)的Python學(xué)習(xí)網(wǎng)站 學(xué)Python,上Python222
卷積神經(jīng)網(wǎng)絡(luò)圖像識(shí)別python代碼 PDF 下載
匿名網(wǎng)友發(fā)布于:2025-12-22 09:56:30
(侵權(quán)舉報(bào))
(假如點(diǎn)擊沒反應(yīng),多刷新兩次就OK!)

卷積神經(jīng)網(wǎng)絡(luò)圖像識(shí)別python代碼 PDF 下載 圖1

 

 

資料內(nèi)容:

 

用卷積神經(jīng)網(wǎng)絡(luò)做圖像識(shí)別
 

這個(gè)ipython notebook會(huì)搭建一個(gè)2層的卷積神經(jīng)網(wǎng)絡(luò),然后在CIFAR-10是上測驗(yàn)效果。
我們在文件nn/classifiers/convnet.py中實(shí)現(xiàn)了two_layer_convnet函數(shù),可以對(duì)2層的卷積神經(jīng)
網(wǎng)絡(luò)計(jì)算損失和梯度。需要稍微注意一下的是,這里用的是nn/layer_utils.py文件中定義
的"sandwich"層(即把卷積層,激勵(lì)層,全連接層合在一個(gè)層里了)。
In [1l:

 

#準(zhǔn)備工作
import numpy as np
import matplotlib.pyplot as,plt
from nn.classifier_trainer import ClassifierTrainer
from nn.gradient_check import eval_numerical_gradient
from nn.classifiers.convnet import *
matplotlib inline
plt.rcParams['figure.figsize'] = (l0.0, 8.0) # set default size of plots
plt.rcParams['image.interpolation'] ='nearest'
plt.rcParams['image.cmap'] ='gray'
# for auto-reloading external modules
#_see http://stackoverflow.com/questions/19o7993/autoreload-of-modules-in-ipython
&load_ext autoreload
sautoreload 2
def rel_error(x, y):
*.*returns relative error"""
return np.max (np.abs (x - y) / (np.maximum (le-18, np.abs (x) + np.abs (y))))