Skip to content

Instantly share code, notes, and snippets.

@seongjoojin
Created March 20, 2018 05:04
Show Gist options
  • Save seongjoojin/9f9fc3e27cd440a946af9781da100d73 to your computer and use it in GitHub Desktop.
Save seongjoojin/9f9fc3e27cd440a946af9781da100d73 to your computer and use it in GitHub Desktop.
study180324
Display the source blob
Display the rendered blob
Raw
{
"nbformat": 4,
"nbformat_minor": 0,
"metadata": {
"colab": {
"name": "study180324.ipynb",
"version": "0.3.2",
"views": {},
"default_view": {},
"provenance": [],
"collapsed_sections": []
},
"kernelspec": {
"name": "python3",
"display_name": "Python 3"
},
"accelerator": "GPU"
},
"cells": [
{
"metadata": {
"id": "FnAgbH_P057O",
"colab_type": "text"
},
"cell_type": "markdown",
"source": [
"# 0. A Classical CNN Architecture\n",
"\n",
"![대체 텍스트](https://i.imgur.com/AgsFXfA.png)\n",
"\n",
"출처 : 밑바닥부터 시작하는 딥러닝"
]
},
{
"metadata": {
"id": "gcXTMS6ddfqJ",
"colab_type": "text"
},
"cell_type": "markdown",
"source": [
"# 1. 풀링 (pooling)\n",
"\n",
"![대체 텍스트](https://i.imgur.com/x7Ntp4W.png)\n",
"\n",
"\n",
"출처 : 밑바닥부터 시작하는 딥러닝\n",
"\n",
"pooling : 세로·가로 방향의 공간을 줄이는 연산\n",
"\n",
"pooling은 average pooling(평균 풀링)과 max pooling(최대 풀링)이 있습니다.\n",
"\n",
"평균 풀링은 대상영역의 평균을 계산하며 최대 풀링은 대상 영역에서 최댓값을 취합니다.\n",
"\n",
"CNN에서는 max pooling(최대 풀링) 사용."
]
},
{
"metadata": {
"id": "wIaL51RUdi0t",
"colab_type": "text"
},
"cell_type": "markdown",
"source": [
"# 2. 컨볼루션 (convolution)\n",
"\n",
"convolution : 합성곱\n",
"\n",
"기존의 사용하던 가중치(W)와 편향(b)에 해당\n",
"\n",
"![대체 텍스트](https://i.imgur.com/0iqiTZW.png)\n",
"\n",
"출처 : 밑바닥부터 시작하는 딥러닝\n",
"\n",
"계산과정\n",
"\n",
"1X2 + 0X2 + 3X1 + 0X0 + 1X1 + 2X2 + 3X1 + 0X0 + 1X2 = 15\n",
"\n",
"2X2 + 3X0 + 0X1 + 1X0 + 2X1 + 3X2 + 0X1 + 1X0 + 2X2 = 16\n",
"\n",
"0X2 + 1X0 + 2X1 + 3X0 + 0X1 + 1X2 + 2X1 + 3X0 + 0X2 = 6\n",
"\n",
"1X2 + 2X0 + 3X1 + 0X0 + 1X1 + 2X2 + 3X1 + 0X0 + 1X2 = 15\n",
"\n",
"![대체 텍스트](https://i.imgur.com/4KgEe4m.png)\n",
"\n",
"출처 : 밑바닥부터 시작하는 딥러닝\n",
"\n",
"그렇다면 편향은?(b)\n",
"\n",
"![대체 텍스트](https://i.imgur.com/EUE2Sil.png)\n",
"\n",
"출처 : 밑바닥부터 시작하는 딥러닝\n",
"\n",
"계산과정\n",
"\n",
"15 + 3 = 18\n",
"\n",
"16 + 3 = 19\n",
"\n",
"6 + 3 = 9\n",
"\n",
"15 + 3 = 18\n",
"\n",
"![대체 텍스트](http://deeplearning.stanford.edu/wiki/images/6/6c/Convolution_schematic.gif)\n",
"\n",
"출처 : http://deeplearning.stanford.edu/wiki/index.php/Feature_extraction_using_convolution\n",
"\n",
"\n"
]
},
{
"metadata": {
"id": "h2Uz5G_MdzSr",
"colab_type": "text"
},
"cell_type": "markdown",
"source": [
"# 3. 커널 (필터) / kernel (filter)\n",
"\n",
"![대체 텍스트](https://i.imgur.com/4KgEe4m.png)\n",
"\n",
"출처 : 밑바닥부터 시작하는 딥러닝\n",
"\n",
"이미지의 특징을 찾아내기 위한 공용 파라미터\n",
"\n",
"일반적으로 (5,5)이나 (3,3) 등 정사각 행렬로 정의"
]
},
{
"metadata": {
"id": "OelsaGJQd1Fy",
"colab_type": "text"
},
"cell_type": "markdown",
"source": [
"# 4. 스트라이드 (stride)\n",
"\n",
"![대체 텍스트](https://i.imgur.com/CNpTYcC.png)\n",
"\n",
"출처 : 밑바닥부터 시작하는 딥러닝\n",
"\n",
"필터를 적용하는 위치의 간격"
]
},
{
"metadata": {
"id": "h8esPTuItmOZ",
"colab_type": "text"
},
"cell_type": "markdown",
"source": [
"# 5. 패딩 (padding)\n",
"\n",
"![대체 텍스트](https://i.imgur.com/fiGeQH2.png)\n",
"\n",
"출처 : 밑바닥부터 시작하는 딥러닝\n",
"\n",
"합성곱의 과정에서 output크기가 줄어드는데 원본 input 데이터에 대한 손실을 방지하기 위한 방법"
]
},
{
"metadata": {
"id": "Wwh5mzXYd3xj",
"colab_type": "text"
},
"cell_type": "markdown",
"source": [
"# 6. VGG\n",
"\n",
"![대체 텍스트](https://i.imgur.com/XW4Dxdf.png)\n",
"\n",
"출처 : 밑바닥부터 시작하는 딥러닝\n",
"\n",
"구성은 기본적인 CNN이며 비중있는 층(합성곱 계층, 완전연결계층)을 모두 16층(혹은 19층)으로 심화한게 특징\n",
"\n",
"층의 깊이에 따라서 'VGG16'과 'VGG19'로 구분됨\n",
"\n",
"3X3의 작은 필터를 사용한 합성곱 계층을 연속으로 거칩니다.\n",
"\n",
"VGG는 구성이 간단하고 응용하기 쉬워서 많은 기술자들이 즐겨 사용함. (2014년 대회 2등) -> 많은 라이브러리에서 지원하기 때문이라는 이유도 있음"
]
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment