SlideShare a Scribd company logo
1 of 19
Download to read offline
MNIST, tensorboard
안성현
1
MNIST
• MNIST는 간단한 컴퓨터 비전 데이터셋
• train-images-idx3-ubyte.gz: training set images (9912422 bytes)
train-labels-idx1-ubyte.gz: training set labels (28881 bytes)
t10k-images-idx3-ubyte.gz: test set images (1648877 bytes)
t10k-labels-idx1-ubyte.gz: test set labels (4542 bytes
2
MNIST Images
• 파일이 아님.
• 하나의 이미지를 784개의 데이터로 표현
3
MNIST Label
• 글자 이미지가 실제 어떤 글자인지를 나타낸다.
• [0, 0, 0, 0, 0, 0, 0, 0, 0, 0] => 각 인덱스가 숫자를 나타냄
• 1 = [0, 1, 0, 0, 0, 0, 0, 0, 0, 0] , 9 = [0, 0, 0, 0, 0, 0, 0, 0, 0, 1]
4
Tensorflow 설치하기
-pip install --upgrade tensorflow
-소스빌드해서 설치가능
5
MNIST Tensorflow 에서 불러오기
from tensorflow.examples.tutorials.mnist import input_data
mnist = input_data.read_data_sets("MNIST_data/")
6
MNIST Tensorflow 에서 불러오기
# -*- coding:utf-8 -*-
from tensorflow.examples.tutorials.mnist import input_data
mnist = input_data.read_data_sets("MNIST_data/", one_hot=True)
for key in ['train', 'test', 'validation']:
print("mnist.%s :" % key)
minst_dataset= getattr(mnist, key)
print("tnum_examples : %d" % minst_dataset.num_examples)
print("timages count : %d" % len(minst_dataset.images))
print("tlabels count : %d" % len(minst_dataset.labels))
print("timages[0] len : %d" % len(minst_dataset.images[0]))
print("tlabels[0] len : %d" % len(minst_dataset.labels[0]))
print("tlabels[0] : %s" % str(minst_dataset.labels[0]))
7
MNIST Tensorflow 에서 불러오기
from tensorflow.examples.tutorials.mnist import input_data
mnist = input_data.read_data_sets("MNIST_data/", one_hot=True)
for key in ['train', 'test', 'validation']:
print("mnist.%s :" % key)
minst_dataset= getattr(mnist, key)
print("tnum_examples : %d" % minst_dataset.num_examples)
print("timages count : %d" % len(minst_dataset.images))
print("tlabels count : %d" % len(minst_dataset.labels))
print("timages[0] len : %d" % len(minst_dataset.images[0]))
print("tlabels[0] len : %d" % len(minst_dataset.labels[0]))
8
urllib.error.URLError: <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:7)
0SX) Python3.x SSL Error
9
tensorBoard 띄우기
Usage : tensorboard --help
$ usage: tensorboard [-h]
[--logdir LOGDIR]
[--debug DEBUG]
[--nodebug]
[--host HOST]
[--port PORT]
10
tensorboard 띄우기
$ tensorboard --logdir=log
$ TensorBoard b'54' at http://anui-MacBook-Pro.local:6006
- http://127.0.0.1:6006 접속
$ tensorboard --logdir=log --host 0.0.0.0 --port 6006
- 외부에서 접속가능
11
CNN 구성
https://hunkim.github.io/ml/
12
CNN 구성
# L1 ImgIn shape=(?, 28, 28, 1)
# 필터의 크기 3X3, 32개의 필터
W1 = tf.Variable(tf.random_normal([3, 3, 1, 32], stddev=0.01))
# Conv -> (?, 28, 28, 32)
# Pool -> (?, 14, 14, 32)
# 이동거리 1
L1 = tf.nn.conv2d(X_img, W1, strides=[1, 1, 1, 1], padding='SAME')
L1 = tf.nn.relu(L1)
L1 = tf.nn.max_pool(L1, ksize=[1, 2, 2, 1],
strides=[1, 2, 2, 1], padding='SAME')
'''
Tensor("Conv2D:0", shape=(?, 28, 28, 32), dtype=float32)
Tensor("Relu:0", shape=(?, 28, 28, 32), dtype=float32)
Tensor("MaxPool:0", shape=(?, 14, 14, 32), dtype=float32)
'''
13
CNN 구성
# L2 ImgIn shape=(?, 14, 14, 32)
W2 = tf.Variable(tf.random_normal([3, 3, 32, 64], stddev=0.01))
# Conv ->(?, 14, 14, 64)
# Pool ->(?, 7, 7, 64)
L2 = tf.nn.conv2d(L1, W2, strides=[1, 1, 1, 1], padding='SAME')
L2 = tf.nn.relu(L2)
L2 = tf.nn.max_pool(L2, ksize=[1, 2, 2, 1],
strides=[1, 2, 2, 1], padding='SAME')
L2_flat = tf.reshape(L2, [-1, 7 * 7 * 64])
W3 = tf.get_variable("W3", shape=[7 * 7 * 64, 10],
initializer=tf.contrib.layers.xavier_initializer())
b = tf.Variable(tf.random_normal([10]), name='b')
logits = tf.matmul(L2_flat, W3) + b
cost = tf.reduce_mean(tf.nn.softmax_cross_entropy_with_logits(logits=logits, labels=Y))
optimizer = tf.train.GradientDescentOptimizer(learning_rate=0.1).minimize(cost)
14
CNN-MNIST 결과 tensorboard 연결하기
saver 를 이용해서 model 을 --logdir path 에 저장
15
CNN-MNIST 결과 tensorboard 연결하기
• Data Point <= Label, Images
• metadata file
• Label : .tsv 파일
• Images : 단일 sprite image, 8192 X 8192 까지 지원
• projector_config.pbtxt
• API 를 이용해서 생성
16
embedding = tf.Variable(tf.zeros([1024, 10]), name="test_embedding")
assignment = embedding.assign(logits)
saver = tf.train.Saver()
sess.run(tf.global_variables_initializer())
writer = tf.summary.FileWriter(LOGDIR + "/embedding")
writer.add_graph(sess.graph)
config = tf.contrib.tensorboard.plugins.projector.ProjectorConfig()
embedding_config = config.embeddings.add()
embedding_config.tensor_name = embedding.name
embedding_config.metadata_path = LOGDIR + 'labels_1024.tsv‘ # 메타데이터 지정
embedding_config.sprite.image_path = LOGDIR + 'sprite_1024.png‘ # sprite 이미지 파일 지정
embedding_config.sprite.single_image_dim.extend([28, 28]) # 이미지 사이즈 지정
tf.contrib.tensorboard.plugins.projector.visualize_embeddings(writer, config)
if i % 500 == 0:
sess.run(assignment, feed_dict={X: mnist.test.images[:1024], Y: mnist.test.labels[:1024]})
saver.save(sess, os.path.join(LOGDIR, "model.ckpt"), i) 17
생성 : projector_config.pbtxt
CNN-MNIST 결과 tensorboard 연결하기
• https://github.com/jireh-father/tensorboard-embedding-visualization
18
Reference
• https://tensorflowkorea.gitbooks.io/tensorflow-kr/content/g3doc/tutorials/mnist/beginners/
• http://bcho.tistory.com/1154
• https://www.google.co.kr/search?q=image+to+mnist+format&oq=image+to+mnisr+&aqs=chrome.1.69i57j0l2.6888j0j4&sourceid=chrom
e&ie=UTF-8
• http://goodtogreate.tistory.com/entry/Hands-on-TensorBoard-TensorFlow-Dev-Summit2017
• 모두의 딥러닝 : https://hunkim.github.io/ml/
• http://sanghyukchun.github.io/75/
• http://yujuwon.tistory.com/entry/TENSORFLOWCNN2
• http://yujuwon.tistory.com/entry/TENSORFLOW-Image-AutoEncoder
19

