http://wayneoutthere.com/how-to-korean-keyboard-ubuntu/



This tutorial might also work on Ubuntu 14.04, I haven’t tried yet.

I love Ubuntu and I love Hangul but I’m not going to deny it – it’s not hyper-easy to get it running on Ubuntu, not because it’s super hard but because there aren’t any helpful blog posts out there to walk someone through it.

By golly, miss molly, that ends today!  Let’s begin…

Hit the super key and type ‘languages’ and then click/open the “language support” icon as per this:

01_language_support_in_dash

Click ‘install/remove languages’ as per this:

02_install_remove_languages

English should be selected already (if your mother-tongue install was English).  Choose “korean” from the list, then apply, and wait (a really long time sometimes) while it downloads King Sejong and the kitchen sink…

03_select_korean_from_list

Here is where the non-intuitive stuff starts.  You’d think doing the above would be all you need but you need to do a bit more.  Go to the top right of the screen where you see English (En) and click that and you’ll see ‘text entry settings’

04_text_entry_settings

Now you will English sitting there all alone.  Press the + sign and then type ‘korean’ and select it.  Then you’ll see a screen like this.  Choose Korean (Hangul) (Ibus).

05_adding_hangul_ibus

I had some issues leaving the ‘master keyboard’ (that’s a name I gave it) switching with the default (something with the super key) and so I changed mine to Control + space bar.  You can do whatever you want by just clicking in the space where the default is and hitting your favourite combo in on your keyboard.  When finished just close the window and your changes will be saved.

Remember, this is *not* the hangul-english keyboard language switching combo.  This is the keyboard combo that switches your keyboard from the “English only” (En) one to the “Korean with English capabilities” one.

06_changing_accelerator

Now, we’re getting close to being able to angle your Hangul, but just one more critical step that will save you the pulling out of multiple strands of hair.  You must now either reboot, or log out and log back in again in order to be able to eat your green eggs with Hangul.

You will know that you have successfully reached Hangul-Land when the top right area that used to say “En” is now a colourful Korean swirl like so:

07_korean_swirl

Although you now have full Korean capabilities, you now must use the keyboard combos found within this Korean keyboard in order to switch between English and Korean.  The default combo is shift + space bar, and you can try it out now for a fun test.  You may, like me, wish to change this keyboard combo to something else. If you do,  go on to the next section.

How to Customize Your Shiny New Korean Keyboard with a Custom Language Toggle Keyboard Combo

Click the colourful swirl and select ‘setup’ as per this:

08_hangul_customize

Next, you will see the Hangul toggle key space with the defaults. If you want to change the keys used to toggle between Korean and English, just click ‘add’ and then, even though it says ‘key’ singular in the pop up, you can hit the key combo with your computer and it will work.

*Warning!* It shows this popup when you hit ‘add’ under the Hangul toggle area, which is *incorrect*. It should say ‘hangul’ not hanja here. Both hanja and hangul display the same pop up box so it just needs a bug report to fix this but I’m too tired at the point of writing this blog…

10_incorrect_hanja_in_popup

In this case, I used control +right alt key because I remember using something like that back in the day and it felt comfortable.  You can do whatever floats your boat.

09_new_toggle_added

아이구! 신기 신기! 오렛동안 한국말 이컴퓨터에서 못했어….  드디어.

Hope this helps you grow in Ubuntu and Korean!

Posted by uniqueone
,

http://askubuntu.com/questions/18747/how-do-i-install-run-files



Occasionally, some applications and games (eg. some from the Humble Indie Bundle) have .run installers. Before installing using these, check to see if:

  1. it is available from the Software Centre
  2. it is available as a .deb file, which will open in the Software Center

You can install .run files from the graphical interface, but using a terminal is more likely to give you useful feedback. To install a .run file you need to:

  1. make it executable.
  2. execute it

This is because .run files are just executable programs that do some unknown magic to install the program. This is similar to what .exe installers do on Windows and is different to the normal methods (at best, using the Software Centre, at worst using .deb files) in which applications are installed in a standard way and can be easily removed.

Graphical Method

  1. Right click on the file in the file manager and click 'Properties'. Click the 'Permissions' tab and tick the box that says 'Allow executing file as program'.
  2. Double click the file to execute it.

If this method doesn't work, try using the terminal method.

Terminal Method

Assume the file is called some-app.run and is in the folder /home/user/Downloads. You will need to modify these instructions to fit your situation.

  1. Open a terminal (Applications->Accessories->Terminal).

  2. enter cd /home/user/Downloads

  3. enter chmod +x some-app.run
  4. enter ./some-app.run

  5. if step 4 fails with a message including 'permission denied', try entering sudo ./some-app.run (you will need to enter your password for this).

