딥러닝 프레임워크의 대표적인 기능으로는 '자동미분'과 'GPU의 활용' 등을 들 수 있다. 본 논문은 파이썬의 라이브러리 형태로 사용 가능한 프레임워크 중에서 구글의 텐서플로와 마이크로소프트의 CNTK, 그리고 텐서플로의 원조라고 할 수 있는 티아노를 비교하였다. 본문에서는 자동미분의 개념과 GPU의 활용형태를 간단히 설명하고, 그 다음에 logistic regression을 실행하는 예를 통하여 각 프레임워크의 문법을 알아본 뒤에, 마지막으로 대표적인 딥러닝 응용인 CNN의 예제를 실행시켜보고 코딩의 편의성과 실행속도 등을 확인해 보았다. 그 결과, 편의성의 관점에서 보면 티아노가 가장 코딩 하기가 어렵고, CNTK와 텐서플로는 많은 부분이 비슷하게 추상화 되어 있어서 코딩이 비슷하지만 가중치와 편향을 직접 정의하느냐의 여부에서 차이를 보였다. 그리고 각 프레임워크의 실행속도에 대한 평가는 '큰 차이는 없다'는 것이다. 텐서플로는 티아노에 비하여 속도가 느리다는 평가가 있어왔는데, 본 연구의 실험에 의하면, 비록 CNN 모형에 국한되었지만, 텐서플로가 아주 조금이지만 빠른 것으로 나타났다. CNTK의 경우에도, 비록 실험환경이 달랐지만, 실험환경의 차이에 의한 속도의 차이의 편차범위 이내에 있는 것으로 판단이 되었다. 본 연구에서는 세 종류의 딥러닝 프레임워크만을 살펴보았는데, 위키피디아에 따르면 딥러닝 프레임워크의 종류는 12가지가 있으며, 각 프레임워크의 특징을 15가지 속성으로 구분하여 차이를 특정하고 있다. 그 많은 속성 중에서 사용자의 입장에서 볼 때 중요한 속성은 어떤 언어(파이썬, C++, Java, 등)로 사용가능한지, 어떤 딥러닝 모형에 대한 라이브러리가 잘 구현되어 있는지 등일 것이다. 그리고 사용자가 대규모의 딥러닝 모형을 구축한다면, 다중 GPU 혹은 다중 서버를 지원하는지의 여부도 중요할 것이다. 또한 딥러닝 모형을 처음 학습하는 경우에는 사용설명서가 많은지 예제 프로그램이 많은지 여부도 중요한 기준이 될 것이다.
딥러닝 프레임워크의 대표적인 기능으로는 '자동미분'과 'GPU의 활용' 등을 들 수 있다. 본 논문은 파이썬의 라이브러리 형태로 사용 가능한 프레임워크 중에서 구글의 텐서플로와 마이크로소프트의 CNTK, 그리고 텐서플로의 원조라고 할 수 있는 티아노를 비교하였다. 본문에서는 자동미분의 개념과 GPU의 활용형태를 간단히 설명하고, 그 다음에 logistic regression을 실행하는 예를 통하여 각 프레임워크의 문법을 알아본 뒤에, 마지막으로 대표적인 딥러닝 응용인 CNN의 예제를 실행시켜보고 코딩의 편의성과 실행속도 등을 확인해 보았다. 그 결과, 편의성의 관점에서 보면 티아노가 가장 코딩 하기가 어렵고, CNTK와 텐서플로는 많은 부분이 비슷하게 추상화 되어 있어서 코딩이 비슷하지만 가중치와 편향을 직접 정의하느냐의 여부에서 차이를 보였다. 그리고 각 프레임워크의 실행속도에 대한 평가는 '큰 차이는 없다'는 것이다. 텐서플로는 티아노에 비하여 속도가 느리다는 평가가 있어왔는데, 본 연구의 실험에 의하면, 비록 CNN 모형에 국한되었지만, 텐서플로가 아주 조금이지만 빠른 것으로 나타났다. CNTK의 경우에도, 비록 실험환경이 달랐지만, 실험환경의 차이에 의한 속도의 차이의 편차범위 이내에 있는 것으로 판단이 되었다. 본 연구에서는 세 종류의 딥러닝 프레임워크만을 살펴보았는데, 위키피디아에 따르면 딥러닝 프레임워크의 종류는 12가지가 있으며, 각 프레임워크의 특징을 15가지 속성으로 구분하여 차이를 특정하고 있다. 그 많은 속성 중에서 사용자의 입장에서 볼 때 중요한 속성은 어떤 언어(파이썬, C++, Java, 등)로 사용가능한지, 어떤 딥러닝 모형에 대한 라이브러리가 잘 구현되어 있는지 등일 것이다. 그리고 사용자가 대규모의 딥러닝 모형을 구축한다면, 다중 GPU 혹은 다중 서버를 지원하는지의 여부도 중요할 것이다. 또한 딥러닝 모형을 처음 학습하는 경우에는 사용설명서가 많은지 예제 프로그램이 많은지 여부도 중요한 기준이 될 것이다.
The deep learning framework is software designed to help develop deep learning models. Some of its important functions include "automatic differentiation" and "utilization of GPU". The list of popular deep learning framework includes Caffe (BVLC) and Theano (University of Montreal). And recently, Mi...
The deep learning framework is software designed to help develop deep learning models. Some of its important functions include "automatic differentiation" and "utilization of GPU". The list of popular deep learning framework includes Caffe (BVLC) and Theano (University of Montreal). And recently, Microsoft's deep learning framework, Microsoft Cognitive Toolkit, was released as open-source license, following Google's Tensorflow a year earlier. The early deep learning frameworks have been developed mainly for research at universities. Beginning with the inception of Tensorflow, however, it seems that companies such as Microsoft and Facebook have started to join the competition of framework development. Given the trend, Google and other companies are expected to continue investing in the deep learning framework to bring forward the initiative in the artificial intelligence business. From this point of view, we think it is a good time to compare some of deep learning frameworks. So we compare three deep learning frameworks which can be used as a Python library. Those are Google's Tensorflow, Microsoft's CNTK, and Theano which is sort of a predecessor of the preceding two. The most common and important function of deep learning frameworks is the ability to perform automatic differentiation. Basically all the mathematical expressions of deep learning models can be represented as computational graphs, which consist of nodes and edges. Partial derivatives on each edge of a computational graph can then be obtained. With the partial derivatives, we can let software compute differentiation of any node with respect to any variable by utilizing chain rule of Calculus. First of all, the convenience of coding is in the order of CNTK, Tensorflow, and Theano. The criterion is simply based on the lengths of the codes and the learning curve and the ease of coding are not the main concern. According to the criteria, Theano was the most difficult to implement with, and CNTK and Tensorflow were somewhat easier. With Tensorflow, we need to define weight variables and biases explicitly. The reason that CNTK and Tensorflow are easier to implement with is that those frameworks provide us with more abstraction than Theano. We, however, need to mention that low-level coding is not always bad. It gives us flexibility of coding. With the low-level coding such as in Theano, we can implement and test any new deep learning models or any new search methods that we can think of. The assessment of the execution speed of each framework is that there is not meaningful difference. According to the experiment, execution speeds of Theano and Tensorflow are very similar, although the experiment was limited to a CNN model. In the case of CNTK, the experimental environment was not maintained as the same. The code written in CNTK has to be run in PC environment without GPU where codes execute as much as 50 times slower than with GPU. But we concluded that the difference of execution speed was within the range of variation caused by the different hardware setup. In this study, we compared three types of deep learning framework: Theano, Tensorflow, and CNTK. According to Wikipedia, there are 12 available deep learning frameworks. And 15 different attributes differentiate each framework. Some of the important attributes would include interface language (Python, C ++, Java, etc.) and the availability of libraries on various deep learning models such as CNN, RNN, DBN, and etc. And if a user implements a large scale deep learning model, it will also be important to support multiple GPU or multiple servers. Also, if you are learning the deep learning model, it would also be important if there are enough examples and references.
The deep learning framework is software designed to help develop deep learning models. Some of its important functions include "automatic differentiation" and "utilization of GPU". The list of popular deep learning framework includes Caffe (BVLC) and Theano (University of Montreal). And recently, Microsoft's deep learning framework, Microsoft Cognitive Toolkit, was released as open-source license, following Google's Tensorflow a year earlier. The early deep learning frameworks have been developed mainly for research at universities. Beginning with the inception of Tensorflow, however, it seems that companies such as Microsoft and Facebook have started to join the competition of framework development. Given the trend, Google and other companies are expected to continue investing in the deep learning framework to bring forward the initiative in the artificial intelligence business. From this point of view, we think it is a good time to compare some of deep learning frameworks. So we compare three deep learning frameworks which can be used as a Python library. Those are Google's Tensorflow, Microsoft's CNTK, and Theano which is sort of a predecessor of the preceding two. The most common and important function of deep learning frameworks is the ability to perform automatic differentiation. Basically all the mathematical expressions of deep learning models can be represented as computational graphs, which consist of nodes and edges. Partial derivatives on each edge of a computational graph can then be obtained. With the partial derivatives, we can let software compute differentiation of any node with respect to any variable by utilizing chain rule of Calculus. First of all, the convenience of coding is in the order of CNTK, Tensorflow, and Theano. The criterion is simply based on the lengths of the codes and the learning curve and the ease of coding are not the main concern. According to the criteria, Theano was the most difficult to implement with, and CNTK and Tensorflow were somewhat easier. With Tensorflow, we need to define weight variables and biases explicitly. The reason that CNTK and Tensorflow are easier to implement with is that those frameworks provide us with more abstraction than Theano. We, however, need to mention that low-level coding is not always bad. It gives us flexibility of coding. With the low-level coding such as in Theano, we can implement and test any new deep learning models or any new search methods that we can think of. The assessment of the execution speed of each framework is that there is not meaningful difference. According to the experiment, execution speeds of Theano and Tensorflow are very similar, although the experiment was limited to a CNN model. In the case of CNTK, the experimental environment was not maintained as the same. The code written in CNTK has to be run in PC environment without GPU where codes execute as much as 50 times slower than with GPU. But we concluded that the difference of execution speed was within the range of variation caused by the different hardware setup. In this study, we compared three types of deep learning framework: Theano, Tensorflow, and CNTK. According to Wikipedia, there are 12 available deep learning frameworks. And 15 different attributes differentiate each framework. Some of the important attributes would include interface language (Python, C ++, Java, etc.) and the availability of libraries on various deep learning models such as CNN, RNN, DBN, and etc. And if a user implements a large scale deep learning model, it will also be important to support multiple GPU or multiple servers. Also, if you are learning the deep learning model, it would also be important if there are enough examples and references.
* AI 자동 식별 결과로 적합하지 않은 문장이 있을 수 있으니, 이용에 유의하시기 바랍니다.
문제 정의
이 절에서는 앞에서 설명한 세가지 프레임워크를 CNN(convolutional neural networks, 합성곱 신경망)을 구현하는데 사용하여 비교해 보고자 한다. 실험을 위해 사용한 데이터는 CIFAR-10이라고 이름 지어진 것으로서 10개의 물체(비행기, 자동차 등)에 대하여 각 6000개씩 총 6만개의 32× 32크기의 컬러이미지로 구성된 데이터이다 (H7).
이러한 시점에서 본 논문은 파이썬의 라이브러리 형태로 사용 가능한 프레임워크 중에서 구글의 텐서플로와 마이크로소프트의 CNTK, 그리고 텐서플로의 원조라고 할 수 있는 티아노를 비교해 보려고 한다. 그를 위하여 다음 절에서는 각 프레임워크의 특징과 문법을 간단히 설명하고, 그 다음에 대표적인 딥러닝 응용인 CNN의예제를 실행시켜보고 코딩의 편의성과 실행속도 등을 확인해 보겠다.
제안 방법
이러한 시점에서 본 논문은 파이썬의 라이브러리 형태로 사용 가능한 프레임워크 중에서 구글의 텐서플로와 마이크로소프트의 CNTK, 그리고 텐서플로의 원조라고 할 수 있는 티아노를 비교해 보려고 한다. 그를 위하여 다음 절에서는 각 프레임워크의 특징과 문법을 간단히 설명하고, 그 다음에 대표적인 딥러닝 응용인 CNN의예제를 실행시켜보고 코딩의 편의성과 실행속도 등을 확인해 보겠다.
지금까지 딥러닝 프레임워크의 주요 기능을 살펴보고 또 세 종류의 프레임워크에 대하여 간단한 예제를 통하여 문법적인 특징을 살펴보고 추가로 CIFAR-10데이터에 CNN모형을 적용한 실험을 통하여 그 결과를 확인해 보았다. CIFAR-10데이터에 대한 실험을 통하여 각 프레 임워크에 대한 코딩의 편의성과 실행속도에 대한 요약을 하자면 다음과 같다.
대상 데이터
논문 작성시점에 LINUX CentOS환경에서 설치하기 어려운 제약으로 인하여 CNTK코드의 실험은 윈도우 7 PC(Intel core i7-2637M @1.7GHz) 에 설치된 CNTK V2.0 Beta 7 Release에서 수행되었다. GPU가 설치되지 않은 환경이기 때문에 200 epoch를 실행한 결과 연산시간은 15시간 30분정도 걸렸으며, 확인용 데이터의 인식률은 65.
실험을 위해 사용한 데이터는 CIFAR-10이라고 이름 지어진 것으로서 10개의 물체(비행기, 자동차 등)에 대하여 각 6000개씩 총 6만개의 32× 32크기의 컬러이미지로 구성된 데이터이다 (H7).
이론/모형
2011년 부터 구글 브레인 팀은 첫 머신러닝 시스템으로 DistBelief를 만들었다. 구글에 있는 50개가 넘는 팀과 모회사 알파벳에서 검색, 음성검색, 광고, 구글 포토, 구글 맵스, 스트리트뷰, 번역, 유투브 등과 같은 실제 서비스에 DistBelief의 딥러닝모형이 적용되었다. 텐서플로는 2015년에 오픈 소스로 공개된 구글 브레인 팀의 두 번째 머신 러닝 시스템이다.
합성 곱의 필터규격은 5 × 5, 진행간격(stride)은 1, max-pooling은 2 × 2크기에 진행간격은 2로 지정 하였다. 그리고 모든 계층의 활성화함수는 ReLU 를 사용하였다.
본 논문에서는 높은 인식률을 목표로 하는 것이 아니므로 [Figure 8]과 같은 비교적 단순한 형태의 CNN모형을 사용하였다. [Figure 8]에 있는 모형에는 두 개의 합성곱계층이 있고 max-pooling 을 한다.
[Figure 3]에서는 직접 연결되어 있는 노드에 대한 편도함수만 있다. 직접 연결되어 있지 않은 변수에 대한 편도함수는 연쇄법칙을 이용하여 계산할 수 있다. 예를 들어, e의 a에 대한 편도함수는 연쇄법칙에 의하여 다음과 같다.
성능/효과
0 Beta 7 Release에서 수행되었다. GPU가 설치되지 않은 환경이기 때문에 200 epoch를 실행한 결과 연산시간은 15시간 30분정도 걸렸으며, 확인용 데이터의 인식률은 65.6%로 측정되었다. 속도에 있어서 LINUX+GPU환경에서 텐서플로의 경우와 비교 하면 50배 가까이 차이가 나는 것이므로 꽤 많은 차이라 할 수 있다.
그 판단 기준은 각 프레임워크에서 제공하는 라이브러리의 직관성이나 학습의 용이성이 아닌 단순히 코딩의 길이에 따른 것임을 밝혀둔다. 그 기준에 따르면 티아노가 가장 코딩 하기가 어렵고, CNTK 와 텐서플로는 많은 부분이 비슷하게 추상화되어 있어서 코딩이 비슷하지만 가중치와 편향을 직접 정의하느냐의 여부에서 차이를 보였다. 한편 추상화된 라이브러리가 많다는 것은 동전의 양면과 같은 것이라서, 코딩의 편의성은 제공한다는 장점은 있지만 코딩의 유연성은 제공하지 못한다는 단점이 동시에 존재한다.
0버전을 사용하여 한 실험도 그렇게 보고하였다. 그런데 본 연구의 실험에 의하면, 비록 CNN 모형에 국한되었지만, 텐서플로가 아주 조금이지만 빠른 것으로 나타났다. 본 연구에서 사용한 텐서플로(0.
그런데 본 연구의 실험에 의하면, 비록 CNN 모형에 국한되었지만, 텐서플로가 아주 조금이지만 빠른 것으로 나타났다. 본 연구에서 사용한 텐서플로(0.11버전)에서는 속도가 많이 향상된 것으로 보인다. 그리고 CNTK의 경우에도, 비록 실험환경이 달랐지만, 실험환경의 차이에 의한 속도의 차이의 편차범위 이내에 있는 것으로 판단이 되었다.
[Figure 9]는 CNN모형을 정의하고 SGD를 실행하는 과정이다. 코드를 보면 합성곱계층 (ConvPoolLayer) 2개와 일반 신경망계층 (FullyConnectedLayer)이 두 개 그리고 출력계층 (SoftmaxLayer) 한 개가 순차적으로 연결되어 있음을 쉽게 확인할 수 있다. [Figure 9]를 보면 티아노의 코딩이 간결해 보이지만 실제로 Network 클래스(가중치와 편향을 정의하고 학습하는 방법 등)를 직접 구현해야 한다는 번거로움이 있다.
11)를 설치하여 수행되었다. 티아노와 마찬가지로 200 epoch를 실행한 결과 연산시간은 20분 걸렸으며, 확인용 데이터의 인식률은 69.08% 로 측정되었다. 티아노의 경우와 비교해서 인식률이 낮은 이유는 텐서플로의 경우는 최고 인식률이 아니라 학습을 마친 뒤에 측정된 값이기 때문이다.
후속연구
티아노의 경우에는 오류함수와 학습과정에 대하여 편도함수의 계산을 제외하고 세부적으로 코딩을 다 해주는 반면에 텐서플로는 더 많은 부분이 추상화되어 있다. 13~14번 라인에서 보듯이 AdamOptimizer와 minimize함수를 사용하여 오류함수를 최소화하고 있는데, 이렇게 함으로써 티아노보다 모형의 구축을 좀더 빨리 할 수있을 것으로 기대된다.
그 많은 속성 중에서 사용자의 입장에서 볼 때 중요한 속성은 어떤 언어 (파이썬, C++, Java, 등)로 사용가능한지, 어떤 딥러닝 모형에 대한 라이브러리가 잘 구현되어 있는지 등일 것이다. 그리고 사용자가 대규모의 딥러닝 모형을 구축한다면, 다중 GPU 혹은 다중 서버를 지원하는지의 여부도 중요할 것이다. 또한 딥러닝 모형을 처음 학습하는 경우에는 사용 설명서가 많은지 예제 프로그램이 많은지 여부도 중요한 기준이 될 것이다.
질의응답
핵심어
질문
논문에서 추출한 답변
딥러닝 프레임워크란?
딥러닝 프레임워크는 딥러닝 모형을 쉽고 빠르게 개발할 수 있도록 도움을 주는 소프트웨어로서 대표적인 기능으로 ‘자동미분’과 ‘GPU의활용’ 등을 들 수 있다. 대학에서 개발되어 사용되어 왔던 딥러닝 프레임워크로서는 버클리 대학의 ‘카페(Caffe)’, 몬트리올 대학의 ‘티아노 (Theano)’이다.
TensorFlow는 티아노와 비교했을 때 어떤 장점을 가지는가?
텐서플로는 연산그래프를 이용하고 자동미분 기능이 있으며, 또 파이썬 라이브러리의 형태로그 문법이 티아노를 대체하기 위하여 개발되었다는 말이 있을 정도로 티아노와 상당히 유사하다. 텐서플로가 티아노와 비교해서 장점은 분산 컴퓨팅이 가능하다는 점과 좀더 추상화된 함수를 제공하여 코딩이 빠르다는 점이다. [Figure 6]에 있는 예를 들어서 설명을 해보겠다.
딥러닝 프레임워크의 대표적 기능은 무엇인가?
딥러닝 프레임워크의 대표적인 기능으로는 '자동미분'과 'GPU의 활용' 등을 들 수 있다. 본 논문은 파이썬의 라이브러리 형태로 사용 가능한 프레임워크 중에서 구글의 텐서플로와 마이크로소프트의 CNTK, 그리고 텐서플로의 원조라고 할 수 있는 티아노를 비교하였다.
참고문헌 (4)
Bahrampour, S., N. Ramakrishnan, L. Schott, and M. Shah, "Comparative Study of Deep Learning Software Frameworks," arXiv:1511.06435v3 (2016)
Bergstra, J., O. Breuleux, F. Bastien, P. Lamblin, R. Pascanu, G. Desjardins, J. Turian, D. Warde-Farley and Y. Bengio, "Theano: A CPU and GPU Math Expression Compiler," Proceedings of the Python for Scientific Computing Conference (SciPy) 2010. June 30 - July 3, Austin, TX
Goodfellow, I., Y. Bengio, and A. Courville, Deep Learning, MIT Press. 2016
Yu, D., A. Eversole, M. Seltzer, K. Yao, O. Kuchaiev, Y. Zhang, F. Seide, Z. Huang, B. Guenter, H. Wang, J. Droppo, G. Zweig, C. Rossbach, J. Gao, A. Stolcke, J. Currey, M. Slaney, G. Chen, A. Agarwal, C. Basoglu, M. Padmilac, A. Kamenev, V. Ivanov, S. Cypher, H. Parthasarathi, B. Mitra, B. Peng, and X. Huang, "An Introduction to Computational Networks and the Computational Network Toolkit," Microsoft Research, October 1, 2014
※ AI-Helper는 부적절한 답변을 할 수 있습니다.