More Related Content

What's hot

Behind the Performance of Quake 3 Engine: Fast Inverse Square Root
Behind the Performance of Quake 3 Engine: Fast Inverse Square RootBehind the Performance of Quake 3 Engine: Fast Inverse Square Root
Behind the Performance of Quake 3 Engine: Fast Inverse Square RootMaksym Zavershynskyi
 
脳の計算論 第3章「リズム活動と位相応答」
脳の計算論 第3章「リズム活動と位相応答」脳の計算論 第3章「リズム活動と位相応答」
脳の計算論 第3章「リズム活動と位相応答」Kohei Ichikawa
 
Artificial neural network
Artificial neural networkArtificial neural network
Artificial neural networkIldar Nurgaliev
 
Personalized news recommendation engine
Personalized news recommendation enginePersonalized news recommendation engine
Personalized news recommendation enginePrateek Sachdev
 
02 combinational logic
02 combinational logic02 combinational logic
02 combinational logicZainab Noor
 
PyTorch Tutorial for NTU Machine Learing Course 2017
PyTorch Tutorial for NTU Machine Learing Course 2017PyTorch Tutorial for NTU Machine Learing Course 2017
PyTorch Tutorial for NTU Machine Learing Course 2017Yu-Hsun (lymanblue) Lin
 
Time Series Analysis:Basic Stochastic Signal Recovery
Time Series Analysis:Basic Stochastic Signal RecoveryTime Series Analysis:Basic Stochastic Signal Recovery
Time Series Analysis:Basic Stochastic Signal RecoveryDaniel Cuneo
 
数学カフェ 確率・統計・機械学習回 「速習 確率・統計」
数学カフェ 確率・統計・機械学習回 「速習 確率・統計」数学カフェ 確率・統計・機械学習回 「速習 確率・統計」
数学カフェ 確率・統計・機械学習回 「速習 確率・統計」Ken'ichi Matsui
 
Glm talk Tomas
Glm talk TomasGlm talk Tomas
Glm talk TomasSri Ambati
 
Accelerating HPC Applications on NVIDIA GPUs with OpenACC
Accelerating HPC Applications on NVIDIA GPUs with OpenACCAccelerating HPC Applications on NVIDIA GPUs with OpenACC
Accelerating HPC Applications on NVIDIA GPUs with OpenACCinside-BigData.com
 
Cocos2dを使ったゲーム作成の事例
Cocos2dを使ったゲーム作成の事例Cocos2dを使ったゲーム作成の事例
Cocos2dを使ったゲーム作成の事例Yuichi Higuchi
 