Notes

  • Sometimes you will come across .bin files. These are basically the same as .run files.
  • The method to install .run files can be used to execute any file (as long as it has some sort of executable code in it.
  • Be careful using sudo and only use it when absolutely required. Translated into English, it means 'Run this command but allow it to do anything it wants to my computer'. This is why you are prompted for your password.


Posted by uniqueone
,
http://jeongchul.tistory.com/492

 

Posted by uniqueone
,

http://goproprada.tistory.com/272

 

 

Posted by uniqueone
,
https://tensorflowkorea.gitbooks.io/tensorflow-kr/content/g3doc/get_started/

 

 

 

텐서플로우를 실제로 작동시켜 봅시다!

시작하기 전에 앞으로 무엇을 배울지 힌트를 얻기위해 파이썬 API로 된 텐서플로우 코드를 잠깐 보겠습니다.

이 코드는 2차원 샘플 데이터를 사용하여 분포에 맞는 직선을 찾는(역주: 회귀분석) 간단한 파이썬 프로그램입니다.

 

import tensorflow as tf
import numpy as np

# Create 100 phony x, y data points in NumPy, y = x * 0.1 + 0.3
x_data = np.random.rand(100).astype(np.float32)
y_data = x_data * 0.1 + 0.3

# Try to find values for W and b that compute y_data = W * x_data + b
# (We know that W should be 0.1 and b 0.3, but Tensorflow will
# figure that out for us.)
W = tf.Variable(tf.random_uniform([1], -1.0, 1.0))
b = tf.Variable(tf.zeros([1]))
y = W * x_data + b

# Minimize the mean squared errors.
loss = tf.reduce_mean(tf.square(y - y_data))
optimizer = tf.train.GradientDescentOptimizer(0.5)
train = optimizer.minimize(loss)

# Before starting, initialize the variables.  We will 'run' this first.
init = tf.initialize_all_variables()

# Launch the graph.
sess = tf.Session()
sess.run(init)

# Fit the line.
for step in range(201):
    sess.run(train)
    if step % 20 == 0:
        print(step, sess.run(W), sess.run(b))

# Learns best fit is W: [0.1], b: [0.3]

코드의 앞 부분은 데이터 플로우 그래프를 만들고 있습니다. 텐서플로우는 세션이 만들어져서 run 함수가 호출되기 전까지 어떤 것도 실제로 실행하지 않습니다.

좀 더 흥미를 돋우기 위해 전형적인 머신러닝 모델이 텐서플로우에서 어떻게 구현되는지 살펴보시면 좋습니다. 뉴럴 네트워크 분야에서 가장 전형적인 문제는 MNIST 손글씨 숫자를 분류하는 것입니다. 우리는 여기서 두가지 버전의 설명 즉 하나는 머신러닝 초보자를 위한 것과 하나는 전문가를 위한 버전을 제공합니다. 만약 다른 소프트웨어 패키지로 MNIST 모델을 여러번 훈련시킨 적이 있다면 붉은 알약을 선택하세요. 만약 MNIST에 대해 들어본 적이 없다면 푸른 알약을 선택하면 됩니다. 초보자와 전문가 사이의 어디라면 푸른색 말고 붉은 알약을 선택하시면 됩니다.

MNIST for machine learning beginners tutorialDeep MNIST for machine learning experts tutorial

Images licensed CC BY-SA 4.0; original by W. Carter

바로 텐서플로우를 설치하고 배우고 싶다면 이 내용은 넘어가고 다음으로 진행해도 됩니다. 텐서플로우 기능을 설명하는 기술적인 튜토리얼에서 MNIST 예제를 또 사용하므로 다시 볼 수 있습니다.

Posted by uniqueone
,

http://otter275.postach.io/post/windoue-tenseopeulrou-with-cpureul-wihan-dokeo-seolci

 

 

window_tensorflow.zip-pdf

윈도우에 텐서플로우 with CPU를 위한 도커 설치


  1. 기본 도커는 windows 10 pro이상만 지원 하므로 windows home 및 그 이하는 기본 도커 대신에 docker tool box를 설치 해야 한다. (기본도커는 cpu가상화를 이용하고 도커툴박스는 virtualbox를 이용한다)

  1. 도커 설치를 위한 가상화 체크. 링크 참조 =>https://docs.docker.com/toolbox/toolbox_install_windows/

가상화 부분이 Enabled 되어 있지 않으면 cmos에 들어가 가상화를 활성화.

  1. 도커툴 박스 다운로드. 링크 참조 => https://www.docker.com/products/docker-toolbox

  1. 다운로드 후 기본값으로 설치

  1. 설치 후 에 바탕화면에 다음의 3가지 아이콘들을 볼 수 있다. (실행하지 않는다.)


  1. reboot 실시

  1. 재부팅 후 Docker Quickstart Terminal 실행

  1. 실행 후 두 번에 걸쳐 User Account Control 권한을 물어보는데 전부 yes 합니다.

  1. 그 후 다음과 같이 mingw64 터미널과 $ 사인을 볼 수 있다. (앞으로 도커머신에 접속 할 때는 계속해서 Docker Quickstart Terminal를 실행 하면 된다.)


  1. tensorflow를 위한 otterdocker라는 이름의 도커머신 설치 => 다음의 명령어 입력

$ docker-machine create otterdocker -d virtualbox


  1. 도커머신 리스트 확인 => 다음의 명령어 입력

$ docker-machine ls


위의 내용과 같이 otterdocker 도커 머신은 잘 설치 되어 있다. 하지만 ACTIVE가 현재 default로 설정 되어 있으므로 이것을 otterdocker로 바꾸어 주어야 한다.

  1. ACTIVE 변경 => 다음의 명령어 입력

$ eval $(docker-machine env otterdocker)


그 후 다시 조회해 보면 otterdocker로 ACTIVE가 넘어 와 있다.

  1. 도커에 tensorflow with CPU image 올리기 => 다음의 명령어 입력

$ docker run -it -p 8888:8888 gcr.io/tensorflow/tensorflow


이미지를 로컬에서 찾다가 없기 때문에 자동으로 다운로드 및 설치를 위의 화면과 같이 수행 하게 됩니다. 그리고 tensorflow를 위한 jupyter notebook 접속 정보를 http://도커주소:8888 로 보여 줍니다.

  1. Jupyter Notebook 접속

11,12번 항목으로 otterdocker의 주소는 192.168.99.101임을 알 수 있는데 여기에 Jupyter Notebook의 포트 번호 8888을 붙여서 접속 합니다. => http://192.168.99.101:8888


다음과 같은 Jupyter Notebook 의 초기 화면을 볼 수 있으며 여기서 오른쪽 상단의 New를 누른 뒤 Python 2를 선택하면 tensorflow 라이브러리가 로드된 Python 2 인터랙티브 화면이 실행 됩니다.

  1. Hello World 테스트 => 다음 캡쳐 화면의 내용 처럼 화면에 입력해 봅니다. 각 In의 실행 단축키는 Shift + Enter 입니다.


두 vector들의 덧셈 예제


 

Posted by uniqueone
,

http://askubuntu.com/questions/709951/install-ubuntu-14-04-from-bootable-usb-could-not-find-kernel-image-isolinux-i

 

I wanted to install Ubuntu 14.04 from USB. At first I got the error

No default or UI configuration directive found

after reading through the forums a bit I renamed the isolinux folder as well as the .bin and .cfg files to syslinux. However, after I did that now the error

Could not find kernel image: /isolinux/isolinux.cfg

shows up.

Any ideas on how to fix this problem? Thanks in advance!

--------------------------------------------------------------------

Have you tried to create your bootable usb key under windows with LinuxLive USB Creatorhttp://www.linuxliveusb.com/fr/home ?

If you are only on linux, try to Download you linux iso and follow this procedure

Type

fdisk -l

Find your usb key path (for exemple /dev/sdd here)

Flash your key with the iso. (It will erase everything without confirmation, please double check every parameters).

sudo dd if=path/to/your/iso/linux.iso of=/dev/sdd bs=4096

Please wait carefully the end of the process. Now you got a bootable usb key with your iso.

Best regards

 

Posted by uniqueone
,
http://flyingdcat4.tistory.com/76

 

 

우분투에 그래픽 드라이버잡는거 그거 뭐라고 만 하루를 꼬박 설치하는데만
보내냐 ㅠㅠ
그때그때 발생하는 에러를 잡기 위해서 구글에 있는 관련 문서는 한글 영어
가리지 않고 거의 다 본것 같다. 본 포스팅은 다시 개발환경을 밀고 설치를 할
때 똑같은 실수를 반복하지 않고, 나와 같은 처지였던 사람들에게 해결방법을
알리기 위함이다. 정말 많은 포스팅이 있는데 볼수록 헷갈리기만 하니까 이포
스팅에서 아주 자세히 설명을 할테니 빠짐없이 그대로 따라하길 바란다.
(1) 사전준비 작업
그동안 정들었던 theano기반 Keras 개발 환경을 과감하게 밀어버리고 tensorflo
w로 넘어가기 위해 우분투 설치 usb를 만들고 일단 그래픽카드를 본체에서 제
거하고 설치를 하자(이유는 질문하면 알려주겠다). 설치 후 네트워크를 연결
하고 NVIDIA 홈페이지에서 그래픽카드 최신버전(내 경우는 64bits 버전 NVI
DIALinuxx86_
64367.44.
run)을 Home 폴더에 다운로드 받자. 내친김에 cuda
와 cudnn도 받아놓자(cuda_7.5.18_linux.run, cudnn7.5linuxx64v5.0ga.
tgz).
그리고 터미널을 켜고 다음 두 명령어를 입력한다.
sudo aptget
update
sudo aptget
install buildessential
(2) nouveau 비활성화
NVIDIA계열 드라이버 설치 시 첫 번째 만나는 난관은 nouveau다. 우분투 설치
시 기본적으로 설치되는 드라이버인데 이녀석이 NVIDIA 드라이버와 충돌을
일으킨다. 자세한 설명은 여기로 (http://blog.neonkid.xyz/66) 요약하자면 nouve
au를 끄고 드라이버를 설치해야한다.
터미널을 실행시키고 다음과 같이 명령어를 입력하면 된다.
sudo vi /etc/modprobe.d/blacklistnouveau.
conf
blacklist nouveau
blacklist lbmnouveau
options nouveau modeset=0
alias nouveau off
alias lbmnouveau
off
:wq를 누르고 저장 후 다시 터미널로 나와서 다음 명령어를 입력한 후 일단 컴퓨터를 끄자.
sudo update-initramfs -u
sudo shutdown -h now
(3) 드라이버 설치
컴퓨터를 끈 후 그래픽 카드를 장착하고 디스플레이를 그래픽 카드로 연결한
다. 그리고 부팅하면 "The system is running in lowgraphics
mode" 라는 처음 맞
이하는 메시지가 나타났다. 처음엔 뭐지 하다가 가만 생각해보니 그래픽카드
드라이버를 설치한 적이 없으니 당연히 low graphics mode로 동작하는거다. 참
고로 내 그래픽카드는 NVIDIA gtx titanX다(갑자기 왠 자랑질??). 침착하게 CT
RL+ALT+F1을 눌러 콘솔로 진입한 다음 로그인을 하자. 다른 포스팅을 보면 li
ghtdm을 stop하라고 되어있는데 아마 지금 상태면 lightdm이 이미 stop되어있

는 상태일 것이다. 그래서 할 필요가 없다. (1)단계에서 받아놓은 드라이버를
바로 설치하면 된다.
sudo sh NVIDIALinuxx86_
64367.44.
run
no하는것 없이 디폴트로 다 설치하자. 설치가 다 되면 다음 명령어를 입력하자
sudo nvidia-xconfig
위에 명령어 입력안하면 x window 실행할 때 xorg관련 problem이 뜰것이다. 그
러니까 까먹지 말자.
여기까지 문제없이 실행했다면 디스플레이 매니저를 실행하자.
sudo service lightdm start
로그인 화면이 뜨고 문제없이 로그인이 될 것이다. 그런데 문제가 하나 있다.
CTRL+ALT+F1을 누르면 콘솔로 넘어가야하는데 아마 까만화면만 뜨고 아무
것도 안나올것이다. 당황하지말고 재부팅 한 후 다음 grub 파일을 수정하면 된
다.
sudo vi /etc/default/grub
파일을 열고 GRUB_CMDLINE_LINUX_DEFAULT="quiet_spolash" 라는 부
분을 아래와 같이 고쳐준다.
GRUB_CMDLINE_LINUX_DEFAULT="quiet_spolash nomodeset"
저장 후 나와서 grub파일을 업데이트 한 후 재부팅 한다.
sudo update-grub
sudo reboot
여기까지 실행하면 드라이버는 깔끔하게 설치된 것이다.
(4) cuda 설치
CTRL+ALT+F1으로 콘솔화면으로 나온 후 로그인한다음에 디스플레이 매니
저를 끄자.
sudo service lightdm stop
(1)에서 다운로드 받았던 cuda 파일을 실행하면 된다.
sudo sh cuda_7.5.18_linux.run
여기서 그래픽 드라이버는 설치했기 때문에 그래픽 드라이버 설치하시겠습니
까(영어로 나온다 잘해석하면 됨)라고 물어보는 질문에는 no, 나머지는 디폴
드로 다 설치하자. 설치 후 bashrc 파일에 cuda 경로를 설정해줘야 한다.
sudo vi ~/.bashrc
위 명령어로 파일을 열어서 마지막에 아래 경로를 추가하면 된다.
export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/usr/local/cuda/lib64"
export CUDA_HOME=/usr/local/cuda
혹시 cuda 설치 시 다음과 같은 에러가 발생한다면 "the driver installation is un
able to locate the kernel source..." 커널을 설치해주면 된다.

 

혹은 다음과 같은 에러가 발생한다면 "You appear to be running an X server..." 프로
세스 관련 폴더를 지우면 된다.
cd /tmp
rm -rf .X0-lock
(참조 http://m.blog.daum.net/goodgodgd/20 의 5.troubleshooting 부분)
(5) cudnn 설치
cudnn 설치는 간단하다. (1)에서 다운로드 받았던 파일의 압축을 풀고 파일을
복사해주면 끝이다.
tar xvzf cudnn-7.5-linux-x64-v5.0-rc.tgz
를 입력하면 압축이 풀리고 Home에 cuda 폴더가 생긴다.
cd cuda/include
sudo cp cudnn.h /usr/local/cuda/include
cd ..
cd lib64
sudo cp libcudnn* /usr/local/cuda/lib64
sudo chmod a+r /usr/local/cuda/lib64/libcudnn*
이제 cudnn까지 설치가 끝났다.
(6) 그 외 설정
cuda를 설치할 때 Home폴더에 nividia sample 폴더가 생성되었을 것이다. 컴파
일 해주자.
cd NVIDIA_CUDA-7.5_Samples/1_Utilities/deviceQuery
make
만약에 make시 에러가 난다면 buildessential이
제대로 설치가 안된 것이므로
(1)의 buildessential을
다시 설치하자. 위 과정까지 끝났으면 제대로 컴파일 되
었는지 테스트를 해본다.
./deviceQuery
실행결과가 PASS이면 제대로 설치된 것이다. 지금까지 수고했다. 마지막 대
망의 확인작업만이 남았다.
nvcc V
nvidiasmi
위 명령어를 실행해서 문제없이 버전과 gpu 스펙을 확인할 수 있다면 마지막
확인 작업이 끝난것이다. 이제 tensorflow 설치준비가 끝났다!

Posted by uniqueone
,
http://flyingdcat4.tistory.com/75

 

 

Window10 64bits Theano&Keras 설치 방법
http://skyer9.tistory.com/7
이 방법대로 설치하면 깔끔함 ㅋ
theano import할 때 아마 cl.exe 찾을 수 없다고 나오는데 이것은 환경변수에 시
스템 path에 설치한 visual studio 2013 path를 추가해주면 해결됨.
내 경우에는 아래 경로로~ (아마 대부분이 비슷한 경로일 거임)
C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\bin

 

Posted by uniqueone
,
http://dsa28s.tistory.com/entry/Windows%EA%B0%80-%EC%84%A4%EC%B9%98%EB%90%9C-%EC%83%81%ED%83%9C%EC%97%90%EC%84%9C-%EB%A6%AC%EB%88%85%EC%8A%A4%EB%A5%BC-%EC%84%A4%EC%B9%98%ED%95%98%EC%9E%90-%EB%A9%80%ED%8B%B0%EB%B6%80%ED%8C%85

 

 

 

 

저번에 리눅스 민트 기반인 하모니카 설치법을 포스팅 했었는데요,

저번 포스팅은 하드디스크에 리눅스만 설치하는 방법이었습니다;;


이번엔 Windows 가 설치된 상태에서 리눅스를 설치하여 Windows와 리눅스를 멀티부팅 하도록 하겠습니다.


설치 전 리눅스 설치 디스크가 필요합니다. 만드는 방법 http://dsa28s.tistory.com/4



필수) Windows 8.1 이상에서는 다음 설정을 해주어야 합니다!


필수 - 1. 제어판 > 전원 옵션에 들어가줍니다.

왼쪽 상단 절전 모드 해제 시 암호 사용을 클릭해주세요.



필수 - 2. 아래 빠른 시작 켜기 체크를 해제해 주세요.

(만약 체크칸이 비활성화 되어있다면 맨 위 현재 사용할 수 없는 설정 변경을 눌러 주신 후 해주세요.)

변경 내용 저장!



1. 리눅스 드라이브를 만들자!


1. 제어판 > 관리도구 > 컴퓨터 관리에 들어가 줍니다.

왼쪽에 디스크 관리를 클릭합니다.


리눅스를 설치할 드라이브를 누르신 후


오른쪽 마우스 클릭!



볼륨 축소를 눌러줍니다.


조금만 기다리면...



디스크를 축소할 수 있는 창이 나옵니다.



축소할 공간 입력 부분에 리눅스에서 사용할 용량을 GB가 아닌 MB단위로 입력해주세요. (저는 200GB로 했으므로 204800MB!)


할당이 완료되었습니다!



2. 리눅스를 설치하자!


리눅스 설치 디스크로 부팅해줍니다.





설치 형식에서 기타를 누른 후 계속을 눌러줍니다.



아까 할당한 드라이브를 눌러줍니다. (남은 공간이라고 표시됩니다.)

만약 잘못하실 경우 엉뚱한 드라이브가 날라가는 신기한 현상이...ㅎ



더블클릭 후 파티션을 아래 사진과 같이 하신 후 확인을 눌러줍니다.

(스왑 영역은 Windows의 가상 메모리와 비슷한 개념이라고 보시면 됩니다.)





스왑 영역이 할당되었습니다.


다시 남은 공간(아까 할당한 드라이브)을 더블클릭



아래 사진 처럼 해주신 후 확인을 눌러주세요.

(이 ext4 저널링 파일 시스템으로 맞춘 드라이브에 리눅스가 설치됩니다.)




부트로더를 설치할 장치에는 딱히 손은 안대셔도 됩니다.


이제 설치해주시면 됩니다!


부트로더를 설치할 장치는 리눅스에서는 GRUB라는 부트로더가 있는데 이 친구가 있어야 윈도우와 리눅스를 멀티부팅 할 수 있습니다.


저 같은 경우 SSD와 HDD가 있는데, SSD에는 Windows를 설치했고, HDD에는 저의 소중한 데이터(??)들과 리눅스가 설치되어 있습니다.

부트로더를 HDD에 설치했기 때문에 BIOS 설정에서 부팅 순위를 HDD로 1순위로 해주어야 멀티 부팅 메뉴가 나옵니다.


이상 포스팅을 마칩니다!

 

Posted by uniqueone
,
http://kcsdbma.tistory.com/10

 

 

 

Posted by uniqueone
,
http://doubuntu.tistory.com/2

 

 

제 1 장 우분투 설치[14.04LTS]-DoUbuntu Install

** 보다 많은 스크린샷을 보여줌으로 따라하기쉽게 끔 노력하겠습니다.

** 내용이 좋다고 생각되시면 펌보다는 링크(홍보)를 걸어주세요^^

** 댓글에는 인사대신 적용 안되는 부분과 상황을 기재 바랍니다.(오류내용 올려주시면 수정하겠습니다.)

** 참고로 다음카페/네이버카페/네이버블로그에 '우분투하자' '우분투백서' 등을 통폐합하여 여기로 이전합니다.


자 시작합니다. Do~Ubuntu


1. 우분투 설치  준비(Are U Ready?)
 

- 준비물 :  컴퓨터 (우분투라고 해서 무조건 안쓰거나 낮은 사양의 컴퓨터는 사절이다)

                           (필자의 컴퓨터4대는 사양이 CPU-APU/I3/I5  RAM-4G/8G/16G  SSD-128/256/256 입니다.)

      USB 메모리 2G 이상 (공CD 로는 구울수없는 용량이며 공DVD 가능)

      기본지식 : 이 글만 잘따라하면 될듯 합니다.(필요하다면 다른사이트도 참조하세요)      

      마음가짐 : 포기하지 않고 우분투를 써 보겠다 하자하자! 

// 우분투 부팅 이미지파일 다운로드 위치 : http://www.ubuntu.com/download/desktop

// 웹사이트 주소에 들어가면 아래처럼 영어로 된페이지가 뜬다 당황하지말고 가볍게 [ 다운로드 ] 클릭한다

// 다운로드를 클릭하면 다운로드 전에 기부하라는 화면이 뜬다 마우스로 드래그하면 "0"이 된다 모두 "0"을 만들고

// 하단에 다운로드하면 된다! (필자의 경우 말 기부하고 싶었다)

** [ 다운로드 ] 하고 저장 누르면 저장위치가 뜨고 확인하면 받아진다.

** 시간이 조금 걸린다. 커피한잔합시다.


2. 우분투 부팅파일 만들기-USB (Do it!)

설치파일을 다 받았으면 이제 부팅USB 를 만들어야 한다.(모든운영체가 비슷하다 태생이 다른애들은 제외.)

설치 파일이 981MB 이기 때문에 CD로 굽지는 못하지만, DVD로 굽거나, USB 메모리를 이용하면된다.

- DVD : ISO 이미지 굽는법은 따로 설명하지 않겠습니다. (검색창에 ISO 굽기 검색하면 쭉 나옴)

- USB :  우분투 USB를 만들기 위해서는 'Universal-USB-Installer' 라는 프로그램이 필요합니다

          ** 파일은 아래 첨부 (1.9.5.5)    ** 자료실에도 올리겠습니다.

          ** USB메모리는 2기가 이상으로 준비해주세요 

 

- 부팅 USB만들기 : 여기보면 알수 있습니다.

http://www.ubuntu.com/download/desktop/create-a-usb-stick-on-windows

위 사이트는 영어로 돼있으니 간략하게 정리하면 이렇다

1. 다운로드 받은 파일(Universal-USB-Installer-1.9.5.5.exe)을 클릭 실행한다.

Universal-USB-Installer-1.9.5.5.exe


2. 
아래와 같이 소스에서 우분투(ubuntu)를 선택한다. 

 ** 이 파일은 우분투 이외에도 윈도우나 다른 리눅스도 사용할 수 있다


3. 다운은 이전에 받은 우분투 이미지파일 을 선택한다.

4. 다음은 USB 선택 - 선택 란 옆에 포맷(Format) 체크 필수

5. 만들기( Create )클릭 후 기다리면 끝

** 아직 스크린샷이 준비가 부족해서 조금 어려울 수도 있다

** 잘 모르시는 분은 http://deviantcj.tistory.com/465 - 여기에서 자세한 설명도 참조하세요.


3. 우분투 설치하기(Right Now)

1. 컴퓨터 부팅설정을 변경하는 C-MOS 셋팅(설치에 필요한 필수사항)

** 모든 스크린샷은 가상화면에서 이쁘게 찍었으나 사진자료를 전부 분실(ㅜㅜ)해서 휴대폰이미지로 대체합니다.

** http://www.ubuntu.com/download/desktop/install-ubuntu-desktop 영문설명사이트

** 컴퓨터 마다 다르겠지만 보통 F1 키 / F2 키 / F10 키 / Del(ete) 키 이넷중 하나인데

** 브랜드별로 보면 삼성(F1/Del) Asus(F2/Del) HP(F10) LG(F2/Del)정도로 볼수 있다.

** 물론 보이는 방식도 위의 화면과 같지않다. 어디에나 잘 보다보면 부팅(Boot)가 있다 찾아보자


2. 부트(Boot) 메뉴에서 하드셋팅 관련메뉴로 갑니다.

//

** 위 화면도 제조사별로 다르다 최근 ASUS나 기가바이트같은 회사는 그래픽(GUI)이 많아졌다.


// 아래와 같이 USB부팅을 선택합니다.

// 순서변경 방법은 화면 오른쪽에 있습니다.(보통 '+' '-' 이거나 방향키 상하인경우도 있습니다.)


// 설정이 USB로 되있는지 확인합니다.(설치후에는 다시 원래대로 하드로 선택합니다.)


//셋팅이 끝났으면 저장하고 재부팅 합니다.


3. 정상적으로 USB부트(Boot) 셋팅되었다면 아래와 같이 설치 시작화면이 뜹니다.


4. 설치 시작화면

** 설치 시작 처음화면입니다.(기본이 영어네요 한글로 바꿉시다)

** 아래와 같이 환영메세지와 언어선택화면이 나옵니다.스크롤을 이용해서 내려보면 아래와같이 한글이 나온다.

// 한글을 선택하고 [Ubuntu 설치]를 눌러서 설치 시작합니다.



5. 기본정보 확인과 기본셋팅입니다.

// 위 그림과 같이 [설치 중 업데이트 다운로드] 는 체크하지 않습니다.(시간도 많이 걸리고 나중에 하는게 편함)

// [서드파티 소프트웨어 설치] 는 해도 되고 안해도 됩니다.

// 체크 됬으면 [계속] 을 눌러 다음으로 진행합니다.


6. 파티션 설정에 관련하여 새로 설치하거나 덮어쓰거나 사용자 정의할수 있습니다.

// 위와 같이 [기타] 를 선택하고 [계속] 을 클릭합니다.

** 필자의 경우 윈도우들과 듀얼부팅을 사용하기에 필수로 기타를 선택했습니다.

** 모두 지우고 다시 설치 시  하드가 파티션없이 설치 될수 있으니 기타를 선택해주시면 좋겠습니다.


7. 파티션 설정 화면입니다.*(윈도우가 설치되어있다면 윈도우 파티션은 건드리지 마세요)

** 남은공간이 보입니다. 여기에 분활하든 통으로 잡으시던 합니다.

// 남은공간 선택하시고 아래에 [+] 를 눌러주세요

** 위와 같이 파티션 만들기 화면이 나옵니다.

// [ 크기 ] : 파티션 크기를 설정합니다.

** 파티션크기는 필자의 경우 전부를 잡았습니다. 30~50기가 정도로 잡으면 전체적을 쓰는데 지장이 없기 때문입니다.

** 필요에 따라 크기를 적습니다. 참고로 1000MB 가 1GB 정도로 보시면 됩니다.(물런 1024K 가 1M 입니다)

** 메모리가 적어서 SWAP공간(하드디스크의 가상메모리)이 필요하면 적당량 빼줍니다.(메모리 많으면 통)

// [ 새 파티션의 종류] : 주 파티션을 선택합니다.

// [ 용도 ] : 스크린샷은 없으나 포맷방식이 나오는데 EXT4 최신을 선택합니다.

// [ 마운트위치 ] : 음~설치 위치정도인데 루트로 보시면 됩니다. ' / ' <<선택합니다.


// 셋팅 완료 후에 [ 지금 설치 ] 를 클릭하면 다음 화면이 나옵니다.

// 필자의 경우 메모리가 8기가 이상이라서 SWAP을 무시 해서 저런메세지가 나왔습니다. 무시합니다. [ 계속 ]클릭


8. 국가(지역) 선택화면(시간과 날짜 설정을 위함입니다. 나중에 설정변경 가능)

// 서울 선택하고 [ 계속] 클릭


8. 키보드 선택 및 배치화면

// 위 화면 처럼 하단에 [ 한국어 ] [ 한국어 ] 선택하고 [ 계속 ] 클릭합니다.


8. 설치 파일 복사 화면 시작.(끝날 때 까지 가만히 둡니다.시간이 조금 걸림)

** 오른쪽에 SKIP 누르면 안됩니다!!

** 드디여 설치의 끝이 보이네요


8. 파일 복사완료 화면

// 완료완료 창이 뜨면 [ 지금 다시 시작] 클릭합니다.

** 자 이제 부터 맘에 준비 재부팅후 바로 C-MOS 셋팅으로 들어가야 합니다.(위에서 했던거 기억나시죠?;;)


9. 재부팅후 바로 씨모스 셋팅화면으로 들어옵니다.

// 다시 정상적으로 하드부팅으로 바꾸기 위해서 위와같이 다시 하드를 상단으로 옴겨서 셋합니다.

** 다시 돌려놓지 않으면 평생 USB로 부팅해서 설치만 합니다.ㅎㅎ


10. 재부팅후 멀티 부팅이라면 아래와 같이 부트메뉴가 나옵니다.(우분트만 있다면 뜨지 않습니다.)

 

11. 처음 부팅후 첫 화면입니다.

** 자 이제 설치는 끝이 났습니다.

** 다음 포스팅에서는 실사용을 위한 셋팅(준비작업)을 해보겠습니다.

** 사용자 설정/메뉴/방법 등등


** 운영체제 포스팅 하려니 너무 시간이 오래 걸렸네요. 긴글 읽느라 수고하셧구요 다음시간에 뵙겠습니다.

** 아래 넘들을 제가 포스팅중에 아는동생과 함께 처리 했습니다.

** 첫포스팅이 끝났읍니다. 다음포스팅에 뵙겠습니다.

** 참고로 아래는 메뉴 이름 입니다. 익혀두세요.


 

Posted by uniqueone
,
http://www.noneface.com/2016/03/08/img_retrieval.html

 

 

MatconvNet

MatConvNet convolutional neural network tool is a matlab-based open-source package, and offers a variety of pre-trained models. More detailed information on their own google.

About MatConvNet configuration

Please refer to

Or the official website

pre-train models 选取

1.imagenet-googlenet-day.The food

2.imagenet-vgg-m.mat

3.imagenet-VGG-very deep 16.mat

Feature Extraction

Because of the need to use prior to completion of the integration of two features, so features will save all the pictures to the same file, making it easy to use.

imagenet-vgg-m.mat

run ./matconvnet-1.0-beta17/matlab/vl_setupnn
net = load('imagenet-vgg-m.mat');
addpath('LULC');
imgFiles = dir('LULC');
imgNamList = {imgFiles(~[imgFiles.isdir]).name};
imgNamList = imgNamList';
numImg = length(imgNamList);
feat = [];
for i =1:numImg
   img = imread(imgNamList{i, 1});

   if size(img, 3) == 3
       im_ = single(img) ; % note: 255 range
       im_ = imresize(im_, net.meta.normalization.imageSize(1:2)) ;
       im_ = im_ - net.meta.normalization.averageImage ;
       res = vl_simplenn(net, im_) ;
       % viesion: matconvnet-1.0-beta17
       featVec = res(17).x;
       featVec = featVec(:);
       feat = [feat; featVec'];
   else
       im_ = single(repmat(img,[1 1 3])) ; % note: 255 range
       im_ = imresize(im_, net.meta.normalization.imageSize(1:2)) ;
       im_ = im_ - net.meta.normalization.averageImage ;
       res = vl_simplenn(net, im_) ;
       
       % viesion: matconvnet-1.0-beta17
       featVec = res(17).x;
       featVec = featVec(:);
       feat = [feat; featVec'];
   end

end
resultName = 'D:\img\image-Retrieval\cnn\vgg_m.txt';
fid = fopen(resultName,'w');
[r,c] = size(feat);
for k = 1:r
    for j = 1:c
        fprintf(fid,'%f ',feat(k,j));
    
    end
    fprintf(fid,'\n');
end
imagenet-googlenet-day.The food

run ./matconvnet-1.0-beta17/matlab/vl_setupnn
modelPath = 'imagenet-googlenet-dag.mat' ;
net = dagnn.DagNN.loadobj(load(modelPath)) ;
addpath('LULC');
imgFiles = dir('LULC');
imgNamList = {imgFiles(~[imgFiles.isdir]).name};
imgNamList = imgNamList';
numImg = length(imgNamList);
feat = [];
for i =1:numImg
   img = imread(imgNamList{i, 1});

   if size(img, 3) == 3
       im_ = single(img) ; % note: 255 range
       im_ = imresize(im_, net.meta.normalization.imageSize(1:2)) ;
       im_ = im_ - net.meta.normalization.averageImage ;
       net.eval({'data', im_}) ;
       % viesion: matconvnet-1.0-beta17
       featVec = net.vars(152).value;
       featVec = featVec(:);
       feat = [feat; featVec'];
   else
       im_ = single(repmat(img,[1 1 3])) ; % note: 255 range
       im_ = imresize(im_, net.meta.normalization.imageSize(1:2)) ;
       im_ = im_ - net.meta.normalization.averageImage ;
       net.eval({'data', im_}) ;
       % viesion: matconvnet-1.0-beta17
       featVec = net.vars(152).value;
       featVec = featVec(:);
       feat = [feat; featVec'];
   end
end
resultName = 'D:\img\image-Retrieval\cnn\googlenet.txt';
fid = fopen(resultName,'w');
[r,c] = size(feat);
for k = 1:r
    for j = 1:c
        fprintf(fid,'%f ',feat(k,j));
    
    end
    fprintf(fid,'\n');
end
imagenet-VGG-very deep 16.mat

run ./matconvnet-1.0-beta17/matlab/vl_setupnn
net = load('imagenet-vgg-verydeep-16.mat');
addpath('LULC');
imgFiles = dir('LULC');
imgNamList = {imgFiles(~[imgFiles.isdir]).name};
imgNamList = imgNamList';
numImg = length(imgNamList);
feat = [];
for i =1:numImg
   img = imread(imgNamList{i, 1});
    fprintf('%s is extract cnn.\n',imgNamList{i,1});
   if size(img, 3) == 3
       im_ = single(img) ; % note: 255 range
       im_ = imresize(im_, net.meta.normalization.imageSize(1:2)) ;
       im_ = bsxfun(@minus,im_,net.meta.normalization.averageImage) ;
       res = vl_simplenn(net, im_) ;
       % viesion: matconvnet-1.0-beta17
       featVec = res(33).x;
       featVec = featVec(:);
       feat = [feat; featVec'];
   else
       im_ = single(repmat(img,[1 1 3])) ; % note: 255 range
       im_ = imresize(im_, net.meta.normalization.imageSize(1:2)) ;
       im_ = bsxfun(@minus,im_,net.meta.normalization.averageImage) ;
       res = vl_simplenn(net, im_) ;
       
       % viesion: matconvnet-1.0-beta17
       featVec = res(33).x;
       featVec = featVec(:);
       feat = [feat; featVec'];
   end
end
resultName = 'D:\img\image-Retrieval\cnn\vgg_vd.txt';
fid = fopen(resultName,'w');
[r,c] = size(feat);
for k = 1:r
    for j = 1:c
        fprintf(fid,'%f ',feat(k,j));
    
    end
    fprintf(fid,'\n');
end

Retrieval

#coding:utf8
import os
import numpy as np
import re
from sklearn import preprocessing

def load_features():

	fobj = open('vgg_vd.txt')
	im_features = []
	for line in fobj:
		line = line.rstrip()
		line = line.split()	
		
		im_feature = []
		for l in line:
			im_feature.append(float(l))
		
		im_features.append(im_feature)

	im_features = np.array(im_features)
	im_features = preprocessing.normalize(im_features, norm='l2')
	return im_features

def match_all(query_feature,im_features):
	score = np.dot(query_feature, im_features.T)
	rank_ID = np.argsort(-score)
	return rank_ID

def get_img_id():

	filename = "AllimgName.txt" # 所有图片文件名的txt文件
	fobj = open(filename)
	AllimgName = []
	for line in fobj:
		line = line.rstrip()
		AllimgName.append(line)
	return AllimgName

if __name__ == '__main__':
	path = 'result'
	AllimgName = get_img_id()
	feat = load_features()
	im_features = feat
	a = 0
	for im in feat:
		rank_ID = match_all(im,im_features)
		name = AllimgName[a]
		real_name = re.sub(r'.tif','.txt',name)
		id_name = re.sub(r'.tif','_id.txt',name)

		real_name = path+'\\'+ 'vgg_vd\\'+'name' +'\\'+ real_name
		id_name = path +'\\'+ 'vgg_vd\\'+'id' +'\\'+ id_name
		fobj1 = open(real_name,"w")
		fobj2 = open(id_name,"w")

		for i in rank_ID:
			 fobj1.write(AllimgName[i]+'\n')
			 fobj2.write(str(i)+' ')
		fobj1.close()
		fobj2.close()
		a += 1

Since then we need to use Graph integration, and Graph integration need to use the photo id, so the way the id is also preserved. About retrieve additional models directly modify the model and the path to save the final result loaded ok.

result

Merge

Based on previous fusion code, perform Graph and adaptive integration.

Fine tuning

1. Build your own data imdb.mat

In matconvnet, the official specified a file format. However, in the examples in matconvnet, I do not understand how it is generated imdb.mat file. After google to a related paper , we found a method of generating.

function imdb =setup_data(averageImage)
%code for Computer Vision, Georgia Tech by James Hays

%This path is assumed to contain 'test' and 'train' which each contain 15
%subdirectories. The train folder has 100 samples of each category and the
%test has an arbitrary amount of each category. This is the exact data and
%train/test split used in Project 4.
SceneJPGsPath = 'data/LULC/';

num_train_per_category = 80;
num_test_per_category  = 20; %can be up to 110
total_images = 21*num_train_per_category + 21 * num_test_per_category;

image_size = [224 224]; %downsampling data for speed and because it hurts
% accuracy surprisingly little

imdb.images.data   = zeros(image_size(1), image_size(2), 1, total_images, 'single');
imdb.images.labels = zeros(1, total_images, 'single');
imdb.images.set    = zeros(1, total_images, 'uint8');
image_counter = 1;

categories = {'agricultural', 'airplane', 'baseballdiamond', 'beach', ...
              'buildings', 'chaparral', 'denseresidential', ...
              'forest', 'freeway', 'golfcourse', 'harbor', ...
              'intersection', 'mediumresidential', 'mobilehomepark', 'overpass',...
              'parkinglot','river','runway','sparseresidential','storagetanks','tenniscourt'};
          
sets = {'train', 'test'};

fprintf('Loading %d train and %d test images from each category\n', ...
          num_train_per_category, num_test_per_category)
fprintf('Each image will be resized to %d by %d\n', image_size(1),image_size(2));

%Read each image and resize it to 224x224
for set = 1:length(sets)
    for category = 1:length(categories)
        cur_path = fullfile( SceneJPGsPath, sets{set}, categories{category});
        cur_images = dir( fullfile( cur_path,  '*.tif') );
        
        if(set == 1)
            fprintf('Taking %d out of %d images in %s\n', num_train_per_category, length(cur_images), cur_path);
            cur_images = cur_images(1:num_train_per_category);
        elseif(set == 2)
            fprintf('Taking %d out of %d images in %s\n', num_test_per_category, length(cur_images), cur_path);
            cur_images = cur_images(1:num_test_per_category);
        end

        for i = 1:length(cur_images)

            cur_image = imread(fullfile(cur_path, cur_images(i).name));
            cur_image = single(cur_image);
            cur_image = imresize(cur_image, image_size);
            
            %cur_image = bsxfun(@minus,cur_image,averageImage) ;
            cur_image = cur_image - averageImage;
            
            if(size(cur_image,3) > 1)
                fprintf('color image found %s\n', fullfile(cur_path, cur_images(i).name));
                cur_image = rgb2gray(cur_image);
                
            end
           
            
            % Stack images into a large 224 x 224 x 1 x total_images matrix
            % images.data
            imdb.images.data(:,:,1,image_counter) = cur_image; 
            
            imdb.images.labels(  1,image_counter) = category;
            imdb.images.set(     1,image_counter) = set; %1 for train, 2 for test (val?)
            
            image_counter = image_counter + 1;
        end
    end
end

The function returns imdb save ok.

Warning 下面的微调代码存在问题!!!

2.fine tune

With regard to the pre-trained models were fine tune, currently only completed imagenet-vgg-verydeep-16.mat and imagenet-vgg-m.mat two models of fine-tuning, this model corresponds googlenet, then any problem.

function [net,info] = fine_tune()
run ./matconvnet-1.0-beta17/matlab/vl_setupnn;

imdb = load('imdb.mat');
net = load('imagenet-vgg-verydeep-16.mat');
opts.train.expDir = fullfile('data','vd0.005') ;

net.layers = net.layers(1:end-2);
net.layers{end+1} = struct('type', 'conv', ...
'weights', , ...
'learningRate', [0.005,0.002], ...
'stride', [1 1], ...
'pad', [0 0 0 0]) ;

opts.train.batchSize = 20 ;
opts.train.learningRate = logspace(-4, -5.5, 300) ;
opts.trian.numEpochs = numel(opts.train.learningRate) ;
opts.train.continue = true ;

net.layers{end+1} = struct('type', 'softmaxloss') ;
    
[net, info] = cnn_train(net, imdb, @getBatch, ...
    opts.train,...
    'val', find(imdb.images.set == 2)) ;
save('fine_tune.mat','-struct', 'net')
end

function [im, labels] = getBatch(imdb, batch)
%getBatch is called by cnn_train.
im = imdb.images.data(:,:,:,batch) ;

labels = imdb.images.labels(1,batch) ;
end

More fine tune information please refer to

result

Relatively speaking, the result of fine-tuning to enhance the rate did not produce a good result adaptive fusion.

to sum up

About two fusion

My understanding is that the fusion of the two methods, that the result of this adaptive fusion method is more suitable for the calculation of the standard mAP fusion, the final results from the point of view is the same.

In Graph fusion, the presence of the most deadly thing is, in the integration process, the need for the fusion of two or more results is calculated once a common sub-graph, then looking at the process, not necessarily include all of the pictures (2100 pictures) sort (due mAP is the picture sort dispersed throughout the relevant search results, about mAP refer to ). This will to some extent limit its mAP results.

after that

For image retrieval this one do about it, and he sent a model trimming on googlenet not completed and has been submitted to an issues on github, it has not been restored.

Once this is done I can use them to do something?

I think they have spare time to do a little project: submit a photo and tell you what the image content inside Yes.
Related knowledge:

Estimate must first obtain a certain amount of good pictures already marked, such as crawling enough data from wikipedia or Baidu Encyclopedia, and then image feature extraction data to construct its own database.

Then also free of these written code review and rewrite the current write readable code is still very poor, can not read from time to time to write their own code.

EOF

'Deep Learning' 카테고리의 다른 글

Free Deep Learning Books  (0) 2016.11.28
Keras Tutorials  (0) 2016.11.11
Deep Learning Resources  (1) 2016.09.08
How to use the network trained using cnn_mnist example in MatConvNet?  (0) 2016.09.06
How to Start Learning Deep Learning  (0) 2016.08.24
Posted by uniqueone
,

https://handong1587.github.io/deep_learning/2015/10/09/dl-resources.html

 

ImageNet

AlexNet

ImageNet Classification with Deep Convolutional Neural Networks

Network In Network

Network In Network

Batch-normalized Maxout Network in Network

GoogLeNet

Going Deeper with Convolutions

Building a deeper understanding of images

VGGNet

Very Deep Convolutional Networks for Large-Scale Image Recognition

Tensorflow VGG16 and VGG19

Inception-V2 / Inception-V3

Inception-V3 = Inception-V2 + BN-auxiliary (fully connected layer of the auxiliary classifier is also batch-normalized, not just the convolutions)

Rethinking the Inception Architecture for Computer Vision

Notes on the TensorFlow Implementation of Inception v3

https://pseudoprofound.wordpress.com/2016/08/28/notes-on-the-tensorflow-implementation-of-inception-v3/

Training an InceptionV3-based image classifier with your own dataset

ResNet

Deep Residual Learning for Image Recognition

Third-party re-implementations

https://github.com/KaimingHe/deep-residual-networks#third-party-re-implementations

Training and investigating Residual Nets

http://torch.ch/blog/2016/02/04/resnets.html

Highway Networks and Deep Residual Networks

Interpretating Deep Residual Learning Blocks as Locally Recurrent Connections

Resnet in Resnet: Generalizing Residual Architectures

ResNet-v2

Identity 89Mappings in Deep Residual Networks

Residual Networks are Exponential Ensembles of Relatively Shallow Networks

Wide Residual Networks

Deep Residual Networks for Image Classification with Python + NumPy

Residual Networks of Residual Networks: Multilevel Residual Networks

Inception-V4

Inception-V4, Inception-Resnet And The Impact Of Residual Connections On Learning

Inception-ResNet-v2


Striving for Simplicity: The All Convolutional Net

Systematic evaluation of CNN advances on the ImageNet

Deep Learning And Bayesian

Scalable Bayesian Optimization Using Deep Neural Networks

Bayesian Dark Knowledge

Memory-based Bayesian Reasoning with Deep Learning

Towards Bayesian Deep Learning: A Survey

Towards Bayesian Deep Learning: A Framework and Some Existing Methods

Autoencoders

Auto-Encoding Variational Bayes

The Potential Energy of an Autoencoder

Importance Weighted Autoencoders

Review of Auto-Encoders

Stacked What-Where Auto-encoders

Ladder Variational Autoencoders How to Train Deep Variational Autoencoders and Probabilistic Ladder Networks

Rank Ordered Autoencoders

Decoding Stacked Denoising Autoencoders

Keras autoencoders (convolutional/fcc)

Building Autoencoders in Keras

Review of auto-encoders

Autoencoders: Torch implementations of various types of autoencoders

Tutorial on Variational Autoencoders

Variational Autoencoders Explained

Introducing Variational Autoencoders (in Prose and Code)

Under the Hood of the Variational Autoencoder (in Prose and Code)

The Unreasonable Confusion of Variational Autoencoders

Semi-Supervised Learning

Semi-Supervised Learning with Graphs (Label Propagation)

Semi-Supervised Learning with Ladder Networks

Semi-supervised Feature Transfer: The Practical Benefit of Deep Learning Today?

Unsupervised Learning

Restricted Boltzmann Machine (RBM), Sparse Coding and Auto-encoder

On Random Weights and Unsupervised Feature Learning

Unsupervised Learning of Spatiotemporally Coherent Metrics

Unsupervised Visual Representation Learning by Context Prediction

Unsupervised Learning on Neural Network Outputs

Unsupervised Learning of Visual Representations by Solving Jigsaw Puzzles

Clustering

Joint Unsupervised Learning of Deep Representations and Image Clusters

Single-Channel Multi-Speaker Separation using Deep Clustering

Deep Embedded Clustering (DEC)

Unsupervised Deep Embedding for Clustering Analysis

Transfer Learning

How transferable are features in deep neural networks?

-intro: NIPS 2014 - arxiv: http://arxiv.org/abs/1411.1792

Learning and Transferring Mid-Level Image Representations using Convolutional Neural Networks

Simultaneous Deep Transfer Across Domains and Tasks

Net2Net: Accelerating Learning via Knowledge Transfer

Transfer Learning from Deep Features for Remote Sensing and Poverty Mapping

A theoretical framework for deep transfer learning

Transfer learning using neon

Hyperparameter Transfer Learning through Surrogate Alignment for Efficient Deep Neural Network Training

What makes ImageNet good for transfer learning?

Multi-label Learning

CNN: Single-label to Multi-label

Deep Learning for Multi-label Classification

Predicting Unseen Labels using Label Hierarchies in Large-Scale Multi-label Learning(ECML2015)

Learning with a Wasserstein Loss

From Softmax to Sparsemax: A Sparse Model of Attention and Multi-Label Classification

CNN-RNN: A Unified Framework for Multi-label Image Classification

Improving Multi-label Learning with Missing Labels by Structured Semantic Correlations

Multi-task Learning

Multitask Learning / Domain Adaptation

multi-task learning

OverFeat: Integrated Recognition, Localization and Detection using Convolutional Networks

Learning and Transferring Multi-task Deep Representation for Face Alignment

Multi-task learning of facial landmarks and expression

Heterogeneous multi-task learning for human pose estimation with deep convolutional neural network

Deep Joint Task Learning for Generic Object Extraction

Multi-Task Deep Visual-Semantic Embedding for Video Thumbnail Selection

Learning deep representation of multityped objects and tasks

Cross-stitch Networks for Multi-task Learning

Multi-Task Learning in Tensorflow (Part 1)

一箭N雕:多任务深度学习实战

Multi-modal Learning

Multimodal Deep Learning

Multimodal Convolutional Neural Networks for Matching Image and Sentence

A C++ library for Multimodal Deep Learning

Multimodal Learning for Image Captioning and Visual Question Answering

Multi modal retrieval and generation with deep distributed models

Learning Aligned Cross-Modal Representations from Weakly Aligned Data

Variational methods for Conditional Multimodal Deep Learning

Debugging Deep Learning

Some tips for debugging deep learning

Introduction to debugging neural networks

How to Visualize, Monitor and Debug Neural Network Learning

Adversarial Examples of Deep Learning

Intriguing properties of neural networks

  • arxiv: http://arxiv.org/abs/1312.6199
  • my notes: In each layer of a deep network it is the “direction” of “space” (ensemble of feature activations) which encodes useful class information rather than individual units (feature activations).

Deep Neural Networks are Easily Fooled: High Confidence Predictions for Unrecognizable Images

Explaining and Harnessing Adversarial Examples

Distributional Smoothing with Virtual Adversarial Training

Confusing Deep Convolution Networks by Relabelling

Exploring the Space of Adversarial Images

Learning with a Strong Adversary

Adversarial examples in the physical world

DeepFool

DeepFool: a simple and accurate method to fool deep neural networks

Adversarial Autoencoders

Understanding Adversarial Training: Increasing Local Stability of Neural Nets through Robust Optimization

(Deep Learning’s Deep Flaws)’s Deep Flaws (By Zachary Chase Lipton)

Deep Learning Adversarial Examples – Clarifying Misconceptions

Adversarial Machines: Fooling A.Is (and turn everyone into a Manga)

How to trick a neural network into thinking a panda is a vulture

Deep Learning Networks

PCANet: A Simple Deep Learning Baseline for Image Classification?

Deeply-supervised Nets (DSN)

Striving for Simplicity: The All Convolutional Net

Pointer Networks

Rectified Factor Networks

FlowNet: Learning Optical Flow with Convolutional Networks

Correlational Neural Networks

Diversity Networks

A Unified Approach for Learning the Parameters of Sum-Product Networks (SPN)

Recombinator Networks: Learning Coarse-to-Fine Feature Aggregation

Dynamic Capacity Networks

Bitwise Neural Networks

Learning Discriminative Features via Label Consistent Neural Network

A Theory of Generative ConvNet

Value Iteration Networks

How to Train Deep Variational Autoencoders and Probabilistic Ladder Networks

Group Equivariant Convolutional Networks (G-CNNs)

Deep Spiking Networks

Low-rank passthrough neural networks

XNOR-Net: ImageNet Classification Using Binary Convolutional Neural Networks

Deeply-Fused Nets

SNN: Stacked Neural Networks

Convolutional Neural Fabrics

Holistic SparseCNN: Forging the Trident of Accuracy, Speed, and Size

Factorized Convolutional Neural Networks

Mollifying Networks

Local Binary Convolutional Neural Networks

DenseNet

Densely Connected Convolutional Networks

CliqueCNN: Deep Unsupervised Exemplar Learning

Convexified Convolutional Neural Networks

Highway Networks

Highway Networks

Very Deep Learning with Highway Networks

Training Very Deep Networks (highway networks)

Spatial Transformer Networks

Spatial Transformer Networks

The power of Spatial Transformer Networks

Recurrent Spatial Transformer Networks

Deep Learning with Traditional Machine Learning Methods

Cascade

Compact Convolutional Neural Network Cascade for Face Detection

Bag of Words (BoW)

Deep Learning Transcends the Bag of Words

Bootstrap

Training Deep Neural Networks on Noisy Labels with Bootstrapping

Decision Tree

Neural Network and Decision Tree

Decision Forests, Convolutional Networks and the Models in-Between

SVM

Large-scale Learning with SVM and Convolutional for Generic Object Categorization

Convolutional Neural Support Vector Machines:Hybrid Visual Pattern Classifiers for Multi-robot Systems

Deep Learning using Linear Support Vector Machines

Deep Learning and Robots

Robot Learning Manipulation Action Plans by “Watching” Unconstrained Videos from the World Wide Web

Robots that can adapt like animals (Nature 2014)

End-to-End Training of Deep Visuomotor Policies

Comment on Open AI’s Efforts to Robot Learning

The Curious Robot: Learning Visual Representations via Physical Interactions

Deep Learning on Mobile Devices

Convolutional neural networks on the iPhone with VGGNet

Deep Learning in Finance

Deep Learning in Finance

A Survey of Deep Learning Techniques Applied to Trading

Applications

Some like it hot - visual guidance for preference prediction

Deep Learning Algorithms with Applications to Video Analytics for A Smart City: A Survey

Deep-Spying: Spying using Smartwatch and Deep Learning

Camera identification with deep convolutional networks

Build an AI Cat Chaser with Jetson TX1 and Caffe

An Analysis of Deep Neural Network Models for Practical Applications

8 Inspirational Applications of Deep Learning

16 Open Source Deep Learning Models Running as Microservices

-intro: Places 365 Classifier, Deep Face Recognition, Real Estate Classifier, Colorful Image Colorization, Illustration Tagger, InceptionNet, Parsey McParseface, ArtsyNetworks - blog: http://blog.algorithmia.com/2016/07/open-source-deep-learning-algorithm-roundup/

Makeup like a superstar: Deep Localized Makeup Transfer Network

Deep Cascaded Bi-Network for Face Hallucination

DeepWarp: Photorealistic Image Resynthesis for Gaze Manipulation

Autoencoding Blade Runner

A guy trained a machine to “watch” Blade Runner. Then things got seriously sci-fi.

http://www.vox.com/2016/6/1/11787262/blade-runner-neural-network-encoding

Deep Convolution Networks for Compression Artifacts Reduction

Deep GDashboard: Visualizing and Understanding Genomic Sequences Using Deep Neural Networks

Photo Filter Recommendation by Category-Aware Aesthetic Learning

  • intro: Filter Aesthetic Comparison Dataset (FACD): 28,000 filtered images and 42,240 reliable image pairs with aesthetic comparison annotations
  • arxiv: http://arxiv.org/abs/1608.05339

Instagram photos reveal predictive markers of depression

How an Algorithm Learned to Identify Depressed Individuals by Studying Their Instagram Photos

IM2CAD

Fast, Lean, and Accurate: Modeling Password Guessability Using Neural Networks

Defeating Image Obfuscation with Deep Learning

Detecting Music BPM using Neural Networks

Age Estimation

Deeply-Learned Feature for Age Estimation

Age and Gender Classification using Convolutional Neural Networks

Recurrent Face Aging

Emotion / Expression Recognition

Real-time emotion recognition for gaming using deep convolutional network features

Emotion Recognition in the Wild via Convolutional Neural Networks and Mapped Binary Patterns

DeXpression: Deep Convolutional Neural Network for Expression Recognition

DEX: Deep EXpectation of apparent age from a single image

How Deep Neural Networks Can Improve Emotion Recognition on Video Data

Peak-Piloted Deep Network for Facial Expression Recognition

Training Deep Networks for Facial Expression Recognition with Crowd-Sourced Label Distribution

A Recursive Framework for Expression Recognition: From Web Images to Deep Models to Game Dataset

-arxiv: http://arxiv.org/abs/1608.01647

EmotioNet

EmotioNet: EmotioNet: An accurate, real-time algorithm for the automatic annotation of a million facial expressions in the wild

Attribution Prediction

PANDA: Pose Aligned Networks for Deep Attribute Modeling

Predicting psychological attributions from face photographs with a deep neural network

Learning Human Identity from Motion Patterns

Pose Estimation

DeepPose: Human Pose Estimation via Deep Neural Networks

Flowing ConvNets for Human Pose Estimation in Videos

Structured Feature Learning for Pose Estimation

Convolutional Pose Machines

Model-based Deep Hand Pose Estimation

Stacked Hourglass Networks for Human Pose Estimation

Chained Predictions Using Convolutional Neural Networks

DeeperCut: A Deeper, Stronger, and Faster Multi-Person Pose Estimation Model

Sentiment Prediction

From Pixels to Sentiment: Fine-tuning CNNs for Visual Sentiment Prediction

Predict Sentiment From Movie Reviews Using Deep Learning

Neural Sentiment Classification with User and Product Attention

Place Recognition

NetVLAD: CNN architecture for weakly supervised place recognition

PlaNet - Photo Geolocation with Convolutional Neural Networks

Camera Relocalization

PoseNet: A Convolutional Network for Real-Time 6-DOF Camera Relocalization

Modelling Uncertainty in Deep Learning for Camera Relocalization

Crowd Counting / Analysis

Large scale crowd analysis based on convolutional neural network

Cross-scene Crowd Counting via Deep Convolutional Neural Networks

Single-Image Crowd Counting via Multi-Column Convolutional Neural Network

CrowdNet

CrowdNet: A Deep Convolutional Network for Dense Crowd Counting

Music / Sound Classification

Explaining Deep Convolutional Neural Networks on Music Classification

Deep Convolutional Neural Networks and Data Augmentation for Environmental Sound Classification

NSFW Detection / Classification

Nipple Detection using Convolutional Neural Network

Applying deep learning to classify pornographic images and videos

MODERATE, FILTER, OR CURATE ADULT CONTENT WITH CLARIFAI’S NSFW MODEL

WHAT CONVOLUTIONAL NEURAL NETWORKS LOOK AT WHEN THEY SEE NUDITY

Image Reconstruction / Inpainting

Context Encoders: Feature Learning by Inpainting

Semantic Image Inpainting with Perceptual and Contextual Losses

Image Restoration

Image Restoration Using Very Deep Convolutional Encoder-Decoder Networks with Symmetric Skip Connections

Image Restoration Using Convolutional Auto-encoders with Symmetric Skip Connections

Image Completion with Deep Learning in TensorFlow

Image Super-Resolution

Image Super-Resolution Using Deep Convolutional Networks

Learning a Deep Convolutional Network for Image Super-Resolution

Shepard Convolutional Neural Networks


Bicubic VS. Shepard CNN

Bidirectional Recurrent Convolutional Networks for Multi-Frame Super-Resolution

Deeply-Recursive Convolutional Network for Image Super-Resolution

Accurate Image Super-Resolution Using Very Deep Convolutional Networks

Super-Resolution with Deep Convolutional Sufficient Statistics

Deep Depth Super-Resolution : Learning Depth Super-Resolution using Deep Convolutional Neural Network

Local- and Holistic- Structure Preserving Image Super Resolution via Deep Joint Component Learning

End-to-End Image Super-Resolution via Deep and Shallow Convolutional Networks

Accelerating the Super-Resolution Convolutional Neural Network

srez: Image super-resolution through deep learning

Image Denoising

Beyond a Gaussian Denoiser: Residual Learning of Deep CNN for Image Denoising

Medical image denoising using convolutional denoising autoencoders

Image Haze Removal

DehazeNet: An End-to-End System for Single Image Haze Removal

Blur Detection and Removal

Learning to Deblur

Learning a Convolutional Neural Network for Non-uniform Motion Blur Removal

End-to-End Learning for Image Burst Deblurring

Image Compression

An image compression and encryption scheme based on deep learning

Full Resolution Image Compression with Recurrent Neural Networks

Depth Prediction

Deeper Depth Prediction with Fully Convolutional Residual Networks

Texture Synthesis

Texture Synthesis Using Convolutional Neural Networks

Combining Markov Random Fields and Convolutional Neural Networks for Image Synthesis

Texture Networks: Feed-forward Synthesis of Textures and Stylized Images

Precomputed Real-Time Texture Synthesis with Markovian Generative Adversarial Networks

Generative Adversarial Text to Image Synthesis

Image Tagging

Flexible Image Tagging with Fast0Tag

Music Tagging

Automatic tagging using deep convolutional neural networks

Benchmarks

Deep Learning’s Accuracy

Benchmarks for popular CNN models

https://github.com/jcjohnson/cnn-benchmarks

Papers

Reweighted Wake-Sleep

Probabilistic Backpropagation for Scalable Learning of Bayesian Neural Networks

Deeply-Supervised Nets

Deep learning

On the Expressive Power of Deep Learning: A Tensor Analysis

Understanding and Predicting Image Memorability at a Large Scale

Towards Open Set Deep Networks

Structured Prediction Energy Networks (SPEN)

A Mathematical Theory of Deep Convolutional Neural Networks for Feature Extraction

Deep Neural Networks predict Hierarchical Spatio-temporal Cortical Dynamics of Human Visual Object Recognition

A Mathematical Theory of Deep Convolutional Neural Networks for Feature Extraction

Understanding Deep Convolutional Networks

DeepCare: A Deep Dynamic Memory Model for Predictive Medicine

Exploiting Cyclic Symmetry in Convolutional Neural Networks

Cross-dimensional Weighting for Aggregated Deep Convolutional Features

Understanding Visual Concepts with Continuation Learning

Learning Efficient Algorithms with Hierarchical Attentive Memory

DrMAD: Distilling Reverse-Mode Automatic Differentiation for Optimizing Hyperparameters of Deep Neural Networks

Do Deep Convolutional Nets Really Need to be Deep (Or Even Convolutional)?

Harnessing Deep Neural Networks with Logic Rules

Degrees of Freedom in Deep Neural Networks

Deep Networks with Stochastic Depth

LIFT: Learned Invariant Feature Transform

Understanding How Image Quality Affects Deep Neural Networks

Deep Embedding for Spatial Role Labeling

Learning Convolutional Neural Networks for Graphs

Unreasonable Effectiveness of Learning Neural Nets: Accessible States and Robust Ensembles

Learning Deep Representation for Imbalanced Classification

FractalNet

FractalNet: Ultra-Deep Neural Networks without Residuals

Newtonian Image Understanding: Unfolding the Dynamics of Objects in Static Images

Convolutional Neural Networks Analyzed via Convolutional Sparse Coding

Recent Advances in Convolutional Neural Networks

TI-POOLING: transformation-invariant pooling for feature learning in Convolutional Neural Networks

Why does deep and cheap learning work so well?

STDP

A biological gradient descent for prediction through a combination of STDP and homeostatic plasticity

An objective function for STDP

Towards a Biologically Plausible Backprop

Target Propagation

How Auto-Encoders Could Provide Credit Assignment in Deep Networks via Target Propagation

Difference Target Propagation

CNN with Computer Vision

End-to-End Integration of a Convolutional Network, Deformable Parts Model and Non-Maximum Suppression

A convnet for non-maximum suppression

A Taxonomy of Deep Convolutional Neural Nets for Computer Vision

Projects

Top Deep Learning Projects

deepnet: Implementation of some deep learning algorithms

DeepNeuralClassifier(Julia): Deep neural network using rectified linear units to classify hand written digits from the MNIST dataset

Clarifai Node.js Demo

Visual Search Server

Deep Learning in Rust

Implementation of state-of-art models in Torch

Deep Learning (Python, C, C++, Java, Scala, Go)

deepmark: THE Deep Learning Benchmarks

Siamese Net

  • intro: “This package shows how to train a siamese network using Lasagne and Theano and includes network definitions for state-of-the-art networks including: DeepID, DeepID2, Chopra et. al, and Hani et. al. We also include one pre-trained model using a custom convolutional network.”
  • github: https://github.com/Kadenze/siamese_net

PRE-TRAINED CONVNETS AND OBJECT LOCALISATION IN KERAS

Deep Learning algorithms with TensorFlow: Ready to use implementations of various Deep Learning algorithms using TensorFlow

Fast Multi-threaded VGG 19 Feature Extractor

Live demo of neural network classifying images

http://ml4a.github.io/dev/demos/cifar_confusion.html#

mojo cnn: c++ convolutional neural network

DeepHeart: Neural networks for monitoring cardiac data

Deep Water: Deep Learning in H2O using Native GPU Backends

Greentea LibDNN: Greentea LibDNN - a universal convolution implementation supporting CUDA and OpenCL

Dracula: A spookily good Part of Speech Tagger optimized for Twitter

Trained image classification models for Keras

PyCNN: Cellular Neural Networks Image Processing Python Library

regl-cnn: Digit recognition with Convolutional Neural Networks in WebGL

gvnn

gvnn: Neural Network Library for Geometric Computer Vision

Readings and Questions

What you wanted to know about AI

http://fastml.com/what-you-wanted-to-know-about-ai/

Epoch vs iteration when training neural networks

Questions to Ask When Applying Deep Learning

http://deeplearning4j.org/questions.html

How can I know if Deep Learning works better for a specific problem than SVM or random forest?

What is the difference between deep learning and usual machine learning?

Resources

Awesome Deep Learning

Awesome-deep-vision: A curated list of deep learning resources for computer vision

Applied Deep Learning Resources: A collection of research articles, blog posts, slides and code snippets about deep learning in applied settings.

Deep Learning Libraries by Language

Deep Learning Resources

http://yanirseroussi.com/deep-learning-resources/

Deep Learning Resources

https://omtcyfz.github.io/2016/08/29/Deep-Learning-Resources.html

Turing Machine: musings on theory & code(DEEP LEARNING REVOLUTION, summer 2015, state of the art & topnotch links)

https://vzn1.wordpress.com/2015/09/01/deep-learning-revolution-summer-2015-state-of-the-art-topnotch-links/

BICV Group: Biologically Inspired Computer Vision research group

http://www.bicv.org/deep-learning/

Learning Deep Learning

http://rt.dgyblog.com/ref/ref-learning-deep-learning.html

Summaries and notes on Deep Learning research papers

Deep Learning Glossary

The Deep Learning Playbook

https://medium.com/@jiefeng/deep-learning-playbook-c5ebe34f8a1a#.eg9cdz5ak

Deep Learning Study: Study of HeXA@UNIST in Preparation for Submission

Deep Learning Books

awesome-very-deep-learning: A curated list of papers and code about very deep neural networks (50+ layers)

Deep Learning Resources and Tutorials using Keras and Lasagne

Deep Learning: Definition, Resources, Comparison with Machine Learning

Awesome - Most Cited Deep Learning Papers

The most cited papers in computer vision and deep learning

deep learning papers: A place to collect papers that are related to deep learning and computational biology

papers-I-read

LEARNING DEEP LEARNING - MY TOP-FIVE LIST

Attention

Tools

DNNGraph - A deep neural network model generation DSL in Haskell

Deep playground: an interactive visualization of neural networks, written in typescript using d3.js

Neural Network Package

  • intro: This package provides an easy and modular way to build and train simple or complex neural networks using Torch
  • github: https://github.com/torch/nn

deepdish: Deep learning and data science tools from the University of Chicago deepdish: Serving Up Chicago-Style Deep Learning

AETROS CLI: Console application to manage deep neural network training in AETROS Trainer

Books

Deep Learning

Fundamentals of Deep Learning: Designing Next-Generation Artificial Intelligence Algorithms

FIRST CONTACT WITH TENSORFLOW: Get started with with Deep Learning programming

Make Your Own Neural Network: IPython Neural Networks on a Raspberry Pi Zero

Blogs

Neural Networks and Deep Learning

http://neuralnetworksanddeeplearning.com

Deep Learning Reading List

http://deeplearning.net/reading-list/

WILDML: A BLOG ABOUT MACHINE LEARNING, DEEP LEARNING AND NLP.

http://www.wildml.com/

Andrej Karpathy blog

http://karpathy.github.io/

Rodrigob’s github page

http://rodrigob.github.io/

colah’s blog

http://colah.github.io/

What My Deep Model Doesn’t Know…

http://mlg.eng.cam.ac.uk/yarin/blog_3d801aa532c1ce.html

Christoph Feichtenhofer

 

Posted by uniqueone
,

https://github.com/vlfeat/matconvnet/issues/509

 

딥러닝서버에서 ResNet을 실행시키니

Attempt to execute SCRIPT vl_nnconv as a function: ...

Error in dagnn.Conv/forward ...

이런 식으로 나오길래

 

아래 novelmartis의 말대로 Matlab's default path를 중복되지 않게 path를 설정했더니 된다.

 

 

 

novelmartis commented on Apr 20

Posted by uniqueone
,

https://github.com/vlfeat/matconvnet/issues/575

 

나도 아래의 Ben의 방법대로 고쳤더니 pooling_gpu.cu (line 163), bilinearsampler_gpu.cu (line 25)를 수정했더니 고쳐짐

 

 

jlee614 commented on Jun 11 edited

Hi,

I downloaded the last version of MatConvNet (ver1.0-beta20) and tried compiling with GPU support.

I have a GTX1080 card which requires CUDA 8.0 (otherwise there's an error: "nvcc fatal : Unsupported gpu architecture 'compute_61' ")

Anyways, when I try to compile with CUDA 8.0, it seems to work for the most part but then I get the following:

vl_compilenn: CUDA: MEX config file: 'C:\Program Files\MATLAB\R2016a\toolbox\distcomp\gpu\extern\src\mex\win64\mex_CUDA_win64.xml'
data.cu
datamex.cu
nnconv.cu
nnfullyconnected.cu
nnsubsample.cu
nnpooling.cu
nnnormalize.cu
nnbnorm.cu
nnbias.cu
nnbilinearsampler.cu
Building with 'Microsoft Visual C++ 2013 Professional'.
MEX completed successfully.
Building with 'Microsoft Visual C++ 2013 Professional'.
MEX completed successfully.
Building with 'Microsoft Visual C++ 2013 Professional'.
MEX completed successfully.
Building with 'Microsoft Visual C++ 2013 Professional'.
MEX completed successfully.
Building with 'Microsoft Visual C++ 2013 Professional'.
MEX completed successfully.
Building with 'Microsoft Visual C++ 2013 Professional'.
MEX completed successfully.
Building with 'Microsoft Visual C++ 2013 Professional'.
MEX completed successfully.
Building with 'Microsoft Visual C++ 2013 Professional'.
MEX completed successfully.
Building with 'Microsoft Visual C++ 2013 Professional'.
MEX completed successfully.
im2row_gpu.cu
subsample_gpu.cu
copy_gpu.cu
> C:/Users/Justin/Documents/MATLAB/matconvnet-1.0-beta20/matlab/src/bits/impl/pooling_gpu.cu(163): error: function "atomicAdd(double *, double)" has already been defined

1 error detected in the compilation of "C:/Users/Justin/AppData/Local/Temp/tmpxft_00001afc_00000000-8_pooling_gpu.cpp1.ii".
pooling_gpu.cu
Error using vl_compilenn>nvcc_compile (line 521)
Command "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v8.0\bin\nvcc" -c
"C:\Users\Justin\Documents\MATLAB\matconvnet-1.0-beta20\matlab\src\bits\impl\pooling_gpu.cu" -DNDEBUG -DENABLE_GPU -DENABLE_DOUBLE -D__SSSE3__
-gencode=arch=compute_61,code=\"sm_61,compute_61\" -I"C:\Program Files\MATLAB\R2016a\extern\include" -I"C:\Program
Files\MATLAB\R2016a\toolbox\distcomp\gpu\extern\include" -gencode=arch=compute_61,code=\"sm_61,compute_61\" -Xcompiler /MD -o
"C:\Users\Justin\Documents\MATLAB\matconvnet-1.0-beta20\matlab\mex.build\bits\impl\pooling_gpu.obj" failed.

Error in vl_compilenn (line 466)
nvcc_compile(opts, srcs{i}, objfile, flags.nvcc) ;

I googled for the error bolded and came across this link which I think may have something to with what's going on:
[http://stackoverflow.com/questions/37566987/cuda-atomicadd-for-doubles-definition-error]

I don't know if it's a proper fix or not, but I ended up doing the following:

pooling_gpu.cu, line 163
(commented out atomicadd)

bilinearsampler_gpu.cu, line 25
(commented out atomicadd)

This made the compiling work and I ran vl_testnn without any problems after compiling. Posting this here in case anyone else has the same problem and also if anyone has any further insights as to what caused the problem and what issues may arise from me commenting out the lines above.

Thanks!
-Justin

 

------------------------------------------------------------------------------------

missilzolair commented on Jun 12

Hi,

I just encounter the same issue, except that I am using a gtx970, with compute capability 5.2. Apparently, it's related to the fact that with Pascal (compute capability 6.0) a native double version of atomicAdd has been added.

In my case, if I simply comment the overloaded definition of atomicAdd, I will still get an error. The right solution (http://stackoverflow.com/questions/37566987/cuda-atomicadd-for-doubles-definition-error/37569519) is to use the following macro:

#if !defined(__CUDA_ARCH__) || __CUDA_ARCH__ >= 600
#else
<... place here your own pre-pascal atomicAdd definition ...>
#endif

I added the aforementioned macro at the two locations that Justin mentioned and the code compiles just fine with CUDA 8.0 on gpu architecture < 6.0.

Cheers,
Ben

 

------------------------------------------------------------------------------------

 

jlee614 commented on Jun 13

Ben,

Thanks for your help! I came across that same link (sorry, I had my syntax wrong and it didn't post properly the first time), and your suggestion is the correct one.

Thanks again!
Justin

 

------------------------------------------------------------------------------------

 

lenck commented on Jun 14

Thanks @jlee614 for the report and @missilzolair for suggesting the bugfix!
It's now pushed to the master...

 

 

Posted by uniqueone
,

http://stackoverflow.com/questions/34644779/how-to-use-the-network-trained-using-cnn-mnist-example-in-matconvnet

 

 

 

I've trained a cnn through the provided code cnn_mnist. After that, I tryed to to classify an image but I don't understand the reason why I got this error after the following code:

    [net, info] = cnn_mnist
net = 
    layers: {1x8 cell}
info = 
    train: [1x1 struct]
      val: [1x1 struct]
f=fopen(fullfile('.\data\mnist\', 't10k-images-idx3-ubyte'),'r') ;
x2=fread(f,inf,'uint8');
fclose(f) ;
x2=permute(reshape(x2(17:end),28,28,10e3),[2 1 3]) ;
im = x2(:,:,1); 
im = single(im);
 res = vl_simplenn(net,im);
Reference to non-existent field 'class'.
Error in vl_simplenn (line 163)
      res(i+1).x = vl_nnsoftmaxloss(res(i).x, l.class) ; 

-----------------------------------------------------

 

 

i'm not sure why your code won't run. I belive the problem is in your last layer. by default it is defined by softmaxloss and you should change it to softmax. try to add this line before calling vl_simplenn:

net.layers{end}.type = 'softmax';

anyway try this code that works for me (you should run it from main MatConvNet folder):

%%%%%%%%%%% run this lines only once at matlab startup
run matlab/vl_compilenn
run matlab/vl_setupnn
%%%%%%%%%%%

load('examples\mnist\data\mnist-bnorm\net-epoch-20.mat');  % files from training
net.layers{end}.type = 'softmax';
im = imread('Capture.jpg') ; % an image of a handwritten number
im = rgb2gray(im);
im_ = single(im) ; % note: 0-255 range
im_ = imresize(im_, net.meta.inputSize(1:2)+1) ;
load('examples\mnist\data\mnist-bnorm\imdb.mat')
im_ = im_ - images.data_mean;

% run the CNN
res = vl_simplenn(net, im_) ;

% show the classification result
scores = squeeze(gather(res(end).x)) ;
[bestScore, best] = max(scores) ;
best = best - 1;  % shift the score from 1:10 to 0:9
figure(1) ; clf ; imshow(im) ;
title(sprintf('The number is %s, score %.1f%%',...
net.meta.classes.name{best+1}-1, bestScore * 100)) ;
Posted by uniqueone
,
http://ofir.io/How-to-Start-Learning-Deep-Learning/?utm_content=buffer0a0ef&utm_medium=social&utm_source=plus.google.com&utm_campaign=buffer

Ofir PressSometimes deep sometimes learningAboutHow to Start Learning Deep LearningDue to the recent achievements of artificial neural networks across many different tasks (such as face recognition, object detection and Go), deep learning has become extremely popular. This post aims to be a starting point for those interested in learning more about it.If you already have a basic understanding of linear algebra, calculus, probability and programming: I recommend starting with Stanford’s CS231n. The course notes are comprehensive and well-written. The slides for each lesson are also available, and even though the accompanying videos were removed from the official site, re-uploads are quite easy to find online.If you don’t have the relevant math background: There is an incredible amount of free material online that can be used to learn the required math knowledge. Gilbert Strang’s course on linear algebra is a great introduction to the field. For the other subjects, edX has courses from MIT on both calculus and probability.If you are interested in learning more about machine learning: Andrew Ng’s Coursera class is a popular choice as a first class in machine learning. There are other great options available such as Yaser Abu-Mostafa’s machine learning course which focuses much more on theory than the Coursera class but it is still relevant for beginners. Knowledge in machine learning isn’t really a prerequisite to learning deep learning, but it does help. In addition, learning classical machine learning and not only deep learning is important because it provides a theoretical background and because deep learning isn’t always the correct solution.CS231n isn’t the only deep learning course available online. Geoffrey Hinton’s Coursera class “Neural Networks for Machine Learning” covers a lot of different topics, and so does Hugo Larochelle’s “Neural Networks Class”. Both of these classes contain video lectures. Nando de Freitas also has a course available online which contains videos, slides and also a list of homework assignments.If you prefer reading over watching video lectures: Neural Networks and Deep Learning is a free online book for beginners to the field. The Deep Learning Book is also a great free book, but it is slightly more advanced.Where to go after you’ve got the basics:Computer Vision is covered by most, if not all, of the deep learning resources mentoined above.Recurrent Neural Networks (RNNs) are the basis of neural network based models that solve tasks related to sequences such as machine translation or speech recognition. Andrej Karpathy’s blog post on RNNs is a great place to start learning about them. Christopher Olah has a great blog where many deep learning concepts are explained in a very visual and easy to understand way. His post on LSTM networks is an introduction to LSTM networks which are a wildly used RNN variant.Natural Language Processing (NLP): CS224d is an introduction to NLP with deep learning. Advanced courses are available from both Kyunghyun Cho (with lecture notes here) and Yoav Goldberg.Reinforcement Learning: If you’d like to control robots or beat the human champion of Go, you should probably use reinforcement learning. Andrej Karpathy’s post on deep reinforcement learning is an excellent starting point. David Silver also recently published a short blog post introducing deep reinforcement learning.Deep learning frameworks: There are many frameworks for deep learning but the top three are probably Tensorflow (by Google), Torch (by Facebook) and Theano (by MILA). All of them are great, but if I had to select just one to recommend I’d say that Tensorflow is the best for beginners, mostly because of the great tutorials avialable.If you’d like to train neural networks you should probably do it on a GPU. You dont have to, but its much faster if you do. NVIDIA cards are the industry standard, and while most research labs use $1000 dollar graphics cards, there are a few affordable cards that can also get the work done. An even cheaper option is to rent a GPU-enabled instance from a cloud server provider like Amazon’s EC2 (short guide here).Good luck!Written on June 26, 2016 
Posted by uniqueone
,

https://sites.google.com/site/minggaoshomepage/links/dee

 

Deep Learning (http://deeplearning.net/)



1. Deep Learning Research Groups

University of Toronto - Machine Learning Group (Geoff Hinton, Rich Zemel, Ruslan Salakhutdinov, Brendan Frey, Radford Neal)

Université de Montréal - Lisa Lab (Yoshua Bengio, Pascal Vincent, Aaron Courville, Roland Memisevic)

New York University – Yann Lecun‘s and Rob Fergus‘ group

Stanford University – Andrew Ng‘s group

UBC – Nando de Freitas‘s group

Google Research – Jeff Dean, Samy Bengio, Jason Weston, Marc’Aurelio Ranzato, Dumitru Erhan, Quoc Le et al

Microsoft Research – Li Deng et al

SUPSI – IDSIA (Schmidhuber’s group)

UC Berkeley – Bruno Olshausen‘s group

University of Washington – Pedro Domingos‘ group

IDIAP Research Institute - Ronan Collobert‘s group

University of California Merced – Miguel A. Carreira-Perpinan‘s group

University of Helsinki - Aapo Hyvärinen‘s Neuroinformatics group

Université de Sherbrooke – Hugo Larochelle‘s group

University of Guelph – Graham Taylor‘s group

University of Michigan – Honglak Lee‘s group

Technical University of Berlin – Klaus-Robert Muller‘s group

Baidu – Kai Yu‘s group

Aalto University – Juha Karhunen‘s group

U. Amsterdam – Max Welling‘s group

U. California Irvine – Pierre Baldi‘s group

Ghent University – Benjamin Shrauwen‘s group

University of Tennessee – Itamar Arel‘s group

IBM Research – Brian Kingsbury et al

University of Bonn – Sven Behnke’s group

Gatsby Unit @ University College London – Maneesh Sahani, Yee-Whye Teh, Peter Dayan

Computational Cognitive Neuroscience Lab @ University of Colorado Boulder


2. Deep Learning Softwares

Theano – CPU/GPU symbolic expression compiler in python (from LISA lab at University of Montreal)

Pylearn2 - Pylearn2 is a library designed to make machine learning research easy.

Torch – provides a Matlab-like environment for state-of-the-art machine learning algorithms in lua (from Ronan Collobert, Clement Farabet and Koray Kavukcuoglu)

DeepLearnToolbox – A Matlab toolbox for Deep Learning (from Rasmus Berg Palm)

Cuda-Convnet – A fast C++/CUDA implementation of convolutional (or more generally, feed-forward) neural networks. It can model arbitrary layer connectivity and network depth. Any directed acyclic graph of layers will do. Training is done using the back-propagation algorithm.

Deep Belief Networks. Matlab code for learning Deep Belief Networks (from Ruslan Salakhutdinov).

RNNLM- Tomas Mikolov’s Recurrent Neural Network based Language models Toolkit.

RNNLIB-RNNLIB is a recurrent neural network library for sequence learning problems. Applicable to most types of spatiotemporal data, it has proven particularly effective for speech and handwriting recognition.

matrbm. Simplified version of Ruslan Salakhutdinov’s code, by Andrej Karpathy (Matlab).

deepmat- Deepmat, Matlab based deep learning algorithms.

Estimating Partition Functions of RBM’s. Matlab code for estimating partition functions of Restricted Boltzmann Machines using Annealed Importance Sampling (from Ruslan Salakhutdinov).

Learning Deep Boltzmann Machines Matlab code for training and fine-tuning Deep Boltzmann Machines (from Ruslan Salakhutdinov).

The LUSH programming language and development environment, which is used @ NYU for deep convolutional networks

Eblearn.lsh is a LUSH-based machine learning library for doing Energy-Based Learning. It includes code for “Predictive Sparse Decomposition” and other sparse auto-encoder methods for unsupervised learning. Koray Kavukcuoglu provides Eblearn code for several deep learning papers on this page.

Nengo-Nengo is a graphical and scripting based software package for simulating large-scale neural systems.

Eblearn is a C++ machine learning library with a BSD license for energy-based learning, convolutional networks, vision/recognition applications, etc. EBLearn is primarily maintained by Pierre Sermanet at NYU.

cudamat is a GPU-based matrix library for Python. Example code for training Neural Networks and Restricted Boltzmann Machines is included.

Gnumpy is a Python module that interfaces in a way almost identical to numpy, but does its computations on your computer’s GPU. It runs on top of cudamat.

The CUV Library (github link) is a C++ framework with python bindings for easy use of Nvidia CUDA functions on matrices. It contains an RBM implementation, as well as annealed importance sampling code and code to calculate the partition function exactly (from AIS lab at University of Bonn).

3-way factored RBM and mcRBM is python code calling CUDAMat to train models of natural images (from Marc’Aurelio Ranzato).

Matlab code for training conditional RBMs/DBNs and factored conditional RBMs (from Graham Taylor).

CXXNET – An implementation of deep convolution neural network in C++.

mPoT is python code using CUDAMat and gnumpy to train models of natural images (from Marc’Aurelio Ranzato).

neuralnetworks is a java based gpu library for deep learning algorithms.


3. Deep Learning Tutorial


A. Survey Papers on Deep Learning

Yoshua Bengio, Learning Deep Architectures for AI, Foundations and Trends in Machine Learning, 2(1), pp.1-127, 2009.

Yoshua Bengio, Aaron Courville, Pascal Vincent, Representation Learning: A Review and New Perspectives, Arxiv, 2012.

Deep Learning Code Tutorials

The Deep Learning Tutorials are a walk-through with code for several important Deep Architectures (in progress; teaching material for Yoshua Bengio’s IFT6266 course).

Unsupervised Feature and Deep Learning

Stanford’s Unsupervised Feature and Deep Learning tutorials has wiki pages and matlab code examples for several basic concepts and algorithms used for unsupervised feature learning and deep learning.

An Article about History of Deep Learninghttp://www.wired.com/wiredenterprise/2014/01/geoffrey-hinton-deep-learning


Deep Learning Tutorials – examples of how to do Deep Learning with Theano (from LISA lab at University of Montreal)


B. Videos

  • Deep Learning Representations
Yoshua Bengio’s Google tech talk on Deep Learning Representations at Google Montreal (Google Montreal, 11/13/2012)
  • Deep Learning with Multiplicative Interactions

Geoffrey Hinton’s talk at the Redwood Center for Theoretical Neuroscience (UC Berkeley, March 2010).

  • Recent developments on Deep Learning

Geoffrey Hinton’s GoogleTech Talk, March 2010.

  • Learning Deep Hierarchies of Representations 

general presentation done by Yoshua Bengio in September 2009, also at Google.

  • A New Generation of Neural Networks 

Geoffrey Hinton’s December 2007 Google TechTalk.

  • Deep Belief Networks

Geoffrey Hinton’s 2007 NIPS Tutorial [updated 2009] on Deep Belief Networks 3 hour video , ppt, pdf , readings

  • Training deep networks efficiently

Geoffrey Hinton’s talk at Google about dropout and “Brain, Sex and Machine Learning”.

  • Deep Learning and NLP
 Yoshua Bengio and Richard Socher’s talk, “Deep Learning for NLP(without magic)” at ACL 2012.
  • Tutorial on Learning Deep Architectures
Yoshua Bengio and Yann LeCun’s presentation at “ICML Workshop on Learning Feature Hiearchies” on June 18th 2009.

Energy-based Learning

[LeCun et al 2006]A Tutorial on Energy-Based Learning, in Bakir et al. (eds) “Predicting Structured Outputs”, MIT Press 2006: a 60-page tutorial on energy-based learning, with an emphasis on structured-output models. The tutorial includes an annotated bibliography of discriminative learning, with a simple view of CRF, maximum-margin Markov nets, and graph transformer networks.

A 2006 Tutorial an Energy-Based Learning given at the 2006 CIAR Summer School: Neural Computation & Adaptive Perception.[Energy-Based Learning: Slides in DjVu (5.2MB), Slides in PDF (18.2MB)] [Deep Learning for Generic Object Recognition:Slides in DjVu (3.8MB), Slides in PDF (11.6MB)]

ECCV 2010 Tutorial

Feature learning for Image Classification (by Kai Yu and Andrew Ng): introducing a paradigm of feature learning from unlabeled images, with an emphasis on applications to supervised image classification.

NIPS 2010 Workshop

Deep Learning and Unsupervised Feature Learning: basic concepts about unsupervised feature learning and deep learning methods with links to papers and code.

Summer Schools

Graduate Summer School: Deep Learning, Feature Learning: IPAM summer school about deep learning.

Online Courses

Geoffrey Hinton’s Online Neural networks Course on Coursera.

International Conference on Learning Representations (ICLR 2014)https://www.youtube.com/playlist?list=PLhiWXaTdsWB-3O19E0PSR0r9OseIylUM8

Posted by uniqueone
,

1. http://newsight.tistory.com/180

 

주로 위 사이트에서 오픈소스로 링크된 리스트중 실제로 직접 실행해본 소스를 정리한다.

http://deeplearning.net/software_links/


CuDNN : 

Theano : 

ConvNet :

Torch :

Caffe :


RNNLM : C++로 되어있음, 윈도우 환경에서 실행이 안되는 것으로 판단됨. 우분투에서 실행해야한다는 이야기를 들음. 코드는 약간 분석하기 힘들어 보이나, 전체적으로 간결한 편임.
http://www.fit.vutbr.cz/~kombrink/personal/rnn-kaldi/


RNNLIB : RNN이 구현된 몇안되는 라이브러리. 마찬가지로 리눅스 기반으로 보이며 LSTM, Bidrectional LSTM, Multidimensional RNN 등등의 알고리즘이 구현된 것으로 보인다.
http://sourceforge.net/projects/rnnl/

http://people.idsia.ch/~juergen/rnn.html (뭔가 RNNLIB와 관련된 소스코드로 보임.. 정확하지 않음)


DeepLearnToolbox : 매틀랩으로 된 코드. 경로추가만 해주니 아주 부드럽게 잘 돌아감. 유일한 단점은 병렬화가 안되는 정도로보임. 소스코드도 세분화가 잘되어 있어 좋음. RNN계열 코드를 제외하고 CAE, CNN, DBN, NN, SAE 등의 코드가 구현되어 있음. 데이터는 mnist 임.
https://github.com/rasmusbergpalm/DeepLearnToolbox


deepmat : 마찬가지로 매틀랩 코드임. 딥러닝 툴박스 보다 좀더 다양한 모델이 구현있으나 약간 폴더 정리가 안됨. 마찬가지로 RNN은 없으나, CNN, DAE, DBM, DBN, GSN, MLP. RBM, 등등이 구현되어 바로 실행 가능. 마찬가지로 데이터는 mnist임
https://github.com/kyunghyuncho/deepmat




Michal Cernansky's Homepage: 유일하게 찾은 RNN 계열 매틀랩 소스코드가 오픈 된 것으로 보임. 딥러닝.net에서 링크한 것이 아니므로 완전히 신뢰할 순 없을 것 같지만, 괜찮아보임.
http://www2.fiit.stuba.sk/~cernans/main/download.html


Miscellaneous Code for Neural Networks, Reinforcement Learning, and Other Fun Stuff : Reinforcement가 오픈소스로 구현됨. 
http://www.cs.colostate.edu/~anderson/code/



옥스포드 대학교 영상처리 연구실의 오픈소스 :
http://www.robots.ox.ac.uk/~vgg/






- 기계학습 오픈소스 파이썬 

http://www.kdnuggets.com/2015/06/top-20-python-machine-learning-open-source-projects.html?utm_content=bufferddfa4&utm_medium=social&utm_source=twitter.com&utm_campaign=buffer

 

 

 

2. http://t-robotics.blogspot.kr/2015/06/hw-sw.html#.V7uRkoLr0sM

 

딥러닝 공부 가이드 (HW / SW 준비편)

뭐든지 시작이 중요합니다. 시험공부를 시작하기 전에 갑자기 책상 정리하고, 방청소를 하는게 괜한 이유가 있는게 아니죠. 그만큼 정갈하게 시작하고 싶고, 완벽한 시작을 꿈꾸니까요. (물론 그러다가 정작 공부를 못하기는 합니다만...)

딥러닝 공부도 마찬가지일 것입니다. 여러분들도 아마 공부를 시작하진 않고 관련 자료만 디립다 저장해 놓으셨겠지만 (ㅋㅋㅋ) 이 모든건 아직 장비빨이 갖춰지지 않았기 때문이죠. 일단 딥러닝을 공부하겠다는데 딥러닝 공부를 위한 완벽한 환경부터 갖추어야 하지 않겠습니까? ㅎㅎ

딥러닝을 위한 새로운 GPU, GTX Titan X를 발표하는 NVIDIA CEO의 모습 (사진출처) 

그래서 "딥러닝 공부 가이드" 시리즈를 준비했습니다.
   [딥러닝 공부 가이드]





   2.  TensorFlow 기초편

   3.  딥러닝 공부자료 모음편

오늘은 그 첫번째로 딥러닝을 위해 필요한 하드웨어들과 소프트웨어들을 어떻게 선택하고 준비할지에 대해 알아보도록 하죠.

딥러닝을 위한 하드웨어 가이드

사실 저도 여러 하드웨어를 설치해 이용해보진 않았습니다. 하지만 딥러닝을 위해 하드웨어를 구성하시는 분들께 좋은 자료가 있어 소개드립니다.
A Full Hardware Guide to Deep Learninghttps://goo.gl/wrc9Is
Which GPU to get for Deep Learning, https://goo.gl/VF2RxR 
한줄요약 : 돈 많으면 좋은거 쓰세요;;;

이렇게 끝내시면 아마 화내시겠죠...? ㅎㅎ 그래서 위에 언급한 글의 내용을 간략하게 요약해 드리겠습니다. 먼저, GPU부터 살펴보도록 하죠.


GPU는 딥러닝에 있어 연산을 병렬처리하게 끔 해주는 가장 핵심적인 하드웨어 요소입니다. 딥러닝의 큰 발전 원인 중 하나로 GPGPU(General-Purpose Computing on GPU)의 등장을 꼭 꼽으니 말이죠. 예전엔 빅데이터의 처리가 너무도 오래걸렸지만, 요즘은 그냥 많은 양의 데이터만큼 많은 GPU를 꽂아서 병렬처리를 하면 몇 백만개의 데이터도 두렵지 않답니다. 게다가 딥러닝 라이브러리를 이용한다면 병렬처리를 간단하게 구현할 수 있으니, 그것 또한 엄청 큰 매력이죠.

우선 돈이 무척 많으시다면 GTX Titan X를 쓰십시오. 만약에 다니시는 회사에서 지원을 빵빵하게 해주신다면 말이죠. 현재시점(15년 6월)을 기준으로 가격도 함께 말씀드리면요, GTX Titan X는 140만원 이상으로 거의 컴퓨터 한 대 값이네요 ㅎㄷㄷ 다다익선! 데이터가 많다면 더 많이 꽂아서 주변의 부러움을 사시기 바랍니다.

요거보다 한단계 낮은 걸 쓰신다면 GTX 980을 고르셔도 충분할 것 같습니다. (70~90만원) 제가 쓰고있는게 바로 요놈이지요. 제 생각엔 연구에는 GTX 980 하나만 있어도 충분하지 않을까 싶습니다. 무슨 구글처럼 수백개의 머신을 돌릴게 아니라면 말이죠.

만약에 돈이 없으시다면 GTX 960 (30만원)을 쓰셔도 좋을 것 같고요. 더 없으시면 더 낮은 걸로 쓰실 수 밖에 없겠지요. (참고로 GTX 960은 GTX 980의 약 절반의 성능을 보여줍니다.) 만약 제가 제시해드린 것 외의 다른 GPU를 고르신다면 먼저 그 GPU가 CUDA 프로그래밍을 지원하는지 꼭 확인해보셔야 합니다. GPU 이용에 있어 엔비디아의 CUDA 지원은 거의 필수적인 기술이거든요.
CuDA 지원 GPU 리스트 : https://developer.nvidia.com/cuda-gpus 
어떤 분들은 라데온 제품을 쓰면 안되느냐 하시는 분들도 계실텐데... 그르지 마요...;; 그냥 딥러닝은 엔비디아로 가는겁니다. 딥러닝에 맞춘 하드웨어나 소프트웨어 지원이 빵빵하거든요. (CuDNN이란게 라이브러리도 제공해 줄 정도니까요)

GPU간의 성능 비교가 궁금하신 분들은 gpuboss.com 이란 사이트가 매우 유용하실 것입니다. 한가지 더 말씀드리자면 GTX 970은 960보다 훨씬 빠르고 980보다 약간 느린 성능을 보이지만 메모리를 3.5G 이상 사용할 경우 효율저하의 문제가 발생한다고 하네요. 구매에 참고하세요.

GTX980 vs. GTX960 (gpuboss.com)

딥러닝을 노트북에서 돌리고 싶으신 분들도 아마 계실텐데요, 노트북은 발열문제로 인해 GPU가 풀 성능을 발휘하지 못하는 경우가 많습니다. 예를 들어 GTX980을 노트북 버전으로 개량한 GTX980M 제품은 발열을 조절할 수 있도록 클럭수를 제한하고 있죠. 따라서 아키텍쳐는 GTX980과 거의 같지만 그 성능은 GTX960보다 살짝 나은 수준 정도라고 하네요. (가격은 GTX980과 비슷한데 말이죠ㅠ)

참고로 그냥 알고리즘 공부를 하신다면 굳이 하드웨어까지 챙겨서 하실 필요는 없고요, 정말 많은 데이터를 다루고 싶은 분들만 GPU를 구매하시는게 좋지 않을까 싶습니다. 인내심이 여러분의 머니를 아껴줍니다ㅎㅎ 만약 GPU를 사신다면 웬만하면 4G 이상의 메모리를 가진 GPU를 사시길 권합니다.

GPU 외에 다른 하드웨어 조건들은 사실 크게 까다롭지 않습니다. 그래도 꼽아보자면, 먼저 파워가 충분해야합니다. GPU가 파워를 많이 소모하기 때문에 최소 500W 이상이어야 하고요 (GPU와 CPU의 요구 Watt를 더한 후 100~300W 여유를 가져주세요.), 메인보드도 PCIe를 많이 지원해주는 좋은 메인보드면 좋겠네요. (전 PCIe 3.0 소켓이 부족해서 SSD를 떼어내야만 했던 아픔이...ㅠ GPU 하나 당 2개의 PCIe가 필요합니다.)

CPU는 딥러닝에서 주로 GPU에 변수값들을 복사하며 주고받을 때 사용되는데 GPU하나 당 2개의 2GHz 이상의 클럭이면 좋다고 하고요 (뭐 요즘 쿼드코어면 충분하죠), 본체가 너무 뜨거워져서 성능이 저하되지 않도록만 쿨링만 조심해주시면 된다고 합니다.

이 정도면 하드웨어 선택에 도움이 좀 되셨으려나요? 그럼 그 다음, 소프트웨어 선택 부분으로 넘어가 보도록 하죠.

딥러닝 라이브러리  

먼저 딥러닝 관련 자료들을 모은 사이트부터 하나 보고 가실게요~
[딥러닝 코드 모음]  http://deeplearning.net/software_links/
위에 소개해드린 deeplearning.net은 코드들 말고도 읽기자료, 데모 등도 잘 소개되어 있으니 딥러닝을 공부하며 종종 참고하시기 바랍니다.

딥러닝을 입문하시는 분들이라면 Matlab으로 입문하시는 것도 나쁘지 않을 것 같습니다. Matlab은 언어도 쉽고 변수값을 확인하기도 쉬우며 관련 코드들도 많이 존재하니까요. 저도 사실 알고리즘을 처음 이해할 때는 먼저 Matlab 코드를 보면서 따라가는 편입니다. 워낙 프로그램 인터페이스가 잘 되어있어 값 확인하기가 쉽거든요.

Matlab 자료 중에는 간단한 Neural Network부터 Deep belief network까지 다양한 알고리즘이 있는 DeepLearnToolbox를 추천해 드립니다.
[코드] https://github.com/rasmusbergpalm/DeepLearnToolbox
만약 Convolutional Neural Network를 Matlab으로 공부하는 분이시라면 다음의 자료를 추천드립니다.
[튜토리얼] http://www.robots.ox.ac.uk/~vgg/practicals/cnn/
[코드] https://github.com/vedaldi/practical-cnn


하지만 여러분들께서 만약 큰 용량의 데이터를 다루신다면 MATLAB은 너무 느리죠. 그리고 GPU 서포트도 쉽지 않고요. 이 경우엔 딥러닝 전문 라이브러리를 쓰시는 것이 좋습니다. 대표적으로는 Theano, Torch, Caffe가 있죠.

Theano는 딥러닝 대가 Yoshua Bengio교수가 이끄는 몬트리올 대학 LISA 연구실에서 개발된 라이브러리입니다. 파이썬을 사용하고 있고 내부적으로는 속도를 위해 C로 구현이 되어있죠. 당연히 GPU가 지원되고요, Bengio 교수가 워낙 좋은 논문/문서들을 쏟아내는 만큼, Theano와 Theano 기반의 딥러닝에 대해서도 좋은 튜토리얼을 제공하고 있네요. 특히 주요 알고리즘들이 예제코드로 제공되어 있어 딥러닝을 공부하시는 분들껜 매우 유용한 라이브러리가 아닐까 생각합니다. 다양한 라이브러리가 존재하는 "파이썬"을 기반으로 한다는 점도 장점이고요.
[Theano 튜토리얼] http://deeplearning.net/software/theano/
[Deep Learning 튜토리얼] http://deeplearning.net/tutorial/
Torch7은 딥러닝 대가 Yann LeCun교수가 페이스북과 함께 중점적으로 사용하고 있는 라이브러리입니다. 스크립트 언어인 Lua를 기본으로 하고 있고 Theano와 거의 유사한 기능을 제공하고 있습니다. Theano보다 더 빠르다고 주장하는데 그것에 대해서는 논란이 있고요, 아무래도 페이스북이란 대기업이 키우다보니 향후 발전성이 클 것으로 기대됩니다.
[Torch7] http://torch.ch/
[Torch7 튜토리얼] http://code.cogbits.com/wiki/doku.php


Caffe는 버클리대학의 비전 연구그룹(BVLC)에서 개발한 C++ 라이브러리입니다. C++을 이용하다보니 자유도가 높고 속도가 빠른 반면, 약간의 언어적 번거로움이 있고, 튜토리얼이 아직은 풍성하지 않은 것이 단점입니다.
[Caffe] http://caffe.berkeleyvision.org/
 Reddit에는 이런 커맨트가 있네요. 
"Caffe는 다른 타겟을 가지고 있다. Caffe는 보다 큰 마켓에 딥러닝을 적용하려는 목적을 가지고 있는 반면 Torch나 Theano는 딥러닝 그 자체 연구에 더 적합하다."
좀더 자세한 Theano/Torch7/Caffe의 비교는 다음의 블로그 글(영문)을 참고해주세요.


여기에 또 굿뉴스가 추가됐네요. 바로 구글이 발표한 TensorFlow입니다.
[TensorFlow] https://www.tensorflow.org/
TensorFlow의 가장 큰 특징은 복잡한 코딩 없이 다이어그램으로 쉽게 딥러닝을 적용해 볼 수 있다는 것입니다! 아주 최상의 성능은 내지 못하더라도 '딥러닝을 적용하면 어떻게 되지?'라는 질문에 대해서 쉽고 빠르게 적용해 볼 수 있는 솔루션인거죠. (성능도 곧 최고의 성능에 가깝게 따라잡을 것이라고 생각합니다.)

다음 편에서는 본격적으로 TensorFlow를 한번 설치하고 시작해보겠습니다. 다음편에서 만나요~

3. http://kr.mathworks.com/help/nnet/ref/trainnetwork.html?s_eid=PSM_12879

 

 

'Deep Learning' 카테고리의 다른 글

How to Start Learning Deep Learning  (0) 2016.08.24
Deep Learning Resources‎  (0) 2016.08.24
A guide to convolution arithmetic for deep learning 한글번역  (0) 2016.08.12
Top Deep Learning Projects  (0) 2016.08.03
Deep Learning Contest  (0) 2016.08.03
Posted by uniqueone
,

https://tensorflowkorea.wordpress.com/a-guide-to-convolution-arithmetic-for-deep-learning/

 

 

 

 

 

딥 러닝을 위한 콘볼루션 계산 가이드

Vincent Dumoulin(MILA, 몬트리올 대학), Francesco Visin(AIRLab, 밀라노 공과대학)

2016년 4월 24일

 

 

감사의 말

유용한 피드백을 보내 준 David Warde-Farley, Guillaume Alain 그리고 Caglar Culcehre에게 감사합니다.

특별히 이 문서의 그림에서 사용된 색깔인 Solarized 컬러 스킴을 만든 Ethan Schoonover에게 감사드립니다.

피드백

피드백은 언제든지 환영합니다! 가능한 정확하고 상세하게 기술하려고 최선을 다했지만 혹 잘못된 점을 발견했거나 설명을 바꿀 필요가 있거나 좀 더 상세히 할 부분이 있다면 주저하지 말고 연락 주세요. 마찬가지로 이 리포트에 어울리는 뭔가가 있거나 우리와 논의할 게 있다면 연락 주세요. 최선을 다해 이 문서를 업데이트하도록 하겠습니다.

소스코드와 이미지

그림과 함께 이 문서를 만든 코드는 깃허브에 공개되어 있습니다. 그리고 이 문서에 있는 이미지의 애니메이션 버전도 있습니다.

 

목차

  1. 소개
    1. 분할 콘볼루션
    2. 풀링
  2. 콘볼루션 계산
    1. 제로 패딩 없음, 단일 스트라이드
    2. 제로 패딩, 단일 스트라이드
      1. 하프(동일) 패딩
      2. 풀 패딩
    3. 제로 패딩 없음, 다중 스트라이드
    4. 제로 패딩, 다중 스트라이드
  3. 풀링 계산
  4. 전치 콘볼루션 계산
    1. 행렬 연산으로서의 콘볼루션
    2. 전치 콘볼루션
    3. 제로 패딩 없음, 단일 스트라이드, 전치
    4. 제로 패딩, 단일 스트라이드, 전치
      1. 하프(동일) 패딩, 전치
      2. 풀 패딩, 전치
    5. 제로 패딩 없음, 다중 스트라이드, 전치
    6. 제로 패딩, 다중 스트라이드, 전치
  5. 참고문헌

 

1장. 소개

딥 콘볼루션 뉴럴 네트워크(Deep Convolutional Neural Networks, CNNs)는 딥 러닝 분야에서 일어난 놀라운 발전의 핵심입니다. CNNs은 글자 인식 문제를 풀기위해(Le Cun 외, 1997) 90년대 이미 사용되었지만 현재처럼 널리 쓰이게 된 것은 최근의 연구 결과 덕택입니다. 그리고 딥 CNN은 ImageNet 이미지 분류 시합에서 다른 경쟁자들을 이기고 우승을 차지했습니다(Krizhevsky 외, 2012)

이제 콘볼루션 뉴럴 네트워크는 머신러닝 분야애서 매우 유용한 툴이 되었습니다. 하지만 처음 CNNs을 배우는 것은 그리 쉽지만은 않습니다. 콘볼루션 레이어(layer)의 출력(output) 크기는 입력(input)의 크기와 커널(kernel) 크기의 선택, 제로 패딩(padding), 스트라이드(stride) 등에 영향을 받습니다. 이러한 요소간의 상호관계는 쉽게 짐작하기 어렵습니다. 이 부분이 출력 크기가 입력 크기와 상관이 없는 완전 연결(fully-connected) 뉴럴 네트워크와 대비되는 점입니다. 추가적으로 CNNs은 풀링(pooling)이라는 단계를 가지고 있어 완전 연결 뉴럴 네트워크에 비해 좀 더 복잡해 집니다. 마지막으로 전치 콘볼루션 레이어(또는 부분 스트라이드 콘볼루션 레이어라고 알려진)는 최근에 점점 많은 곳에서 채택되고 있고(Zeiler 외, 2011; Zeiler and Fergus, 2014; Long 외, 2015; Rad-ford 외, 2015; Visin 외, 2015; Im 외, 2016) 콘볼루션 레이어와의 관계가 여러 관점에서 설명되어 왔습니다.

(역주: 전치 콘볼루션은 초기에 디콘볼루션[deconvolution]이라고 불리웠는데 보다 명확한 의미 전달을 위해 전치 콘볼루션으로 바뀌고 있는 것으로 보입니다. 텐서플로우에도 같은 역할을 하는 conv2d_transpose 함수가 있습니다.)

이 가이드의 목적은 두가지 입니다.

  1. 콘볼루션 레이어와 전치 콘볼루션 레이어간의 관계를 설명합니다.
  2. 콘볼루션 레이어와 전치 콘볼루션 레이어에서 입력 크기, 커널 크기, 제로 패딩, 풀링, 스트라이드 그리고 출력 크기 간의 관계를 알기 쉽게 설명합니다.

폭 넓게 적용될 수 있도록 이 가이드에서 제시한 결과는 특정 구현에 종속되어 있지 않으며 대부분의 머신러닝 프레임워크, 예를 들면 씨아노(Theano. Bergstra 외, 2010; Bastien 외, 2012), 토치(Torch. Collobert 외, 2011), 텐서플로우(TensoFlow. Abadi 외, 2015), 카페(Caffe. Jia 외, 2014) 등에 적용할 수 있습니다.

이 장에서는 CNNs의 분할 콘볼루션, 풀링 같은 주요 구성 요소에 대해 간략히 살펴 보겠습니다. 이 주제에 대한 심도 깊은 자료는 딥 러닝 책(Goodfellow 외, 2016) 9장을 참고하세요.

1.1 분할 콘볼루션(Discrete convolutions)

(역주: 이 문서에서 말하는 Discrete convolution이 보통 우리가 말하는 일반적인 콘볼루션입니다. discrete란 단어가 흔히 ‘이산’으로 번역되지만 오히려 더 어렵게 느껴지는 것 같아 분할 콘볼루션이라고 적었습니다. 입력값의 축 방향을 따라 조금씩 나뉘어 콘볼루션 된다는 의미로 해석할 수 있습니다.)

뉴럴 네트워크의 기본 요소는 아핀 변환(affine transformation)입니다. 한 벡터를 입력으로 받아서 한 행렬을 곱하여 출력을 만듭니다(보통 비선형적으로 변환하기 전에 편향[bias] 벡터를 더합니다). 이미지나 사운드 클립 또는 순서가 없는 속성을 가진 데이터라면 어떠한 종류의 입력에도 적용될 수 있습니다. 그들의 차원이 어떻든 간에 변환하기 전에 하나의 벡터로 직렬화 시킬 수 있기 때문입니다.

이미지, 사운드 클립 그리고 유사한 종류의 많은 데이터들이 고유한 구조를 가지고 있습니다. 구체적으로 말하면 이런 데이터는 다음과 같은 중요한 성질을 가집니다.

  • 다차원 배열로 저장됩니다.
  • 순서가 있는 하나 이상의 축을 가집니다(예를 들면 이미지의 폭이나 높이 방향의 축, 사운드 클립의 시간축).
  • 채널이라 불리는 축은 데이터를 다른 관점으로 보는데 사용됩니다(예를 들면 컬러 이미지의 적, 녹, 청 채널이나 스테레오 오디오 트랙의 좌우 채널)

이런 성질들은 아핀 변환을 할 때 이용되지 않습니다. 사실 모든 축이 같은 방식으로 처리되므로 구조적인 정보는 고려되지 않습니다. 하지만 데이터에 내재된 구조를 이용하는 것이 컴퓨터 비전이나 음성인식 같은 분야의 문제들을 해결하는데 유리하다고 알려져 있습니다. 이런 경우엔 구조적 정보를 유지하는 것이 최선입니다. 그래서 분할 콘볼루션이 등장하게 되었습니다.

분할 콘볼루션은 순서 정보를 유지한 선형변환입니다. 이는 데이터를 부분부분 잘라 사용하고(하나의 출력 요소를 만들기 위해 몇개의 입력 요소만 사용되므로) 파라메타를 재 사용합니다(같은 가중치 값이 입력 데이터의 여러 위치에 적용되므로).

그림 1.1은 분할 콘볼루션의 예를 보여줍니다. 밝은 파랑색 격자를 입력 특성 맵(input feature map)이라고  부릅니다. 간단하게 나타내려고 하나의 특성 맵만 그렸지만 여러개의 특성 맵을 쌓아 올려져 있는 것이 일반적입니다(앞서 언급한 이미지나 사운드 클립의 채널이 좋은 예입니다). 커널(어두운 부분)이 입력 특성 맵을 슬라이딩하여 지나갑니다. 각 위치마다 커널의 원소와 오버랩되는 입력 원소가 곱해져서 그 합이 현재 위치의 출력 값이 됩니다. 이런 과정은 출력 특성 맵을 구성하는데 필요한 만큼 다른 커널을 사용하여 반복될 수 있습니다(그림 1.3). 최종 출력을 출력 특성 맵(output feature map)이라고 부릅니다(시그널 프로세싱 측면에서 보면 콘볼루션과 크로스 코릴레이션[cross-correlation] 사이에 차이가 있지만 커널을 학습시킬 때는 큰 차이가 없습니다. 심플하기도 하고 대부분의 머신러닝 자료들과 일관성을 유지하기 위해서 이 가이드에서는 콘볼루션이란 용어를 사용합니다). 여러개의 입력 특성 맵이 있는 경우엔 커널은 3차원 형태를 띠게 됩니다. 각각의 입력 특성 맵 하나가 하나의 커널에 콘볼루션 되어 계산된 특성 맵을 원소별로 더해 출력 특성 맵을 만듭니다.

conv_arithmetic_figure1-1

그림 1.1: 분할 콘볼루션의 출력값 계산

그림 1.1에 묘사된 콘볼루션은 2-D 콘볼루션의 예입니다. 하지만 이는 N-D 콘볼루션으로 일반화시킬 수 있습니다. 예를 들면 3-D 콘볼루션에서는 커널은 직육면체가 되며 입력 특성 맵의 높이, 넓이 그리고 깊이를 따라 슬라이드 하게 됩니다.

분할 콘볼루션을 정의하는 커널들은 아래 치환기호(n, m, k_1 ~ k_m)에 상응하는 크기를 가집니다.

n \equiv 출력 특성 맵의 갯수
m \equiv 입력 특성 맵의 갯수
k_j \equiv j 축 방향의 커널 크기

어떤 콘볼루션 레이어의 j 축 방향의 출력 사이즈 o_j 에 영향을 미치는 속성은 다음과 같습니다.

  • i_j : j 축 방향의 입력 사이즈
  • k_j : j 축 방향의 커널 사이즈
  • s_j : j 축 방향의 스트라이드 (커널의 연속적인 두 위치 사이의 거리)
  • p_j : j 축 방향의 제로 패딩 (축의 시작과 끝에 추가되는 0의 갯수)

예를 들어 그림 1.2는 1×1 제로 패딩된 5×5 입력에 2×2 스트라이드로 3×3 커널이 적용되는 예입니다.

conv_arithmetic_figure1-2

그림 1.2: N = 2, i_1 = i_2 = 5, k_1 = k_2 = 3, s_1 = s_2 = 2 그리고 p_1 = p_2 = 1 일 때 분할 콘볼루션의 출력값 계산

스트라이드는 서브 샘플링(subsampling)과 같은 모습을 만들어 줍니다. 스트라이드는 커널이 한번에 얼마나 많이 이동하는지로 설명하기도 하지만 출력이 얼마나 많이 남아있는지로 표현할 수도 있습니다. 예를 들면 두개씩 건너서 커널을 움직이는 것은 한칸씩 커널을 움직이되 홀수개의 출력만 취하는 것과 동일합니다(그림 1.4).

conv_arithmetic_figure1-3

그림 1.3: 3x2x3x3 커널 w를 사용한 두개의 입력 특성 맵에서 세개의 출력 특성 맵으로의 콘볼루션 매핑. 맨 왼쪽부터 입력 특성 맵 1 은 커널 w_{1,1}에 콘볼루션 되고 입력 특성 맵 2 는 커널 w_{1,2}에 콘볼루션 되어 그 계산 결과는 요소별로 더해져서 첫번째 출력 특성 맵을 만듭니다. 같은 방식으로 가운데와 오른쪽에 적용되어 두번째 세번째 특성 맵이 구성됩니다. 세개의 출력 특성 맵은 하나로 묶여져 최종 출력 값이 됩니다.

conv_arithmetic_figure1-4

그림 1.4: 스트라이드를 바라보는 다른 관점. s = 2 씩 증가하는 3×3 커널로 생각하는 대신(왼쪽), 1씩 증가하되 s = 2인 출력만 취하는 것으로 볼 수 있음(오른쪽)

1.2 풀링(Pooling)

분할 콘볼루션과 함께 풀링 연산은 CNNs의 중요한 구성요소 중 하나입니다. 풀링 연산은 평균을 내거나 최대값을 선택하는 함수를 사용하여 영역의 일부분을 압축하여 특성 맵의 크기를 줄여 줍니다.

풀링은 윈도우를 입력 값 위로 슬라이딩하면서 윈도우에 나타나는 값을 풀링 함수에 입력하는 방식으로 작동합니다. 어떤 면에서는 풀링은 분할 콘볼루션과 매우 비슷하게 작동합니다. 하지만 풀링의 다른 점은 커널과의 션형 계산을 다른 종류의 함수로 바꾼 것입니다. 그림 1.5는 평균 풀링의 예를 나타내고 그림 1.6은 맥스 풀링의 예입니다.

다음은 풀링 레이어의 j 축 방향의 출력 사이즈 o_j 에 영향을 미치는 요소입니다.

  • i_j: j 축 방향의 입력 크기
  • k_j: j 축 방향의 풀링 윈도우 크기
  • s_j: j 축 방향의 스트라이드 (연속된 풀링 윈도우 위치 간의 거리)
conv_arithmetic_figure1-5

그림 1.5: 5×5 입력에 1×1 스트라이드로 3×3 평균 풀링 연산의 출력값 계산

conv_arithmetic_figure1-6

그림 1.6: 5×5 입력에 대해 1×1 스트라이드로 3×3 맥스 풀링 연산의 출력값 계산

 

2장. 콘볼루션 계산

콘볼루션 레이어의 속성 간의 관계는 서로 다른 축끼리는 영향을 끼치지 않는다는 사실을 알면 쉽게 이해할 수 있습니다. 예를 들면 j 축 방향의 커널 크기, 제로 패딩, 스트라이드는 j 축 방향의 출력에만 영향을 미칩니다. 그렇기 때문에 이 장에서는 다음과 같이 문제를 단순화하여 진행합니다.

  • 2-D 분할 콘볼루션 (N = 2)
  • 정방형 입력 (i_1 = i_2 = i)
  • 정방형 커널 (k_1 = k_2 = k)
  • 두 축 방향으로 동일한 스트라이드 (s_1 = s_2 = s)
  • 두 축 방향으로 동일한 제로 패딩 (p_1 = p_2 = p)

이런 설정은 분석과 시각화를 쉽게 만들어 줍니다. 하지만 이 문서의 내용은 N-D 차원과 정방향이 아닌 경우로 확장할 수 있다는 것을 기억하세요.

2.1 제로 패딩 없음, 단일 스트라이드

분석하기에 가장 간단한 경우는 커널이 입력의 모든 위치를 슬라이딩할 때입니다(즉 s = 1 그리고 p = 0). 그림 2.1은 i = 4 이고 k = 3 일 때의 예입니다.(역주: 깃허브의 애니메이션 버전이 있는 경우 페이퍼의 그림 대신 사용했습니다.)

no_padding_no_strides1

그림 2.1: (패딩 없음, 단일 스트라이드) 4×4 입력에 대해 단일 스트라이드로 3×3 커널을 콘볼루션 하기 (i = 4, k = 3, s = 1 그리고 p = 0)

이 경우에 커널이 입력위에 놓일 수 있는 횟수로 출력의 크기를 정의할 수 있습니다. 폭 방향의 축을 생각해 보면 커널은 입력 특성 맵의 가장 왼쪽에서 시작해서 입력의 오른쪽 끝을 만날 때까지 한 스텝씩 지나갑니다. 출력의 크기는 커널이 이동하는 스텝 수에 초기 위치(그림 2.8a)를 반영하여 1을 더한 값입니다. 동일한 로직이 높이 방향으로도 적용됩니다.

이를 수식으로 나타내면 아래와 같이 쓸 수 있습니다.

식 1. 임의의 ik 에 대해 s = 1 그리고 p = 0 일 때,

o = (i - k) + 1

(역주: 이 식은 가장 일반화된 식 6에 p = 0, s = 1 을 대입한 것과 동일합니다)

2.2 제로 패딩, 단일 스트라이드

제로 패딩 측면에서(즉 s = 1 이라고만 가정하고) 콘볼루션 되는 실제 입력 사이즈가 어떻게 영향을 받는지 생각해 봅시다. p 개의 제로 패딩은 입력 사이즈 ii + 2p 로 바꿉니다. 일반적으로 쓰면 식 1을 사용하여 다음과 같은 식을 유도할 수 있습니다.

식 2. 임의의 i, kp 에 대해 s = 1 일 때,

o = (i - k) + 2p + 1

(역주: 이 식은 가장 일반화된 식 6에 s = 1 을 대입한 것과 동일합니다)

그림 2.2는 i = 5, k = 4, p = 2 일 때 예입니다.

arbitrary_padding_no_strides

그림 2.2: (임의의 패딩, 단일 스트라이드) 2×2 제로 패딩된 5×5 입력에 대해 단일 스트라이드로 4×4 커널을 콘볼루션하기 (즉 i = 5, k = 4, s = 1 그리고 p = 2)

실제로는 특별한 성질을 가지고 있는 제로 패딩의 전형적인 두가지 케이스가 아주 널리 사용됩니다. 이 두가지를 자세히 살펴 보겠습니다.

2.2.1 하프(half, 또는 동일) 패딩

출력 크기를 입력 크기와 동일하게(즉 o = i) 만들어야 할 때가 있습니다.

식 3. 임의의 i 에 대해 k 가 홀수(k = 2n + 1, n \in N), s = 1, p =  \lfloor \dfrac{k}{2} \rfloor = n 일 때,

o = i + 2p - k + 1 = i + 2 \lfloor \dfrac{k}{2} \rfloor - (k - 1) = i + 2n - 2n = i

(역주: 텐서플로우에서는 conv2d 함수에 스트라이드를 1 로 하고 padding 옵션에 ‘SAME’ 을 사용합니다)

이를 종종 하프(또는 동일) 패딩이라고 부릅니다. 그림 2.3은 i = 5, k = 3 그러므로 p = 1 인 예입니다.

same_padding_no_strides

그림 2.3: (하프 패딩, 단일 스트라이드) 하프 패딩된 5×5 입력에 대해 단일 스트라이드로 3×3 커널을 콘볼루션 하기 (즉 i = 5, k = 3, s = 1 그리고 p = 1)

2.2.2 풀(full) 패딩

커널을 콘볼루션 하면 보통 입력 크기 보다 출력 크기가 줄어 들지만 가끔은 그 반대의 경우가 필요할 때가 있습니다. 적절한 패딩을 넣으면 이렇게 만들 수 있습니다.

식 4. 임의의 ik 에 대해 p = k - 1, s = 1 일 때,

o = i + 2(k - 1) - (k - 1) = i + (k - 1)

이렇게 하면 커널이 입력 특성 맵에 부분적이든지 완전 겹치든지 가능한 모든 경우가 고려되기 때문에 이를 종종 풀 패딩이라고 부릅니다. 그림 2.4는 i = 5, k = 3 그러므로 p = 2 인 예입니다.

full_padding_no_strides

그림 2.4: (풀 패딩, 단일 스트라이드) 풀 패딩된 5×5 입력에 대해 단일 스트라이드로 3×3 커널을 콘볼루션하기 (즉 i = 5, k = 3, s = 1 그리고 p = 2)

2.3 제로 패딩 없음, 다중 스트라이드

이제까지 유도된 모든 식은 단일 스트라이드 콘볼루션에 대해서만 적용되는 것입니다. 다중 스트라이드를 다루기 위해서는 추가적으로 고려해야할 것이 있습니다. 분석을 쉽게 하기 위해 잠시 제로 패딩은 무시하도록 합니다(즉 s > 1 이고 p = 0). 그림 2.5는 i = 5, k = 3, s = 2 인 예입니다.

no_padding_strides

그림 2.5: (제로 패딩 없음, 임의의 스트라이드) 5×5 입력에 2×2 스트라이드로 3×3 커널을 콘볼루션 하기 (즉 i = 5, k = 3, s = 2 그리고 p = 0)

여기서도 마찬가지로 출력 사이즈는 입력 위에 커널이 놓일 수 있는 횟수로 정의할 수 있습니다. 폭 방향을 먼저 보면 커널은 입력의 왼쪽 끝 부터 시작합니다. 하지만 이번엔 s 만큼 보폭으로 입력의 오른쪽 끝까지 슬라이드 합니다. 출력 크키는 커널의 초기 위치를 반영하여 스텝 수에 1을 더한 값이 됩니다(그림 2.8b). 같은 방법으로 높이 방향 축에 적용합니다.

이것으로 부터 다음 식이 유도될 수 있습니다.

식 5. 임의의 i, k 그리고 s 에 대해 p = 0 일 때,

o = \lfloor \dfrac{i - k}{s} \rfloor + 1

(역주: 이 식은 가장 일반화된 식 6에 p = 0 을 대입한 것과 동일합니다)

내림(floor) 함수가 적용되는 것은 커널의 마지막 스텝이 입력의 끝과 맞지 않는 경우가 있기 때문입니다. 즉 일부 입력 원소는 버려지게 됩니다(그림 2.7이 이런 경우의 예입니다).

(역주: 텐서플로우에서는 conv2d 함수에 padding 옵션에 ‘VALID’ 을 사용합니다)

2.4 제로 패딩, 다중 스트라이드

가장 일반적인 케이스(제로 패딩이 된 입력에 다중 스트라이드로 콘볼루션 하는 것)를 식 2에서 했던 것 처럼 식 5에서 실제 입력 사이즈를 i + 2p 로 대체 함으로써 유도할 수 있습니다.

식 6. 임의의 i, k, p 그리고 s 에 대해,

o = \lfloor \dfrac{i + 2p - k}{s} \rfloor + 1

(역주: 텐서플로우에서는 임의의 패딩 옵션으로 콘볼루션 하려면 tf.pad 함수를 사용하여 직접 패딩을 추가한 후에 conv2d 함수를 ‘VALID’ 패딩 옵션으로 사용해야 합니다)

위에서와 같이 내림(floor) 함수는 다른 크기의 입력에 대해 콘볼루션할 때 같은 출력 크기를 만들어 낼 수 있다는 걸 의미합니다. 구체적인 예를 보면, i + 2p - ks 의 배수일 경우 입력 크기 j = i + a, a \in {0, ..., s-1} 은 같은 출력 크기를 만듭니다. 이런 동작은 s > 1 일 때만 해당됩니다.

그림 2.6은 i = 5, k = 3, s = 2 그리고 p = 1 일 때의 예를 보여주고 그림 2.7은 i = 6, k = 3, s = 2 그리고 p = 1 일 때의 예입니다. 서로 다른 입력 크기를 가지고 있음에도 같은 출력 사이즈로 콘볼루션 됩니다. 이런 현상이 콘볼루션 분석에는 영향을 미치지 않지만 전치 콘볼루션의 경우에는 분석을 복잡하게 만듭니다.

padding_strides

그림 2.6: (임의의 패딩, 임의의 스트라이드) 테두리가 1×1 크기로 제로 패딩된 5×5 입력에 2×2 스트라이드로 3×3 커널을 콘볼루션하기 (즉 i = 5, k = 3, s = 2 그리고 p = 1)

padding_strides_odd

그림 2.7: (임의의 패딩, 임의의 스트라이드) 테두리가 1×1 크기로 제로 패딩된 6×6 입력에 2×2 스트라이드로 3×3 커널을 콘볼루션 하기(즉 i = 6, k = 3, s = 2 그리고 p = 1). 이 경우 제로 패딩된 맨 아래 행과 가장 오른쪽 열은 커널에 콘볼루션되지 않습니다.

conv_arithmetic_figure2-8a

그림 2.8: 커널 위치 카운팅. (a) 이 커널은 오른쪽으로 두번 이동하면 입력의 오른쪽 끝에 다다릅니다(아래 방향도 마찬가지 입니다). 초기 커널 위치를 고려해 1을 더하면 출력은 3×3 크기가 됩니다.

conv_arithmetic_figure2-8b

그림 2.8: 커널 위치 카운팅. (b) 이 커널은 오른쪽으로 두칸씩 한번만 이동하면 입력의 오른쪽 끝에 다다릅니다(아래 방향도 마찬가지 입니다). 초기 커널 위치를 고려해 1을 더하면 출력은 2×2 크기가 됩니다.

3장. 풀링(Pooling) 계산

풀링 레이어는 뉴럴 네트워크가 입력의 작은 변화에 민감하지 않도록 만들어 줍니다. 가장 널리 사용되는 풀링은 입력을 조각으로 나누어(일반적으로 겹쳐지지 않도록) 각 조각에서 가장 큰 값을 취하는 맥스 풀링(max pooling) 입니다. 다른 종류의 풀링으로는 중간값(mean) 또는 평균값 풀링 입니다. 이들은 모두 조각안의 값들에 비선형성을 부여하는 것으로써 입력 값을 부분 부분 합친다는 동일한 아이디어를 바탕으로 합니다(Boureau 외, 2010ab, 2011; Saxe 외, 2011).

콘볼루션 계산이 어떤 함수가 입력의 부분 부분에 반복적으로 적용된다는 가정을 바탕으로 한다는 것을 눈치 챘을 지 모르겠습니다. 이 말은 앞장에서 유도한 식을 풀링 계산에서도 재 사용할 수 있다는 뜻입니다. 풀링은 제로 패딩을 가지지 않으므로 일반적인 경우의 식은 아래와 같습니다.

식 7. 임의의 i, k 그리고 s 일 때,

o = \lfloor \dfrac{1 - k}{s} \rfloor + 1

이 식은 어떤 종류의 풀링에도 적용됩니다.

4장. 전치(transposed) 콘볼루션 계산

일반적인 콘볼루션의 반대 방향으로 콘볼루션을 하고자 할 때 전치 콘볼루션이 필요합니다. 즉 어떤 콘볼루션의 출력 크기에서 연결 패턴을 유지한 채  그 콘볼루션의 입력 크기로 변환하는 것입니다. 예를 들면 콘볼루션 오토인코더(autoencoder)의 디코딩(decoding) 레이어나 특성 맵을 고차원 공간(higher-dimensional space)으로 프로젝션 시키기 위해 이런 변환을 사용할 수 있습니다.

(역주: 연결 패턴을 그대로 유지한다는 것은 입력과 출력의 원소간 대응 관계를 같게 한다는 뜻 입니다)

전치된 가중치 행렬 하나만 필요한 이 콘볼루션도 완전 연결(fully-connected)의 경우보다 더 복잡니다. 그러나 어떤 콘볼루션도 효율적인 행렬 연산으로 축약시킬 수 있으므로 완전 연결의 경우에서 얻은 통찰은 이 콘볼루션의 경우에도 유용합니다.

콘볼루션 계산처럼 전치 콘볼루션 계산에 관한 논증은 다른 축끼리는 서로 영향을 끼치지 않는다는 점을 이용해 간소화시킬 수 있습니다.

이 장에서는 아래 가정하에서 진행합니다.

  • 2-D 전치 콘볼루션 (N = 2)
  • 정방향 입력 (i_1 = i_2 = i)
  • 정방향 커널 크기 (k_1 = k_2 = k)
  • 각 축 방향으로 동일한 스트라이드 (s_1 = s_2 = s)
  • 각 축 방향으로 동일한 제로 패딩 (p_1 = p_2 = p)

여기에서도 서술된 결과는 N-D 차원과 정방형이 아닌 경우로 일반화될 수 있습니다.

4.1 행렬 연산으로 표현한 콘볼루션

그림 2.1의 콘볼루션을 예로 들어 보겠습니다. 입력과 출력의 원소를 왼쪽에서부터 오른쪽으로 그리고 위에서 아래로 벡터로 풀어 놓으면 콘볼루션은 0이 아닌 원소를 커널의 w_{ij} 원소(ij 는 각각 커널의 행과 열입니다)로 나타낸 희소(sparse) 행렬 C 로 나타낼 수 있습니다.(역주: 즉 이 행렬의 행은 커널의 한 스텝에 대응합니다)

\setcounter{MaxMatrixCols}{20} \begin{pmatrix} w_{0,0} & w_{0,1} & w_{0,2} & 0 & w_{1,0} & w_{1,1} & w_{1,2} & 0 & w_{2,0} & w_{2,1} & w_{2,2} & 0 & 0 & 0 & 0 & 0 \\ 0 & w_{0,0} & w_{0,1} & w_{0,2} & 0 & w_{1,0} & w_{1,1} & w_{1,2} & 0 & w_{2,0} & w_{2,1} & w_{2,2} & 0 & 0 & 0 & 0 \\ 0 & 0 & 0 & 0 & w_{0,0} & w_{0,1} & w_{0,2} & 0 & w_{1,0} & w_{1,1} & w_{1,2} & 0 & w_{2,0} & w_{2,1} & w_{2,2} & 0 \\ 0 & 0 & 0 & 0 & 0 & w_{0,0} & w_{0,1} & w_{0,2} & 0 & w_{1,0} & w_{1,1} & w_{1,2} & 0 & w_{2,0} & w_{2,1} & w_{2,2} \end{pmatrix}

이 선형 연산은 16차원의 벡테로 변환된 입력을 4차원의 벡터로 만들고 최종적으로 2×2 출력 행렬로 변환됩니다. (역주: [4, 16] 행렬과 [16] 벡터를 행렬곱하면 [4] 벡터가 됩니다)

이런 벡터 표현을 사용하면 역방향 계산(backward pass)은 C 의 전치 행렬을 이용하여 손쉽게 구할 수 있습니다. 다른 말로 하면, 손실(loss)에 C^T 를 곱하여 에러가 역전파되는 것이 한 예입니다. 이 연산은 4차원 벡터를 입력으로 받아 16차원 벡터를 출력으로 만들지만 연결 패턴은 C 를 사용할 때와 동일합니다.

주목할 것은 커널 w가 정방향(forward pass)과 역방향(backward pass) 계산에 사용되는 행렬 CC^T 에 모두 사용됩니다.

4.2 전치(Transposed) 콘볼루션

그림 2.1 에 나타난 콘볼루션의 연결 패턴을 유지하면서 4차원 공간을 16차원 공간에 매핑하는 데 다른 방법이 어떤 것이 있는지 알아보겠습니다. 이 연산을 전치 콘볼루션이라고 부릅니다.

전치 콘볼루션-또는 부분 스트라이드 콘볼루션으로 불리는-은 콘볼루션의 정방향과 역방향을 바꾸어 거꾸로 작동합니다. 다르게 말하면 커널이 콘볼루션을 정의하지만 직접 콘볼루션인지 전치 콘볼루션인지는 어떻게 정방향과 역방향을 계산하느냐로 결정됩니다.

예를 들면 커널 w가 각각 CC^T 를 곱하여 정방향과 역방향 콘볼루션을 정의했다면 이는 정방향과 역방향에 C^T(C^T)^T = C 를 각각 곱하는 전치 콘볼루션을 정의할 수 있습니다(실제로 전치 콘볼루션을 구현할 때 종종 사용하는 것처럼 전치 콘볼루션의 계산은 입력 값을 콘볼루션의 그래디언트로 생각할 수 있습니다).

(역주: 실제로 텐서플로우는 전치 콘볼루션을 계산할 때 직접 콘볼루션에서 사용하는 역전파 함수에 그래디언트 대신 입력 값을 넣어 사용합니다)

마지막으로 전치 콘볼루션은 직접 콘볼루션(역주: 전치가 아닌 일반 콘볼루션)으로 항상 모사할 수 있습니다. 이 방법의 단점은 입력의 여러 행과 열에 0을 추가해야 해서 불필요한 계산이 늘어납니다.

지금까지 소개한 것을 바탕으로 콘볼루션 계산을 설명한 2장에 역방향 계산을 진행하겠습니다. 같은 커널을 가진 직접 콘볼루션을 참조하면서 전치 콘볼루션의 속성을 유도하겠습니다. 그리고 전치 콘볼루션과 동등한 직접 콘볼루션을 정의합니다.

4.3 제로 패딩 없음, 단일 스트라이드, 전치

전치 콘볼루션을 가장 쉽게 생각하는 방법은 처음에 주어진 입력 크기의 직접 콘볼루션의 출력 크기를 계산하고 전치 콘볼루션을 위해 입력과 출력 크기를 반대로 바꾸는 것입니다.

패딩이 없는 4×4 입력에 단일 스트라이드로 3×3 커널을 콘볼루션하는 예를 생각해 봅시다(즉 i = 4, k = 3, s = 1 그리고 p = 0). 그림 2.1에서 보듯이 이는 2×2 출력을 만듭니다. 이 콘볼루션의 전치는 2×2 입력이 적용될 때 4×4 크기의 출력을 만들게 됩니다.

전치 콘볼루션의 결과를 얻는 또 다른 방법은 비효율적이지만 동등한 효과를 내는 직접 콘볼루션을 적용하는 것입니다. 그림 4.1에서 2×2 테두리가 제로 패딩된 2×2 입력에 단일 스트라이드로 3×3 커널을 콘볼루션하는 것으로 같은 효과를 내었습니다(즉 i' = 2, k' = k, s' = 1 그리고 p' = 2). 커널과 스트라이드의 크기는 동일하지만 전치 콘볼루션의 입력은 제로 패딩되었습니다.(이 콘볼루션은 전치 콘볼루션과 동일하지만 추가된 제로 패딩 때문에 그림에서 0을 곱하는 연산이 많이 발생합니다. 하지만 이는 일러스트의 목적을 위해서이며 실제 소프트웨어 구현에서는 0을 곱하는 연산을 수행하지 않습니다.)

no_padding_no_strides_transposed

그림 4.1: 4×4 입력에 대해 단일 스트라이드로 3×3 커널을 전치 콘볼루션하기(즉 i = 4, k = 3, s = 1 그리고 p = 0). 이는 2×2 테두리로 제로 패딩된 2×2 입력에 대해 단일 스트라이드로 3×3 커널을 콘볼루션하는 것과 동일합니다(즉 i’ = 2, k’ = k, s’ = 1 그리고 p’ = 2).

제로 패딩이 되는 원리를 이해하는 한가지 방법은 전치 콘볼루션의 연결 패턴을 고려하여 대등한 콘볼루션을 구성하도록 조정하는 것입니다. 예를 들면, 직접 콘볼루션의 왼쪽 최상단 픽셀은 출력의 왼쪽 최상단 픽셀에만 영향을 끼치고 오른쪽 최상단 픽셀은 출력의 오른쪽 최상단 픽셀과만 연결되는 식입니다.

동일한 연결 패턴을 유지한 대등한 콘볼루션을 만들려면 커널의 첫번째 스텝이 왼쪽 최상단의 픽셀에만 겹쳐지도록 입력에 제로 패딩을 넣는 것이 필요합니다. 결국 패딩은 커널 사이즈보다 하나 작은 크기가 됩니다.

같은 방식으로 진행하면서 이미지의 다른 픽셀에 대해 비슷한 관찰을 수행할 수 있고 다음식이 유도됩니다.

식 8. s = 1, p = 0 그리고 k 인 콘볼루션은 k' = k, s' = s 그리고 p' = k - 1 인 전치 콘볼루션과 연관되어 있습니다. 그리고 출력 크기는,

o' = i' + (k - 1)

흥미롭게도 이것은 단일 스트라이드 풀 패딩 콘볼루션과 동일합니다. (역주: 또한 제로 패딩 없는 단일 스트라이드 직접 콘볼루션의 식 1에서 io 가 바뀐 식입니다)

4.4 제로 패딩, 단일 스트라이드, 전치

제로 패딩이 없는 콘볼루션의 전치가 제로 패딩된 콘볼루션과 동일하다는 것을 알았으므로 제로 패딩이 있는 콘볼루션의 전치는 덜 패딩된 입력을 콘볼루션하는 것과 동일한 것이라고 추측할 수 있습니다.

이는 i = 5, k = 4 그리고 p = 2 인 그림 4.2에 나타난 것처럼 사실입니다. 수식으로 표현하면 아래 식은 제로 패딩된 콘볼루션에 적용됩니다.

식 9. s = 1, k 그리고 p 인 콘볼루션은 k' = k, s' = s 그리고 p' = k - p - 1 인 전치 콘볼루션과 연관되어 있고 이 출력의 크기는,

o' = i' + (k - 1) - 2p

(역주: 이는 식 2에서 io 가 바뀐 식입니다)

arbitrary_padding_no_strides_transposed

그림 4.2: 2×2 테두리로 제로 패딩된 5×5 입력에 대해 단일 스트라이드로 4×4 커널을 전치 콘볼루션하기(즉 i = 5, k = 4, s = 1 그리고 p = 2). 이는 1×1 테두리로 제로 패딩된 6×6 입력에 대해 단일 스트라이드로 4×4 커널을 콘볼루션하는 것과 동일합니다(즉 i’ = 6, k’ = k, s’ = 1 그리고 p’ = 1).

4.4.1 하프(동일) 패딩, 전치

이전에 했던 것과 같은 논리를 적용하면 출력의 크기가 입력의 크기와 동일한 하프 패딩 콘볼루션의 대등한 전치 콘볼루션은 하프 패딩 콘볼루션 자기 자신이 됩니다. 그러므로 다음 식이 성립됩니다.

식 10. k = 2n + 1, n \in N, s = 1 그리고 p = \lfloor \dfrac{k}{2} \rfloor = n 인 콘볼루션은 k' = k, s' = s 그리고 p' = p 인 전치 콘볼루션과 연관되어 있고 출력 사이즈는,

o' = i' + (k - 1) - 2p = i' + 2n - 2n = i'

그림 4.3은 i = 5, k = 3 그리고 p = 1 인 예입니다.

same_padding_no_strides_transposed

그림 4.3: 하프 패딩된 5×5 입력에 대해 단일 스트라이드로 3×3 커널을 전치 콘볼루션하기(즉 i = 5, k = 3, s = 1 그리고 p = 1). 이는 하프 패딩된 5×5 입력에 대해 단일 스트라이드로 3×3 커널을 콘볼루션하는 것과 동일합니다(즉 i’ = 5, k’ = k, s’ = 1 그리고 p’ = 1).

4.4.2 풀 패딩, 전치

패딩 없는 콘볼루션의 전치와 대등한 콘볼루션이 풀 패딩이므로 풀 패딩 콘볼루션의 전치와 대등한 것은 패딩 없는 콘볼루션이 되는 것이 자연스럽습니다.

식 11. s = 1, k 그리고 p = k - 1 인 콘볼루션은 k' = k, s' = s 그리고 p' = 0 인 전치 콘볼루션과 연관되어 있고 출력사이즈는,

o' = i' + (k - 1) - 2p = i - (k - 1)

(역주: 이는 식 4에서 io 가 바뀐 식입니다)

그림 4.4는 i = 5, k = 3 그러므로 p = 2 인 예입니다.

full_padding_no_strides_transposed

그림 4.4: 풀 패딩된 5×5 입력에 대해 단일 스트라이드로 3×3 커널을 전치 콘볼루션하기(즉 i = 5, k = 3, s = 1 그리고 p = 2). 이는 7×7 입력에 대해 단일 스트라이드로 3×3 커널을 콘볼루션하는 것과 동일합니다(즉 i’ = 7, k’ = k, s’ = 1 그리고 p’ = 0).

4.5 제로 패딩 없음, 다중 스트라이드, 전치

제로 패딩 콘볼루션에 적용했던 원리를 동일하게 사용하면  s > 1 인 콘볼루션의 전치는 s < 1 인 동등한 콘볼루션과 관련이 있다고 기대할 수 있습니다. 앞으로 설명하겠지만 이 직감은 맞습니다. 그래서 전치 콘볼루션을 부분 스트라이드 콘볼루션으로 부르기도 합니다.

그림 4.5는  i = 5, k = 3 그리고 s = 2 인 예로서 부분 스트라이드가 무엇인지 잘 보여줍니다. 즉 0이 입력 원소 사이에 추가되어서 커널이 단일 스트라이드일 때 보다 더 느리게 움직이게 만듭니다.(이렇게 하는 것은 비효율적이라 실제 구현에서는 불필요하게 0을 곱하는 것을 피합니다. 여기서는 개념적으로 스트라이드 콘볼루션의 전치를 보여주기 위해서 입니다.)

여기서는 이 콘볼루션이 패딩이 없는(p = 0) 콘볼루션이고 i - ks 의 배수인 i 가 입력의 크기라고 가정합니다. 이 경우 다음식이 성립됩니다.(역주: 식 5에서 내림[floor] 함수를 떼어내기 위한 가정입니다)

식 12. p = 0, k, s 그리고 i -ks 의 배수인 입력 크기(i)를 가진 콘볼루션은 \tilde{i}', k' = k, s' = 1 그리고 p' = k - 1 인 전치 콘볼루션과 연관되어 있습니다. 여기서 \tilde{i}' 는 입력의 원소 사이사이에 s - 1 의 0이 추가되어 늘어난 크기 입니다. 이 출력의 크기는,

o' = s(\tilde{i}' - 1) + k

(역주: 이는 식 5에서 내림 함수를 떼고 난 후 io 가 바뀐 식입니다)

no_padding_strides_transposed

그림 4.5: 5×5 입력에 대해 2×2 스트라이드로 3×3 커널을 전치 콘볼루션하기(즉 i = 5, k = 3, s = 2 그리고 p = 0). 이는 2×2 테두리로 제로 패딩되고 입력 원소 사이에 1개의 0이 추가된 2×2 입력에 대해 단일 스트라이드로 3×3 커널을 콘볼루션하는 것과 동일합니다(즉 i’ = 2, \tilde{i}' = 3, k’ = k, s’ = 1 그리고 p’ = 2)

4.6 제로 패딩, 다중 스트라이드, 전치

콘볼루션의 입력이 i + 2p - ks 의 배수인 i 의 크기를 가질 때 식 9와 식 12를 조합하여 제로 패딩된 경우로 확장시킬 수 있습니다.(역주: 식 6에서 내림[floor] 함수를 떼어내기 위한 가정입니다)

식 13. k, s, p 그리고 i + 2p - ks 의 배수인 i 를 가지는 콘볼루션은 \tilde{i}', k' = k, s' = 1 그리고 p' = k - p - 1 인 전치 콘볼루션과 관련이 있습니다. 여기서 \tilde{i}' 는 입력의 각 원소 사이에 s - 1 개의 0이 추가되어 늘어난 입력 크기 입니다. 이 출력의 크기는,

o' = s(\tilde{i}' - 1) + k - 2p

(역주: 이는 식 6에서 내림 함수를 떼고 난 후 io 가 바뀐 식입니다)

그림 4.6은 i = 5, k = 3, s = 2 그리고 p = 1인 예입니다.

padding_strides_transposed

그림 4.6: 1×1 테두리로 제로 패딩된 5×5 입력에 대해 2×2 스트라이드로 3×3 커널을 전치 콘볼루션하기(즉 i = 5, k = 3, s = 2 그리고 p = 1). 이는 1×1 테두리로 제로 패딩되고 입력 원소 사이에 1개의 0이 삽입된 3×3 입력에 대해 단일 스트라이드로 3×3 커널을 콘볼루션하는 것과 동일합니다(즉 i’=3, \tilde{i}' = 5, k’ = k, s’ = 1 그리고 p’ = 1).

s 가 동일할 때 같은 i' 를 만드는 입력 사이즈 i 를 추가적인 파라메타 a \in {0, ... , s-1} 로 표현을 확장할 수 있습니다.

식 14. k, s, p 인 콘볼루션은 \tilde{i}', k' = k, s' = 1 그리고 p' = k - p - 1 인 전치 콘볼루션과 관련이 있습니다. 여기서 \tilde{i}' 는 입력의 각 원소 사이에 s – 1 개의 0이 추가되어 늘어난 입력의 크기 이고 a = (i + 2p - k) mod s 는 입력의 상단과 오른쪽에 추가된 0의 갯수를 나타냅니다. 이 출력의 크기는,

o' = s(\tilde{i}' - 1) + a + k - 2p

(역주: 이는 식 6에서 내림 함수를 고려하여 io 를 바꾼 식입니다)

그림 4.7은 i = 6, k = 3, s = 2 그리고 p = 1인 예입니다.

padding_strides_odd_transposed

그림 4.7: 1×1 테두리로 제로 패딩된 6×6 입력에 대해 2×2 스트라이드로 3×3 커널을 전치 콘볼루션하기(즉 i = 6, k = 3, s = 2 그리고 p = 1). 이는 1×1 테두리와 위와 오른쪽에 하나가 추가로 제로 패딩되고 입력의 원소 사이에 1개의 0이 삽입된 3×3 입력에 대해 단일 스트라이드로 3×3 커널을 콘볼루션하는 것과 동일합니다(즉 i’ = 3, \tilde{i}' = 5, a = 1, k’ = k, s’ = 1 그리고 p’ = 1).

 

참고 문헌

'Deep Learning' 카테고리의 다른 글

How to Start Learning Deep Learning  (0) 2016.08.24
Deep Learning Resources‎  (0) 2016.08.24
Deep Learning open source - matlab  (0) 2016.08.23
Top Deep Learning Projects  (0) 2016.08.03
Deep Learning Contest  (0) 2016.08.03
Posted by uniqueone
,
https://github.com/aymericdamien/TopDeepLearning

 

 

 

Top Deep Learning Projects

A list of popular github projects related to deep learning (ranked by stars).

Last Update: 2016.05.02

Project Name Stars Description
TensorFlow 22406 Computation using data flow graphs for scalable machine learning.
Caffe 9889 Caffe: a fast open framework for deep learning.
Deep Dream 8656 Deep Dream.
Neural Style 7569 Torch implementation of neural style algorithm.
Roc AlphaGo 6876 An independent, student-led replication of DeepMind's 2016 Nature publication, "Mastering the game of Go with deep neural networks and tree search" (Nature 529, 484-489, 28 Jan 2016).
Keras 5765 Deep Learning library for Python. Convnets, recurrent neural networks, and more. Runs on Theano and TensorFlow.
Neural Doodle 5499 Turn your two-bit doodles into fine artworks with deep neural networks, generate seamless textures from photos, transfer style from one image to another, perform example-based upscaling, but wait... there's more! (An implementation of Semantic Style Transfer.)
CNTK 5286 Computational Network Toolkit (CNTK).
ConvNet JS 4640 Deep Learning in Javascript. Train Convolutional Neural Networks (or ordinary ones) in your browser.
Torch 4437 Torch7, Deep Learning Library.
OpenFace 4334 Face recognition with deep neural networks.
Nupic 4067 Numenta Platform for Intelligent Computing: a brain-inspired machine intelligence platform, and biologically accurate neural network based on cortical learning algorithms.
Leaf 3940 Open Machine Intelligence Framework for Hackers.
Theano 3600 Theano is a Python library that allows you to define, optimize, and evaluate mathematical expressions involving multi-dimensional arrays efficiently. It can use GPUs and perform efficient symbolic differentiation.
Neural Talk 3521 NeuralTalk is a Python+numpy project for learning Multimodal Recurrent Neural Networks that describe images with sentences.
MXNet 3513 Lightweight, Portable, Flexible Distributed/Mobile Deep Learning with Dynamic, Mutation-aware Dataflow Dep Scheduler; for Python, R, Julia, Scala, Go, Javascript and more.
Char RNN 3077 Multi-layer Recurrent Neural Networks (LSTM, GRU, RNN) for character-level language models in Torch.
deeplearning4j 2570 Deep Learning for Java, Scala & Clojure on Hadoop, Spark.
TensorFlow Playground 2518 Play with neural networks!
TFLearn 2502 Deep learning library featuring a higher-level API for TensorFlow.
Image Analogies 2412 Generate image analogies using neural matching and blending.
Colornet 2385 Neural Network to colorize grayscale images.
SKFlow 2293 Simplified interface for TensorFlow (mimicking Scikit Learn) for Deep Learning.
Neural Talk 2 2223 Efficient Image Captioning code in Torch, runs on GPU.
PyLearn2 2060 A Machine Learning library based on Theano.
TensorFlow Tutorials 2027 From the basics to slightly more interesting applications of Tensorflow.
Lasagne 2013 Lightweight library to build and train neural networks in Theano.
TensorFlow Examples 1961 TensorFlow tutorials and code examples for beginners.
LISA-lab Deep Learning Tutorials 1882 Deep Learning Tutorial notes and code. See the wiki for more info.
Matlab Deep Learning Toolbox 1869 Matlab/Octave toolbox for deep learning. Includes Deep Belief Nets, Stacked Autoencoders, Convolutional Neural Nets, Convolutional Autoencoders and vanilla Neural Nets. Each method has examples to get you started.
Neon 1790 Fast, scalable, easy-to-use Python based Deep Learning Framework by Nervana™.
OpenAI Gym 1490 A toolkit for developing and comparing reinforcement learning algorithms.
Deep Learning Flappy Bird 1473 Flappy Bird hack using Deep Reinforcement Learning (Deep Q-learning).
Neural Story Teller 1373 A recurrent neural network for generating little stories about images.
Chainer 1339 A flexible framework of neural networks for deep learning.
Brainstorm 1089 Fast, flexible and fun neural networks.
DIGITS 1075 Deep Learning GPU Training System.
Deep Jazz 1002 Deep learning driven jazz generation using Keras & Theano!
Theano Tutorials 811 Bare bones introduction to machine learning from linear regression to convolutional neural networks using Theano.
Scikit Neural Net 800 Deep neural networks without the learning cliff! Classifiers and regressors compatible with scikit-learn.
RNN Music Composition 797 A recurrent neural network designed to generate classical music.
Blocks 773 A Theano framework for building and training neural networks.
TDB 765 Interactive, node-by-node debugging and visualization for TensorFlow.
Veles 733 Distributed machine learning platform (Python, CUDA, OpenCL)
Nolearn 640 Abstractions around neural net libraries, most notably Lasagne.
Caffe on Spark 599 Caffe On Spark.
Deep Detect 543 Deep Learning API and Server in C++11 with Python bindings and support for Caffe.
TensorFlow DeepQ 583 A deep Q learning demonstration using Google Tensorflow.
DeepCL 370 OpenCL library to train deep convolutional neural networks.

 

Posted by uniqueone
,

Posted by uniqueone
,