34. DeepLearningにおけるConvolution
Convolutional Neural Network
– 画像認識に使用されるニューラルネットワーク
– 推論時はConvolution層が全体の処理時間の50%以上を占める
• 最近のネットワークではConvolution層の多段化により
さらに処理時間が増加
Convolution層の高速化はとても重要!
33
Convolution層
LeNetのネットワーク図
Y. LeCun, L. Bottou, Y. Bengio, and P. Haffner. Gradient-based learning
applied to document recognition. Proceedings of the IEEE, november 1998.
35. 2次元Convolutionのアルゴリズム記述
C++での実装例
34
void conv3x3(const uint8_t* src, const float* kernel, uint8_t* dst,
int height, int width) {
for (int y=0; y<height; y++) {
for (int x=0; x<width; x++) {
float tmp = .0f;
for (int ky=0; ky<kh; ky++) {
for (int kx=0; kx<kw; kx++) {
tmp += src[y+ky-kh/2][x+kx-kw/2] * kernel[ky][kx];
}
}
dst[y][x] = tmp;
}
}
}