2D_BLIT_software_Blackness
2D_BLIT_software_Blackness2D_BLIT_software_Blackness
2D_BLIT_software_BlacknessShereef Shehata
 
Statistics for Economics Midterm 2 Cheat Sheet
Statistics for Economics Midterm 2 Cheat SheetStatistics for Economics Midterm 2 Cheat Sheet
Statistics for Economics Midterm 2 Cheat SheetLaurel Ayuyao
 
พรรณิภา กองเกตุใหญ่
พรรณิภา  กองเกตุใหญ่พรรณิภา  กองเกตุใหญ่
พรรณิภา กองเกตุใหญ่best Besta
 
Dm part03 neural-networks-handout
Dm part03 neural-networks-handoutDm part03 neural-networks-handout
Dm part03 neural-networks-handoutokeee
 

What's hot (20)

Behind the Performance of Quake 3 Engine: Fast Inverse Square Root
Behind the Performance of Quake 3 Engine: Fast Inverse Square RootBehind the Performance of Quake 3 Engine: Fast Inverse Square Root
Behind the Performance of Quake 3 Engine: Fast Inverse Square Root
 
脳の計算論 第3章「リズム活動と位相応答」
脳の計算論 第3章「リズム活動と位相応答」脳の計算論 第3章「リズム活動と位相応答」
脳の計算論 第3章「リズム活動と位相応答」
 
Artificial neural network
Artificial neural networkArtificial neural network
Artificial neural network
 
Personalized news recommendation engine
Personalized news recommendation enginePersonalized news recommendation engine
Personalized news recommendation engine
 
02 combinational logic
02 combinational logic02 combinational logic
02 combinational logic
 
PyTorch Tutorial for NTU Machine Learing Course 2017
PyTorch Tutorial for NTU Machine Learing Course 2017PyTorch Tutorial for NTU Machine Learing Course 2017
PyTorch Tutorial for NTU Machine Learing Course 2017
 
ISCAS2013_v5
ISCAS2013_v5ISCAS2013_v5
ISCAS2013_v5
 
Time Series Analysis:Basic Stochastic Signal Recovery
Time Series Analysis:Basic Stochastic Signal RecoveryTime Series Analysis:Basic Stochastic Signal Recovery
Time Series Analysis:Basic Stochastic Signal Recovery
 
Ac cuda c_3
Ac cuda c_3Ac cuda c_3
Ac cuda c_3
 
数学カフェ 確率・統計・機械学習回 「速習 確率・統計」
数学カフェ 確率・統計・機械学習回 「速習 確率・統計」数学カフェ 確率・統計・機械学習回 「速習 確率・統計」
数学カフェ 確率・統計・機械学習回 「速習 確率・統計」
 
Glm talk Tomas
Glm talk TomasGlm talk Tomas
Glm talk Tomas
 
Accelerating HPC Applications on NVIDIA GPUs with OpenACC
Accelerating HPC Applications on NVIDIA GPUs with OpenACCAccelerating HPC Applications on NVIDIA GPUs with OpenACC
Accelerating HPC Applications on NVIDIA GPUs with OpenACC
 
Chapter14
Chapter14Chapter14
Chapter14
 
2013 1
2013 1 2013 1
2013 1
 
Cocos2dを使ったゲーム作成の事例
Cocos2dを使ったゲーム作成の事例Cocos2dを使ったゲーム作成の事例
Cocos2dを使ったゲーム作成の事例
 
NAS EP Algorithm
NAS EP Algorithm NAS EP Algorithm
NAS EP Algorithm
 
2D_BLIT_software_Blackness
2D_BLIT_software_Blackness2D_BLIT_software_Blackness
2D_BLIT_software_Blackness
 
Statistics for Economics Midterm 2 Cheat Sheet
Statistics for Economics Midterm 2 Cheat SheetStatistics for Economics Midterm 2 Cheat Sheet
Statistics for Economics Midterm 2 Cheat Sheet
 
พรรณิภา กองเกตุใหญ่
พรรณิภา  กองเกตุใหญ่พรรณิภา  กองเกตุใหญ่
พรรณิภา กองเกตุใหญ่
 
Dm part03 neural-networks-handout
Dm part03 neural-networks-handoutDm part03 neural-networks-handout
Dm part03 neural-networks-handout
 

Similar to MNIST Tensorboard Visualization Guide

[신경망기초] 합성곱신경망
[신경망기초] 합성곱신경망[신경망기초] 합성곱신경망
[신경망기초] 합성곱신경망jaypi Ko
 
Simple, fast, and scalable torch7 tutorial
Simple, fast, and scalable torch7 tutorialSimple, fast, and scalable torch7 tutorial
Simple, fast, and scalable torch7 tutorialJin-Hwa Kim
 
An introduction to Deep Learning with Apache MXNet (November 2017)
An introduction to Deep Learning with Apache MXNet (November 2017)An introduction to Deep Learning with Apache MXNet (November 2017)
An introduction to Deep Learning with Apache MXNet (November 2017)Julien SIMON
 
Tech day ngobrol santai tensorflow
Tech day ngobrol santai tensorflowTech day ngobrol santai tensorflow
Tech day ngobrol santai tensorflowRamdhan Rizki
 
Explanation on Tensorflow example -Deep mnist for expert
Explanation on Tensorflow example -Deep mnist for expertExplanation on Tensorflow example -Deep mnist for expert
Explanation on Tensorflow example -Deep mnist for expert홍배 김
 
5707_10_auto-encoder.pptx
5707_10_auto-encoder.pptx5707_10_auto-encoder.pptx
5707_10_auto-encoder.pptxSidoriOne
 
On Beyond (PostgreSQL) Data Types
On Beyond (PostgreSQL) Data TypesOn Beyond (PostgreSQL) Data Types
On Beyond (PostgreSQL) Data TypesJonathan Katz
 
How to use SVM for data classification
How to use SVM for data classificationHow to use SVM for data classification
How to use SVM for data classificationYiwei Chen
 
Power ai tensorflowworkloadtutorial-20171117
Power ai tensorflowworkloadtutorial-20171117Power ai tensorflowworkloadtutorial-20171117
Power ai tensorflowworkloadtutorial-20171117Ganesan Narayanasamy
 
Order-Picking-Policies.ppt
Order-Picking-Policies.pptOrder-Picking-Policies.ppt
Order-Picking-Policies.pptTaspiyaAfroz
 
Font classification with 5 deep learning models using tensor flow
Font classification with 5 deep learning models using tensor flowFont classification with 5 deep learning models using tensor flow
Font classification with 5 deep learning models using tensor flowDevatanu Banerjee
 
Noise Contrastive Estimation-based Matching Framework for Low-Resource Securi...
Noise Contrastive Estimation-based Matching Framework for Low-Resource Securi...Noise Contrastive Estimation-based Matching Framework for Low-Resource Securi...
Noise Contrastive Estimation-based Matching Framework for Low-Resource Securi...Tu Nguyen
 
Effective Numerical Computation in NumPy and SciPy
Effective Numerical Computation in NumPy and SciPyEffective Numerical Computation in NumPy and SciPy
Effective Numerical Computation in NumPy and SciPyKimikazu Kato
 

Similar to MNIST Tensorboard Visualization Guide (20)

[신경망기초] 합성곱신경망
[신경망기초] 합성곱신경망[신경망기초] 합성곱신경망
[신경망기초] 합성곱신경망
 
Simple, fast, and scalable torch7 tutorial
Simple, fast, and scalable torch7 tutorialSimple, fast, and scalable torch7 tutorial
Simple, fast, and scalable torch7 tutorial
 
An introduction to Deep Learning with Apache MXNet (November 2017)
An introduction to Deep Learning with Apache MXNet (November 2017)An introduction to Deep Learning with Apache MXNet (November 2017)
An introduction to Deep Learning with Apache MXNet (November 2017)
 
Tech day ngobrol santai tensorflow
Tech day ngobrol santai tensorflowTech day ngobrol santai tensorflow
Tech day ngobrol santai tensorflow
 
DCT
DCTDCT
DCT
 
DCT
DCTDCT
DCT
 
DCT
DCTDCT
DCT
 
Explanation on Tensorflow example -Deep mnist for expert
Explanation on Tensorflow example -Deep mnist for expertExplanation on Tensorflow example -Deep mnist for expert
Explanation on Tensorflow example -Deep mnist for expert
 
Numpy Talk at SIAM
Numpy Talk at SIAMNumpy Talk at SIAM
Numpy Talk at SIAM
 
5707_10_auto-encoder.pptx
5707_10_auto-encoder.pptx5707_10_auto-encoder.pptx
5707_10_auto-encoder.pptx
 
About RNN
About RNNAbout RNN
About RNN
 
About RNN
About RNNAbout RNN
About RNN
 
On Beyond (PostgreSQL) Data Types
On Beyond (PostgreSQL) Data TypesOn Beyond (PostgreSQL) Data Types
On Beyond (PostgreSQL) Data Types
 
How to use SVM for data classification
How to use SVM for data classificationHow to use SVM for data classification
How to use SVM for data classification
 
Power ai tensorflowworkloadtutorial-20171117
Power ai tensorflowworkloadtutorial-20171117Power ai tensorflowworkloadtutorial-20171117
Power ai tensorflowworkloadtutorial-20171117
 
Order-Picking-Policies.ppt
Order-Picking-Policies.pptOrder-Picking-Policies.ppt
Order-Picking-Policies.ppt
 
Font classification with 5 deep learning models using tensor flow
Font classification with 5 deep learning models using tensor flowFont classification with 5 deep learning models using tensor flow
Font classification with 5 deep learning models using tensor flow
 
Noise Contrastive Estimation-based Matching Framework for Low-Resource Securi...
Noise Contrastive Estimation-based Matching Framework for Low-Resource Securi...Noise Contrastive Estimation-based Matching Framework for Low-Resource Securi...
Noise Contrastive Estimation-based Matching Framework for Low-Resource Securi...
 
Dsp manual print
Dsp manual printDsp manual print
Dsp manual print
 
Effective Numerical Computation in NumPy and SciPy
Effective Numerical Computation in NumPy and SciPyEffective Numerical Computation in NumPy and SciPy
Effective Numerical Computation in NumPy and SciPy
 

More from SeongHyun Ahn

MQTT 를 이용한 주문시스템 개선
MQTT 를 이용한 주문시스템 개선 MQTT 를 이용한 주문시스템 개선
MQTT 를 이용한 주문시스템 개선 SeongHyun Ahn
 
github : 유용한 기능들
github : 유용한 기능들 github : 유용한 기능들
github : 유용한 기능들 SeongHyun Ahn
 
카피캣으로 시작하는 오픈소스
카피캣으로 시작하는 오픈소스 카피캣으로 시작하는 오픈소스
카피캣으로 시작하는 오픈소스 SeongHyun Ahn
 
파이썬 웹프로그래밍 1탄
파이썬 웹프로그래밍 1탄 파이썬 웹프로그래밍 1탄
파이썬 웹프로그래밍 1탄 SeongHyun Ahn
 
파이썬 기본 문법
파이썬 기본 문법파이썬 기본 문법
파이썬 기본 문법SeongHyun Ahn
 
파이썬 모듈 패키지
파이썬 모듈 패키지파이썬 모듈 패키지
파이썬 모듈 패키지SeongHyun Ahn
 
파이썬 파일처리 및 문자열 처리
파이썬 파일처리 및 문자열 처리 파이썬 파일처리 및 문자열 처리
파이썬 파일처리 및 문자열 처리 SeongHyun Ahn
 
파이썬 데이터베이스 연결 1탄
파이썬 데이터베이스 연결 1탄파이썬 데이터베이스 연결 1탄
파이썬 데이터베이스 연결 1탄SeongHyun Ahn
 
파이썬 웹 프로그래밍 2탄
파이썬 웹 프로그래밍 2탄 파이썬 웹 프로그래밍 2탄
파이썬 웹 프로그래밍 2탄 SeongHyun Ahn
 
파이썬 데이터베이스 연결 2탄
파이썬 데이터베이스 연결 2탄파이썬 데이터베이스 연결 2탄
파이썬 데이터베이스 연결 2탄SeongHyun Ahn
 
파이썬 유용한 라이브러리
파이썬 유용한 라이브러리파이썬 유용한 라이브러리
파이썬 유용한 라이브러리SeongHyun Ahn
 
Pycon APAC 2016 후기
Pycon APAC 2016 후기Pycon APAC 2016 후기
Pycon APAC 2016 후기SeongHyun Ahn
 
Introduction of scrum 안성현 20120606
Introduction of scrum 안성현 20120606Introduction of scrum 안성현 20120606
Introduction of scrum 안성현 20120606SeongHyun Ahn
 
디자인 패턴 데코레이터 패턴
디자인 패턴 데코레이터 패턴디자인 패턴 데코레이터 패턴
디자인 패턴 데코레이터 패턴SeongHyun Ahn
 
파이썬 스터디 15장
파이썬 스터디 15장파이썬 스터디 15장
파이썬 스터디 15장SeongHyun Ahn
 
파이썬 스터디 9장
파이썬 스터디 9장파이썬 스터디 9장
파이썬 스터디 9장SeongHyun Ahn
 
빠르게 활용하는 파이썬3 스터디(ch1~4)
빠르게 활용하는 파이썬3 스터디(ch1~4)빠르게 활용하는 파이썬3 스터디(ch1~4)
빠르게 활용하는 파이썬3 스터디(ch1~4)SeongHyun Ahn
 

More from SeongHyun Ahn (18)

MQTT 를 이용한 주문시스템 개선
MQTT 를 이용한 주문시스템 개선 MQTT 를 이용한 주문시스템 개선
MQTT 를 이용한 주문시스템 개선
 
github : 유용한 기능들
github : 유용한 기능들 github : 유용한 기능들
github : 유용한 기능들
 
카피캣으로 시작하는 오픈소스
카피캣으로 시작하는 오픈소스 카피캣으로 시작하는 오픈소스
카피캣으로 시작하는 오픈소스
 
파이썬 웹프로그래밍 1탄
파이썬 웹프로그래밍 1탄 파이썬 웹프로그래밍 1탄
파이썬 웹프로그래밍 1탄
 
파이썬 기본 문법
파이썬 기본 문법파이썬 기본 문법
파이썬 기본 문법
 
파이썬 모듈 패키지
파이썬 모듈 패키지파이썬 모듈 패키지
파이썬 모듈 패키지
 
파이썬 파일처리 및 문자열 처리
파이썬 파일처리 및 문자열 처리 파이썬 파일처리 및 문자열 처리
파이썬 파일처리 및 문자열 처리
 
파이썬 데이터베이스 연결 1탄
파이썬 데이터베이스 연결 1탄파이썬 데이터베이스 연결 1탄
파이썬 데이터베이스 연결 1탄
 
파이썬 웹 프로그래밍 2탄
파이썬 웹 프로그래밍 2탄 파이썬 웹 프로그래밍 2탄
파이썬 웹 프로그래밍 2탄
 
파이썬 데이터베이스 연결 2탄
파이썬 데이터베이스 연결 2탄파이썬 데이터베이스 연결 2탄
파이썬 데이터베이스 연결 2탄
 
파이썬 유용한 라이브러리
파이썬 유용한 라이브러리파이썬 유용한 라이브러리
파이썬 유용한 라이브러리
 
파이썬 소개
파이썬 소개 파이썬 소개
파이썬 소개
 
Pycon APAC 2016 후기
Pycon APAC 2016 후기Pycon APAC 2016 후기
Pycon APAC 2016 후기
 
Introduction of scrum 안성현 20120606
Introduction of scrum 안성현 20120606Introduction of scrum 안성현 20120606
Introduction of scrum 안성현 20120606
 
디자인 패턴 데코레이터 패턴
디자인 패턴 데코레이터 패턴디자인 패턴 데코레이터 패턴
디자인 패턴 데코레이터 패턴
 
파이썬 스터디 15장
파이썬 스터디 15장파이썬 스터디 15장
파이썬 스터디 15장
 
파이썬 스터디 9장
파이썬 스터디 9장파이썬 스터디 9장
파이썬 스터디 9장
 
빠르게 활용하는 파이썬3 스터디(ch1~4)
빠르게 활용하는 파이썬3 스터디(ch1~4)빠르게 활용하는 파이썬3 스터디(ch1~4)
빠르게 활용하는 파이썬3 스터디(ch1~4)
 

Recently uploaded

GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersThousandEyes
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Patryk Bandurski
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Paola De la Torre
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Allon Mureinik
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...HostedbyConfluent
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptxLBM Solutions
 

Recently uploaded (20)

GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food Manufacturing
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptx
 

MNIST Tensorboard Visualization Guide

  • 2. MNIST • MNIST는 간단한 컴퓨터 비전 데이터셋 • train-images-idx3-ubyte.gz: training set images (9912422 bytes) train-labels-idx1-ubyte.gz: training set labels (28881 bytes) t10k-images-idx3-ubyte.gz: test set images (1648877 bytes) t10k-labels-idx1-ubyte.gz: test set labels (4542 bytes 2
  • 3. MNIST Images • 파일이 아님. • 하나의 이미지를 784개의 데이터로 표현 3
  • 4. MNIST Label • 글자 이미지가 실제 어떤 글자인지를 나타낸다. • [0, 0, 0, 0, 0, 0, 0, 0, 0, 0] => 각 인덱스가 숫자를 나타냄 • 1 = [0, 1, 0, 0, 0, 0, 0, 0, 0, 0] , 9 = [0, 0, 0, 0, 0, 0, 0, 0, 0, 1] 4
  • 5. Tensorflow 설치하기 -pip install --upgrade tensorflow -소스빌드해서 설치가능 5
  • 6. MNIST Tensorflow 에서 불러오기 from tensorflow.examples.tutorials.mnist import input_data mnist = input_data.read_data_sets("MNIST_data/") 6
  • 7. MNIST Tensorflow 에서 불러오기 # -*- coding:utf-8 -*- from tensorflow.examples.tutorials.mnist import input_data mnist = input_data.read_data_sets("MNIST_data/", one_hot=True) for key in ['train', 'test', 'validation']: print("mnist.%s :" % key) minst_dataset= getattr(mnist, key) print("tnum_examples : %d" % minst_dataset.num_examples) print("timages count : %d" % len(minst_dataset.images)) print("tlabels count : %d" % len(minst_dataset.labels)) print("timages[0] len : %d" % len(minst_dataset.images[0])) print("tlabels[0] len : %d" % len(minst_dataset.labels[0])) print("tlabels[0] : %s" % str(minst_dataset.labels[0])) 7
  • 8. MNIST Tensorflow 에서 불러오기 from tensorflow.examples.tutorials.mnist import input_data mnist = input_data.read_data_sets("MNIST_data/", one_hot=True) for key in ['train', 'test', 'validation']: print("mnist.%s :" % key) minst_dataset= getattr(mnist, key) print("tnum_examples : %d" % minst_dataset.num_examples) print("timages count : %d" % len(minst_dataset.images)) print("tlabels count : %d" % len(minst_dataset.labels)) print("timages[0] len : %d" % len(minst_dataset.images[0])) print("tlabels[0] len : %d" % len(minst_dataset.labels[0])) 8
  • 9. urllib.error.URLError: <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:7) 0SX) Python3.x SSL Error 9
  • 10. tensorBoard 띄우기 Usage : tensorboard --help $ usage: tensorboard [-h] [--logdir LOGDIR] [--debug DEBUG] [--nodebug] [--host HOST] [--port PORT] 10
  • 11. tensorboard 띄우기 $ tensorboard --logdir=log $ TensorBoard b'54' at http://anui-MacBook-Pro.local:6006 - http://127.0.0.1:6006 접속 $ tensorboard --logdir=log --host 0.0.0.0 --port 6006 - 외부에서 접속가능 11
  • 13. CNN 구성 # L1 ImgIn shape=(?, 28, 28, 1) # 필터의 크기 3X3, 32개의 필터 W1 = tf.Variable(tf.random_normal([3, 3, 1, 32], stddev=0.01)) # Conv -> (?, 28, 28, 32) # Pool -> (?, 14, 14, 32) # 이동거리 1 L1 = tf.nn.conv2d(X_img, W1, strides=[1, 1, 1, 1], padding='SAME') L1 = tf.nn.relu(L1) L1 = tf.nn.max_pool(L1, ksize=[1, 2, 2, 1], strides=[1, 2, 2, 1], padding='SAME') ''' Tensor("Conv2D:0", shape=(?, 28, 28, 32), dtype=float32) Tensor("Relu:0", shape=(?, 28, 28, 32), dtype=float32) Tensor("MaxPool:0", shape=(?, 14, 14, 32), dtype=float32) ''' 13
  • 14. CNN 구성 # L2 ImgIn shape=(?, 14, 14, 32) W2 = tf.Variable(tf.random_normal([3, 3, 32, 64], stddev=0.01)) # Conv ->(?, 14, 14, 64) # Pool ->(?, 7, 7, 64) L2 = tf.nn.conv2d(L1, W2, strides=[1, 1, 1, 1], padding='SAME') L2 = tf.nn.relu(L2) L2 = tf.nn.max_pool(L2, ksize=[1, 2, 2, 1], strides=[1, 2, 2, 1], padding='SAME') L2_flat = tf.reshape(L2, [-1, 7 * 7 * 64]) W3 = tf.get_variable("W3", shape=[7 * 7 * 64, 10], initializer=tf.contrib.layers.xavier_initializer()) b = tf.Variable(tf.random_normal([10]), name='b') logits = tf.matmul(L2_flat, W3) + b cost = tf.reduce_mean(tf.nn.softmax_cross_entropy_with_logits(logits=logits, labels=Y)) optimizer = tf.train.GradientDescentOptimizer(learning_rate=0.1).minimize(cost) 14
  • 15. CNN-MNIST 결과 tensorboard 연결하기 saver 를 이용해서 model 을 --logdir path 에 저장 15
  • 16. CNN-MNIST 결과 tensorboard 연결하기 • Data Point <= Label, Images • metadata file • Label : .tsv 파일 • Images : 단일 sprite image, 8192 X 8192 까지 지원 • projector_config.pbtxt • API 를 이용해서 생성 16
  • 17. embedding = tf.Variable(tf.zeros([1024, 10]), name="test_embedding") assignment = embedding.assign(logits) saver = tf.train.Saver() sess.run(tf.global_variables_initializer()) writer = tf.summary.FileWriter(LOGDIR + "/embedding") writer.add_graph(sess.graph) config = tf.contrib.tensorboard.plugins.projector.ProjectorConfig() embedding_config = config.embeddings.add() embedding_config.tensor_name = embedding.name embedding_config.metadata_path = LOGDIR + 'labels_1024.tsv‘ # 메타데이터 지정 embedding_config.sprite.image_path = LOGDIR + 'sprite_1024.png‘ # sprite 이미지 파일 지정 embedding_config.sprite.single_image_dim.extend([28, 28]) # 이미지 사이즈 지정 tf.contrib.tensorboard.plugins.projector.visualize_embeddings(writer, config) if i % 500 == 0: sess.run(assignment, feed_dict={X: mnist.test.images[:1024], Y: mnist.test.labels[:1024]}) saver.save(sess, os.path.join(LOGDIR, "model.ckpt"), i) 17 생성 : projector_config.pbtxt
  • 18. CNN-MNIST 결과 tensorboard 연결하기 • https://github.com/jireh-father/tensorboard-embedding-visualization 18
  • 19. Reference • https://tensorflowkorea.gitbooks.io/tensorflow-kr/content/g3doc/tutorials/mnist/beginners/ • http://bcho.tistory.com/1154 • https://www.google.co.kr/search?q=image+to+mnist+format&oq=image+to+mnisr+&aqs=chrome.1.69i57j0l2.6888j0j4&sourceid=chrom e&ie=UTF-8 • http://goodtogreate.tistory.com/entry/Hands-on-TensorBoard-TensorFlow-Dev-Summit2017 • 모두의 딥러닝 : https://hunkim.github.io/ml/ • http://sanghyukchun.github.io/75/ • http://yujuwon.tistory.com/entry/TENSORFLOWCNN2 • http://yujuwon.tistory.com/entry/TENSORFLOW-Image-AutoEncoder 19

Editor's Notes

  1. 간단하게 mnist 를 이용해서 CNN 을 텐서플로우로 해보고 그 결과를 tensorboard 를 이용해서 해봤습니다. Mnist 에 대해서 설명하고, 텐서보드를 이용하는 방법을 설명드리겠습니다.
  2. 컴퓨터 비전 셋이고 구글에서 치면 해당 홈페이지로 이동 가능하고, 가보면 총 4개의 파일을 다운받을수 있게 되어 있습니다. 2개는 트레이닝 셋 나머지 2개는 테스트 셋으로 각각 이미지와 라벨로 구성되어 있습니다.
  3. 실제로 압축을 풀어보면 이미지라고 해서 실제 이미지 파일이 들어 있는게 아니라 하나의 이미지를 784개의 데이터로 표현하고 있다.
  4. 레이블은 해당 이미지가 어떤 글자인지를 나타낸다. 0~9까지의 1차원 배열이 있고, 그 안에서 해당 숫자에 해당하는 인덱스를 1로 표시를 한다.
  5. Mnist 를 tensorflow 에서 사용하기 위해서는 일단 tensorflow 를 받아야 한다. 소스빌드를 이용해서 설치할 경우에는 성능이 소폭 향상 된다고 실제로 PIP 로 설치할 경우 실행하면, 여러가지 설치를 하라고 뜨고 있습니다.
  6. MNIST 데이터를 TENSORFLOW 에서 가져오는 코드는 2줄이면 된다. Read_data_set 함수에서 어디에 다운로드를 받고 압축을 풀 것인지 지정하면 되고 위의 코드를 실행하면 4개의 파일에 있는 데이터가 mnist 객체로 들어가게 된다. 그 안을 보면 크게 트레이닝, 테스트, 벨리데이션으로 나눠져 있다.
  7. 좀더 안이 어떻게 구성되어 있는지 확인차 돌려봤는데
  8. 이런식으로 train 은 55000 개 테스트는 10000개 validation 는 5000 개가 쌍으로 이미지와 레이블이 있는것을 확인 할 수 가 있다.
  9. 중요한 점은 반드시 –logdir 을 지정해야 한다는 점. 지정하지 않으면 오류가 발생한다. --host 옵션과 –port 옵션을 통해서 서버에서 띄울 경우 위와 같이 외부 접속을 허용할 수 있다.
  10. 간단하게 CNN을 구성해 봤고, 머신러닝을 잘 몰라서 모두의 딥러닝을 따라했습니다. 그래서 컨벌루션 레이어 2개, 맥스풀링 레이어 2개를 다는 식으로 구성했습니다.
  11. 첫번째 필터에서는 입력값이 28X28 에 3X3 필터 32개를 적용했고, RELU 와 맥스필터를 거쳐서 14X14 32개가 출력으로 나왓습니다.
  12. 두번째 필터에서는 입력값이 첫번째 필터의 결과로 받고 3X3 필터 64개를 적용했고, RELU 와 맥스필터를 거쳐서 7X7 64개가 출력으로 나왓습니다. 이걸 SOFTMAX 를 거쳐서 출력값이 나오도록 수정했습니다. 이런식으로 CNN 을 구성했고, 이 부분은 모두의 딥러닝 부분을 많이 따라해서 나중에 해당 부분의 CNN 부분을 들어보시면 좀더 이해가 잘 될것이구요
  13. 그래서 이제 그 결과를 tensorboard 에 저장을 하면 되는데 어떻게 저장할것인가? 하면 Tensorflow 에서 제공하는 saver 라는 것을 통해서 앞에서 말한 tensorboard 의 –logdir 위치에 넣으면됩니다. 넣고 띄워보면 파란색 점만 많이 나오는 것을 볼 수 있는데요 뭐가 뭔지 알수가 없습니다.
  14. 그래서 텐서보드에서는 데이터 포인트에 라벨과 이미지를 붙일수 있는 기능을 제공하고 있는데요 Metadata 파일오 label 의 경우 tsv 형태, 이미지의 스프라이트 이미지를 지원하고 있습니다. 스프라이트 이미지는 여러 이미지를 하나로 붙인것으로 순서가 중요한데 lefttop – rightbottom 으로 배열하고 있습니다. 즉 mnist 에 학습결과를 보고 싶으면 이미지가 필요합니다. 그리고 그런 이미지와 라벨데이터를 연결해주기 위해서 projector_config.pbtxt 가 필요한데 이건 Api를 통해서 생성할 수 있습니다.
  15. 메타데이터는 mnist.test.label 을 통해서 가져올 수 있다 여기서는 1024 개의 테스트 데이터를 가져와서 tensorboard 에 결과를 넣을것 때문에 1024, 10 으로 잡았고, name 을 주었는데 저 name이 실제 tensorboad 에 보이는 이름입니다. 그리고 writer 를 지정하고 log directory 밑에 embedding 이라고 적어서 그 안에 embedding 관련 내용들이 들어가게 됩니다. 그리고 메타데이터 경로와 이미지 경로를 지정해 주고 이미지 사이즈를 지정해 줘야 합니다. 왜냐하면 스프라이트 이미지이기 때문에 tensorboard 에서 그 크기를 알아야 하기 때문입니다. 그리고 나서 500번 실행시 마다 test 에서 1024개를 가져와서 결과를 기록하게 하였습니다. 그리고 나서 tensorboard 를 띄워보면 이렇게 나옵니다. PCA 는 주성분 분석이고 차원을 줄이는 것으로 알고 있고 t-sne 는 비선형 차원 감소기술로 지역적인 구조를 유지해서 이웃탐색이나 클러스터를 찾는데 유용하다고 합니다.
  16. 이렇게 해서 tensorboard 를 띄우느것 까지 해봤는데요. 사실 학습시킨 모델을 저장하고, 테스트 데이터로 테스트할때 사용하면 좋을것 같고 매번 이렇게 코딩 하는것 보다는 모델을 복원해서 잘 분류되었는지 눈으로 볼떄 좋을것 같은데요 저 링크에 가보시면, embedding 을 별도로 모듈화 시켜서 학습과 별도로 쉽게 붙일수 있는 것을 만들어 놓기도 하였습니다. 참고해 보시면 될것 같습니다.