際際滷

際際滷Share a Scribd company logo
[Lab1] Basic Tensorflow
Prepared by Gyeong-hoon Lee
Data Mining Lab. 503
E-mail : ghlee0304@cnu.ac.kr
1) prompt谿曙 れ ロ.
pip3 install -upgrade tensorflow
2) tensorflow windows 蟆曙 C++ 2015 覦壱 れ螳 .
 るジ讓 襷一 企Ν  危 襷 願鍵
 https://www.microsoft.com/en-us/download/details.aspx?id=53587

How to Install Tensorflow (1)
3) れ企  殊 れ
How to Install Tensorflow (2)
豌危  れ 企Ν
れ企  れ
How to Install Tensorflow (3)
4) れ螳 襭給. 企ゼ 誤蠍 伎 れ螻 螳 讌.
C:> python
>>> import tensorflow as tf
>>> tf.__version__
1.2.1
>>> a = tf.constant(1)
>>> b = tf.constant(2)
>>> c = tf.add(a, b)
>>> sess = tf.Session()
>>> print(sess.run(c))
3
<cmd ろ覃 >
<idle ろ 覃>
Python Libraries for numerical computation in tensorflow
- numpy : 覦一伎 伎 豺 螻一  觜襯願 蠍   殊企襴
[tutorial site] https://docs.scipy.org/doc/numpy-dev/user/quickstart.html
>>> pip3 install numpy
- pandas : 企, 襴讀 煙 襭 伎 一危磯ゼ 所 る蠍  殊企襴
[tutorial site] http://pandas.pydata.org/pandas-docs/stable/10min.html
>>> pip3 install pandas
- matplotlib : 一危一 覿 豢 煙 蠏碁襯 牛 誤   殊企襴
[tutorial site] https://matplotlib.org/users/pyplot_tutorial.html
>>> pip3 install matplotlib
Other libraries
Tensorflow 襭蟲譟 : Constant
Constant
   れ梗 螳  螳豌企 朱 覲蟆渚伎.
 磯Μ螳 燕 碁 覲襯 覿蠍 伎 覓語伎 name 朱誤磯ゼ   .
1) placeholder
襦覿 れ  螳 覦蠍  襴(place)襯 讌螻(hold)  碁
磯殊 煙 螳 螳讌讌 
2) feed_dict (feed dictionary)
- 蠏碁 placeholder 碁 螳 ロ  覃, 蠏 螳れ , 覓語, 襴ろ, numpy 覦一伎
  
- 伎 (dictionary) {key :value}  螳讌 襭
Tensorflow 襭蟲譟 : PlaceHolder
input螳 襭 int or float 焔
input 覈 tensor shape
node 企
()
()
()
Tensorflow 襭蟲譟 : PlaceHolder - Example
3) placeholder shape
) shape = [] : 0谿 , れ梗 - shape = [3] : 1谿  - shape = [1,3] : 2谿 
*  覈(shape) 螳 襦 一一 螳ロ.
4) placeholder feed_dict襦 螳 
- sess.run(, feed_dict={伎ろ :  螳})
Mylab
1. 誤磯 螳 Lab01:Tensorflow 蠍磯蓋 殊企
in [ ]. 朱  觚襦れ 谿襦襦 豢螳願覃伎 ろ企慨螻 ろ 蟆郁骸 覃伎
貂′伎 覲願 襴.
豢螻殊-1 (10 11手讌 豢)
豢螻殊-2 (10 11手讌 豢)
2. れ 蠏碁襦 蟲 貊襯 燕螻
- a b襯 tf.constant 5 3朱 蟲
- a b襯 tf.placeholder襯 伎 蟲螻 (a,b)=(1,2), (3,4), (5,6),(7,8), (9,10)  蟶朱 ろ
襦 rank 1 襦 ロ
5
3
input
input
mul
add
add
23
a
b
c
d
e
Tensorflow 襭蟲譟 : Variable
Variable
 襾語  煙 螳 磯 覲蟆暑 螳 ロ   覦覯 .
 Session.run() 語  讌覃伎 覲蟆 螳ロ  螳 覲願蠍  Variable 螳豌企ゼ .
 , 豐蠍壱襯 讌 朱 variable 螳 轟 讌 朱襦 覦 tf.global_variables_initializer()
襯 ろ伎狩.
 豐蠍郁 讌 讌伎朱 覦覯螻 覓伎 豐蠍郁 燕 襯 伎 覦覯 .
Variable - example
tf.reduce_mean
tf.reduce_mean
tf.reduce_mean  example
x = np.array([[1,2,3],
[4,5,6],
[7,8,9]])
a = tf.reduce_mean(x,axis=0) [4 5 6]
a = tf.reduce_mean(x,axis=1) [2 5 8]
a = tf.reduce_mean(x) 5



x = np.array([[1, 2, 3],
[4, 5, 6],
[7, 8, 9]])
x = np.array([[1, 2, 3],
[4, 5, 6],
[7, 8, 9]])
4 5 6
2
5
8
case 1 : axis=0
case 2 : axis=1
tf.assign
tf.assign
覲 襦 螳 麹蠍  .
Example 1
a = tf.Variable(initial_value=3, dtype = tf.float32)
b = tf.assign(a,1) or a.assign(1)
sess = tf.Session()
sess.run(tf.global_variables_initializer())
print(sess.run(a))  3.0
print(sess.run(b))  1.0
print(sess.run(a))  1.0
How to load and save data
np.loadtxt(filename, dtype, delimiter, skiprows)
Example
import numpy as np
np.loadtxt(".../data.csv", delimiter=',', dtype=np.float32)
# skiprows = n  蟆曙,  n覯讌 譴蟾讌 誤螻 覿.
np.savetxt(filename, X, delimiter)
Example
import numpy as np
a = np.array([[1,2,3],[4,5,6],[7,8,9]])
np.savetxt(".../data.csv", a, delimiter=',')
3. 誤磯 螳 Lab02 (linear regression) 殊企
Full code with placeholder伎 貊襯 れ 一危磯ゼ 螳讌螻 ろ企慨螻 ろ 蟆郁骸
覃伎 貂′伎 覲願 襴.
X=[1,2,3,4,,10], Y=[2.2, 5.2, 6.1, 7.9, 10.5, 11.8, 15, 16, 18.2, 20]
4. 誤磯 螳 Lab03 (linear regression cost  豕) 殊企襯 谿瑚
 3覯 一危磯ゼ 螳讌螻 cost  蠏碁襯 蠏碁Μ螻 ろ覃伎 貂′伎
覲願 豢螳
5. data.csv 殊 一危磯ゼ 曙 4/5襯 training set朱 螻 襾語 1/5 test set朱 伎,
training set朱 linear regression  test set  豌 れ  豸♀螻 れ螳
襴壱誤螻, 豌 cost 蠏螳 襴壱誤 貊襯 燕螻 ろ誤.
豢螻殊-3 (10 11手讌 豢)
豢螻殊
 豢 蠍壱
 1谿 : 10 12  蟾讌 (10 襷 豈)
 2谿 : 10 12  れ 螳  蟾讌(7 襷 豈)
 危 豢 覩語豢襦 螳譯( )
 豢 覦覯
1) Source 貊 (.py)
2) ろ 蟆郁骸 覃 貂′伎 燕 覲願
3) 1)螻 2)襯 启 l  豢 企 貂殊れ 豢.
4) 启 覦 朱 : CS00_螻殊覯_覯_企
豢
[Lab2] Logistic classification
 Hypothesis : linear function
 Prediction : 豸♀ 0.5覲企    襯 蠍一朱 class label 蟆一
 magic.csv 殊 一危磯ゼ 曙 4/5襯 training set朱 螻 襾語 1/5 test set朱 
, training set朱 linear classification   test set  accuracy襯 蟲 
襴壱誤 貊襯 燕.
 Step  企至 れ伎 test set    accuracy襯 詞  讌 螻ろ伎 .
豢螻殊1 (10 25手讌 豢)  linear hypothesis 伎 classification
 Hypothesis : logistic function
 Prediction : 豸♀ 0.5覲企    襯 蠍一朱 class label 蟆一
 magic.csv 殊 一危磯ゼ 曙 4/5襯 training set朱 螻 襾語 1/5 test set朱
, training set朱 logistic classification   test set  accuracy襯 蟲
襴壱誤 貊襯 燕.
 Step  企至 れ伎 test set    accuracy襯 詞  讌 螻ろ伎 .
 magic.csv : Data are MC generated to simulate registration of high energy gamma particles in
an atmospheric Cherenkov telescope
instance 19020螳, feature: 10螳, class: 2螳
豢螻殊2 (10 25手讌 豢)  logistic classification
 Lab06 殊企 貊襯 谿瑚 image.csv 殊 一危磯ゼ 曙 4/5襯 training set朱
螻 襾語 1/5 test set朱, training set朱 softmax classification 
test set  襯 襴壱誤 貊襯 燕.
 Step  企至 れ伎 test set    accuracy襯 詞  讌 螻ろ伎 .
 magic.csv : 殊 企語 一危磯 覯暑覃, , , 覃, 谿, 蟆暑, 襯 企
企る 企伎
instance 2310螳, feature: 19螳, class: 7螳
豢螻殊3 (10 25手讌 豢)  softmax classification
豢螻殊
 豢 蠍壱
 1谿 : 10 25 蟾讌 (10 襷 豈)
 2谿 : 10 25  れ 螳  蟾讌(7 襷 豈)
 危 豢 覩語豢襦 螳譯( )
 豢 覦覯
1) Source 貊 (.py)
2) ろ 蟆郁骸 覃 貂′伎 燕 覲願
3) 1)螻 2)襯 启 l  豢 企 貂殊れ 豢.
4) 启 覦 朱 : CS00_螻殊覯_覯_企
豢
[Lab3] train, validation, test
[Lab 7-2]襯 谿瑚 Mnist 一危磯ゼ 覿 ,
 Training set朱 softmax classification  覈語 牛螻
 襷 epoch襷 train螻 validation, test set  襯 豸′ ロ
 Epoch 磯ジ Train, validation, test set  襯 蠏碁襦 蠏碁 觜蟲
 Learning rate襯 0.01, 0.1, 0.5襦   蟆郁骸れ 觜蟲伎 覿
豢螻殊3 (11 1手讌 豢)  mnist 一危磯ゼ 伎 softmax classification
 matplotlib 殊企襴襯 伎 蠏碁襯 蠏碁Π.
Example)
import matplotlib.pyplot as plt
import numpy as np
fig = plt.figure()
data1 = np.array([1,2,3,4,5,6,7,8,9,10])
data2 = data1**2
plt.plot(data1, k--, lable=data1)
plt.plot(data2, r--, lable=data2)
plt.legend() #覯襦
plt.show() #蠏碁 覲伎願鍵
蠏碁 蠏碁Μ蠍(matplotlib 伎)
* 谿瑚 : https://matplotlib.org/index.html
豢 螻殊
 豢 蠍壱
 1谿 : 11 1 蟾讌 (10 襷 豈)
 2谿 : 11 8 蟾讌(7 襷 豈)
 危 豢 覩語豢襦 螳譯( )
 豢 覦覯
1) Source 貊 (.py)
2) ろ 蟆郁骸 覃 貂′伎 燕 覲願
3) 1)螻 2)襯 启 l  豢 企 貂殊れ 豢.
4) 启 覦 朱 : CS00_螻殊覯_覯_企
豢
[Lab9] TensorBoard
Tensorboard (tf.summary.FileWriter覯)
 tf.summary.FileWriter(name)
writer = tf.summary.FileWriter(dirname)
writer.add_graph(sess.graph)
 Example
Step1) py殊 襷れ れ 燕螻 ろ
import tensorflow as tf
a = tf.constant(1,name='input_a')
b = tf.constant(2,name='input_b')
c = tf.add(a,b,name='sum_c')
sess = tf.Session()
writer = tf.summary.FileWriter("./board1")
writer.add_graph(sess.graph)
Step2) board1 启螳 蟆朱讌 
 蟆暑 れ
board1 启  殊 蟆朱讌
Tensorboard
Step3) cmd谿曙 願 board1  启蟾讌 企
 D:/SL/board1 朱  
Step4) cmd谿曙 れ 
tensorboard -logdir=board1
譯殊襯 chrome 覿 l朱 るジ讓所骸 螳 蠏碁殊 
)  覲企 覃
Tensorboard (覲旧″ )
 xor_nn.py
xor覓語襯 蠍   豸旧朱 襷 蟲譟

W1 = tf.Variable(tf.random_normal([2, 2]), name='weight1')
b1 = tf.Variable(tf.random_normal([2]), name='bias1')
layer1 = tf.sigmoid(tf.matmul(X, W1) + b1)
W2 = tf.Variable(tf.random_normal([2, 1]), name='weight2')
b2 = tf.Variable(tf.random_normal([1]), name='bias2')
hypothesis = tf.sigmoid(tf.matmul(layer1, W2) + b2)

)  覲企 覃 xor_nn.py
*  豸旧朱 襷 螳 蟲譟一  覲企 
磯Μ螳 襷 碁(襯 れ weight bias)
危エ覲願鍵螳 企給.
Tensorboard (with tf.name_scope(name)覯)
 with tf.name_scope(name)
 碁襯 螳蠍 ク襦  企朱 覓玖鍵  .
 ) xor_nn_name_scope.py
with tf.name_scope('Layer1'):
W1 = tf.Variable(tf.random_normal([2, 10]), name='weight1')
b1 = tf.Variable(tf.random_normal([10]), name='bias1')
layer1 = tf.sigmoid(tf.matmul(X, W1) + b1)
with tf.name_scope('Layer2'):
W2 = tf.Variable(tf.random_normal([10, 10]), name='weight2')
b2 = tf.Variable(tf.random_normal([10]), name='bias2')
layer2 = tf.sigmoid(tf.matmul(layer1, W2) + b2)
)  覲企 覃 xor_nn_name_scope.py
Tensorboard (tf.summary.scalar)
 tf.summary.scalar(name, value)
碁 scalar 企麹 螳れ 覈 豢企ゼ 危  
) cost, accuracy, entropy
 ) xor_nn_summary_scalar_hist.py
cost = -tf.reduce_mean(Y * tf.log(hypothesis) + (1 - Y)*tf.log(1 - hypothesis))
cost_scalar = tf.summary.scalar('cost',cost)

summary = tf.summary.merge_all()
with tf.Session() as sess:
writer = tf.summary.FileWriter("./board4")
writer.add_graph(sess.graph)

for step in range(10001):
s,_ = sess.run([summary,train], feed_dict={X: x_data, Y: y_data})
writer.add_summary(s, global_step=step)
)  覲企 覃(SCALARS tab)
Tensorboard (tf.summary.histogram)
 tf.summary.histogram(name, value)
碁 vector 企麹 螳れ 覈 覿襯 誤蠍  
) weight, bias
 ) xor_nn_summary_scalar_hist.py
with tf.name_scope('Layer1'):
W1 = tf.Variable(tf.random_normal([2, 10]), name='weight1')
b1 = tf.Variable(tf.random_normal([10]), name='bias1')
layer1 = tf.sigmoid(tf.matmul(X, W1) + b1)
W1_hist = tf.summary.histogram('weights1',W1)
b1_hist = tf.summary.histogram('biases1',b1)
layer1_hist = tf.summary.histogram('layer1',layer1)
危 tf.summary.scalar 螻殊 
)  覲企 覃(HISTOGRAM tab)
Tensorboard (multiple_run)
 螳  螳 觜蟲螻  ,  蟆暑 覦 觜蟲螻 parameter 
螳 螳 磯  蟆暑襯 襷れ 蠏碁襯 ロ伎朱 .
 )
train =tf.train.GradientDescentOptimizer(learning_rate=0.1).minimize(cost)
tf.summary.FileWriter(./logs/lr0.01)

train =tf.train.GradientDescentOptimizer(learning_rate=0.01).minimize(cost)
tf.summary.FileWriter(./logs/lr0.1)
tensorboard --logdir=./logs
[Lab 7-2]襯 谿瑚 Mnist 一危磯ゼ 覿 ,
Train set 伎 softmax classifier襯 牛 貊襯  れ 
1. with tf.name_scope(name) 伎 蠏碁襯 覲企 螳.
2. tf.summary.scalar()襯 伎 cost accuray襯 覲企 epoch 磯 蠏碁襯
蠏碁Μ螻 覲企 覃伎 貂′.
3. tf.summary.histogram() 伎 w b histogram 覲企 願 epoch
 磯ジ w b 覲襯 覿.
* 螳 螻殊 覲企 覃伎 貂′ 覲願 燕.
豢螻殊1 (11 15手讌 豢)  mnist 一危  伎 覲企
[Lab 10] 谿瑚 image.csv 殊 一危磯ゼ 曙 4/5襯 training set朱 螻
襾語 1/5 test set朱, training set 伎 softmax classifier襯 
螻 test set 伎 襯 豸′. (蠍磯蓋  (epoch) 2,000)
れ 螳 蟆曙一 襷蟆 牛蟆曙 覲蟆渚 牛  test set 襯 觜蟲.
1. 豸旧 1豸旧朱   vs 豸旧 3豸旧朱  
2. 豸旧 3豸旧 softmax classification
Xavier initializer 伎 vs random normal initializer
3. 豸旧 3願 xavier豐蠍壱襯  貊
dropout (keep_prob=0.7)  vs dropout  讌  
豢螻殊2 (11 15手讌 豢)  deep softmax classification
豢 蠍壱
 豢 蠍壱
 1谿 : 11 15 蟾讌 (10 襷 豈)
 2谿 : 11 22 蟾讌(7 襷 豈)
 危 豢 覩語豢襦 螳譯( )
 豢 覦覯
1) Source 貊 (.py)
2) ろ 蟆郁骸 覃 貂′伎 燕 覲願
3) 1)螻 2)襯 启 l  豢 企 貂殊れ 豢.
4) 启 覦 朱 : CS00_螻殊覯_覯_企
豢
[Lab11] CNN
 Cifar10 60,000螳 32x32 color image(training image : 50,000螳, test image : 10,000螳)襦 企
 . (Download site https://www.cs.toronto.edu/~kriz/cifar.html)
 10螳 企(airplane, automobile, bird, cat, deer, dog, frog, horse, ship, truck)襯 螳讌螻 .
 Baseline results
- cuda-convnet : CNN 牛  18% ろ る 螳讌
Cifar10 Dataset
 Cifar-10 python version れ 覦.
 れ企  殊 豢 覃 れ螻 螳 朱れ 詞  .
 train set 10,000螳 5螳襦 伎 .
Cifar10 Dataset Download
企Ν!!
1) unpickle 一危一 襭蟲譟磯 (dictionary)企
key襦 data labels襯 螳讌   .
2) 1~5襦 伎 train 一危磯ゼ 豎譯手 feature label
襦  螻殊 .
 Cifar10 一危磯ゼ 至鍵 伎 unpickle企朱 襯 .
Cifar10 Dataset Download
[谿語^] https://www.cs.toronto.edu/~kriz/cifar.html)
ロ 蟆暑
 Cifar10 一危磯ゼ Download螻 企ゼ numpy   npy襦 襷れ伎朱 貊襯 螻
 螻牛 れ 襯 觚企Ν.
 れ  螳 殊 焔.
 npy 殊 れ螻 螳 曙  .
Cifar10 Dataset Download
[Note] Cifar10 train一危磯 50,000螳企, 螳 れ
RGB 3豈 螳讌 32x32企語襯 螳螳 1x3072 覯″磯
 .
 [Lab 11-2]襯 谿瑚 trainX.npy, trainY.npy, testX.npy, testY.npy殊 一危磯ゼ 曙
覩碁 覦一 伎襯 100朱  一危磯ゼ  旧る CNN 蟲螻, 蟾螻 蟆
(deep and wide) 蟲譟磯ゼ 覲貅螳覃伎 test accuracy螳 螳  覈語 谿場殊.
ろ 蟆郁骸襯 貂′螻 覲願襯 燕.
(, 覈語  伎襯 覈 狩覃   code seed襯 tf.set_random_seed(0)
朱 れ.)
豢螻殊 (11 29手讌 豢)  CNN
豢 蠍壱
 豢 蠍壱
 1谿 : 11 29 蟾讌 (10 襷 豈)
 2谿 : 12 06 蟾讌(7 襷 豈)
 危 豢 覩語豢襦 螳譯( )
 豢 覦覯
1) Source 貊 (.py)
2) ろ 蟆郁骸 覃 貂′伎 燕 覲願
3) 1)螻 2)襯 启 l  豢 企 貂殊れ 豢.
4) 启 覦 朱 : CS06_螻殊覯_覯_企
豢

More Related Content

Similar to Mylab (20)

LeNet & GoogLeNet
LeNet & GoogLeNetLeNet & GoogLeNet
LeNet & GoogLeNet
Institute of Agricultural Machinery, NARO
R 襦蠏碁 危伎 v1.1
R 襦蠏碁 危伎  v1.1R 襦蠏碁 危伎  v1.1
R 襦蠏碁 危伎 v1.1
happychallenge
[SWCON211] LectureCode_13_Matlab Practice.pptx
[SWCON211] LectureCode_13_Matlab Practice.pptx[SWCON211] LectureCode_13_Matlab Practice.pptx
[SWCON211] LectureCode_13_Matlab Practice.pptx
oreo329
覯 ろ り 襦: EMPOS-II襯 企 糾鍵
覯 ろ り 襦: EMPOS-II襯  企 糾鍵覯 ろ り 襦: EMPOS-II襯  企 糾鍵
覯 ろ り 襦: EMPOS-II襯 企 糾鍵
Daegi Kim
炎豸 一危 螳 一 AI 蟆曙 1
炎豸 一危  螳 一 AI 蟆曙 1 炎豸 一危  螳 一 AI 蟆曙 1
炎豸 一危 螳 一 AI 蟆曙 1
DACON AI 一伎
求 メメ 求 ≡梶梶
求 メメ 求 ≡梶梶求 メメ 求 ≡梶梶
求 メメ 求 ≡梶梶
Seungyong Lee
覿伎る 覲 覦, From c++98 to c++11, 14
覿伎る 覲 覦, From c++98 to c++11, 14 覿伎る 覲 覦, From c++98 to c++11, 14
覿伎る 覲 覦, From c++98 to c++11, 14
覈 蟾
伎2.7 蠍一 螻給 蟆 襴
伎2.7 蠍一 螻給 蟆 襴伎2.7 蠍一 螻給 蟆 襴
伎2.7 蠍一 螻給 蟆 襴
Booseol Shin
[蟆暑蠍一] 殊碁蟲
[蟆暑蠍一] 殊碁蟲[蟆暑蠍一] 殊碁蟲
[蟆暑蠍一] 殊碁蟲
jaypi Ko
企脚襴_仰螻殊喝伎蠏.沿沿岳恰
企脚襴_仰螻殊喝伎蠏.沿沿岳恰企脚襴_仰螻殊喝伎蠏.沿沿岳恰
企脚襴_仰螻殊喝伎蠏.沿沿岳恰
tangtang1026
Image Deep Learning る伎
Image Deep Learning る伎Image Deep Learning る伎
Image Deep Learning る伎
Youngjae Kim
NDC 2017 NEXON ZERO (レ 襦) 蟆 れ螳朱 貊 覦 蟆 覲 讌蠍
NDC 2017  NEXON ZERO (レ 襦) 蟆 れ螳朱 貊  覦 蟆 覲 讌蠍NDC 2017  NEXON ZERO (レ 襦) 蟆 れ螳朱 貊  覦 蟆 覲 讌蠍
NDC 2017 NEXON ZERO (レ 襦) 蟆 れ螳朱 貊 覦 蟆 覲 讌蠍
Jaeseung Ha
襭蟲譟 Project2
襭蟲譟 Project2襭蟲譟 Project2
襭蟲譟 Project2
KoChungWook
ル螻 觚襭れ, Apache MXNet 螻牛蠍 - れ谿 (AWS 覦るΜろ) り (殊 SDS)
ル螻 觚襭れ, Apache MXNet 螻牛蠍 - れ谿 (AWS 覦るΜろ) り (殊 SDS)ル螻 觚襭れ, Apache MXNet 螻牛蠍 - れ谿 (AWS 覦るΜろ) り (殊 SDS)
ル螻 觚襭れ, Apache MXNet 螻牛蠍 - れ谿 (AWS 覦るΜろ) り (殊 SDS)
Amazon Web Services Korea
蟲覩朱蟲 螻蠍 ろ 襦 #1
蟲覩朱蟲 螻蠍 ろ 襦 #1蟲覩朱蟲 螻蠍 ろ 襦 #1
蟲覩朱蟲 螻蠍 ろ 襦 #1
dldmsmchddldmschd
Tfk 6618 tensor_flowメ求求п_r10_mariocho
Tfk 6618 tensor_flowメ求求п_r10_mariochoTfk 6618 tensor_flowメ求求п_r10_mariocho
Tfk 6618 tensor_flowメ求求п_r10_mariocho
Mario Cho
Monitoring System for DevOps - Case of MelOn
Monitoring System for DevOps - Case of MelOnMonitoring System for DevOps - Case of MelOn
Monitoring System for DevOps - Case of MelOn
Dataya Nolja
Custom DevOps Monitoring System in MelOn (with InfluxDB + Telegraf + Grafana)
Custom DevOps Monitoring System in MelOn (with InfluxDB + Telegraf + Grafana)Custom DevOps Monitoring System in MelOn (with InfluxDB + Telegraf + Grafana)
Custom DevOps Monitoring System in MelOn (with InfluxDB + Telegraf + Grafana)
Seungmin Yu
About Visual C++ 10
About  Visual C++ 10About  Visual C++ 10
About Visual C++ 10
ル旭 豕
R 襦蠏碁 危伎 v1.1
R 襦蠏碁 危伎  v1.1R 襦蠏碁 危伎  v1.1
R 襦蠏碁 危伎 v1.1
happychallenge
[SWCON211] LectureCode_13_Matlab Practice.pptx
[SWCON211] LectureCode_13_Matlab Practice.pptx[SWCON211] LectureCode_13_Matlab Practice.pptx
[SWCON211] LectureCode_13_Matlab Practice.pptx
oreo329
覯 ろ り 襦: EMPOS-II襯 企 糾鍵
覯 ろ り 襦: EMPOS-II襯  企 糾鍵覯 ろ り 襦: EMPOS-II襯  企 糾鍵
覯 ろ り 襦: EMPOS-II襯 企 糾鍵
Daegi Kim
炎豸 一危 螳 一 AI 蟆曙 1
炎豸 一危  螳 一 AI 蟆曙 1 炎豸 一危  螳 一 AI 蟆曙 1
炎豸 一危 螳 一 AI 蟆曙 1
DACON AI 一伎
求 メメ 求 ≡梶梶
求 メメ 求 ≡梶梶求 メメ 求 ≡梶梶
求 メメ 求 ≡梶梶
Seungyong Lee
覿伎る 覲 覦, From c++98 to c++11, 14
覿伎る 覲 覦, From c++98 to c++11, 14 覿伎る 覲 覦, From c++98 to c++11, 14
覿伎る 覲 覦, From c++98 to c++11, 14
覈 蟾
伎2.7 蠍一 螻給 蟆 襴
伎2.7 蠍一 螻給 蟆 襴伎2.7 蠍一 螻給 蟆 襴
伎2.7 蠍一 螻給 蟆 襴
Booseol Shin
[蟆暑蠍一] 殊碁蟲
[蟆暑蠍一] 殊碁蟲[蟆暑蠍一] 殊碁蟲
[蟆暑蠍一] 殊碁蟲
jaypi Ko
企脚襴_仰螻殊喝伎蠏.沿沿岳恰
企脚襴_仰螻殊喝伎蠏.沿沿岳恰企脚襴_仰螻殊喝伎蠏.沿沿岳恰
企脚襴_仰螻殊喝伎蠏.沿沿岳恰
tangtang1026
Image Deep Learning る伎
Image Deep Learning る伎Image Deep Learning る伎
Image Deep Learning る伎
Youngjae Kim
NDC 2017 NEXON ZERO (レ 襦) 蟆 れ螳朱 貊 覦 蟆 覲 讌蠍
NDC 2017  NEXON ZERO (レ 襦) 蟆 れ螳朱 貊  覦 蟆 覲 讌蠍NDC 2017  NEXON ZERO (レ 襦) 蟆 れ螳朱 貊  覦 蟆 覲 讌蠍
NDC 2017 NEXON ZERO (レ 襦) 蟆 れ螳朱 貊 覦 蟆 覲 讌蠍
Jaeseung Ha
襭蟲譟 Project2
襭蟲譟 Project2襭蟲譟 Project2
襭蟲譟 Project2
KoChungWook
ル螻 觚襭れ, Apache MXNet 螻牛蠍 - れ谿 (AWS 覦るΜろ) り (殊 SDS)
ル螻 觚襭れ, Apache MXNet 螻牛蠍 - れ谿 (AWS 覦るΜろ) り (殊 SDS)ル螻 觚襭れ, Apache MXNet 螻牛蠍 - れ谿 (AWS 覦るΜろ) り (殊 SDS)
ル螻 觚襭れ, Apache MXNet 螻牛蠍 - れ谿 (AWS 覦るΜろ) り (殊 SDS)
Amazon Web Services Korea
蟲覩朱蟲 螻蠍 ろ 襦 #1
蟲覩朱蟲 螻蠍 ろ 襦 #1蟲覩朱蟲 螻蠍 ろ 襦 #1
蟲覩朱蟲 螻蠍 ろ 襦 #1
dldmsmchddldmschd
Tfk 6618 tensor_flowメ求求п_r10_mariocho
Tfk 6618 tensor_flowメ求求п_r10_mariochoTfk 6618 tensor_flowメ求求п_r10_mariocho
Tfk 6618 tensor_flowメ求求п_r10_mariocho
Mario Cho
Monitoring System for DevOps - Case of MelOn
Monitoring System for DevOps - Case of MelOnMonitoring System for DevOps - Case of MelOn
Monitoring System for DevOps - Case of MelOn
Dataya Nolja
Custom DevOps Monitoring System in MelOn (with InfluxDB + Telegraf + Grafana)
Custom DevOps Monitoring System in MelOn (with InfluxDB + Telegraf + Grafana)Custom DevOps Monitoring System in MelOn (with InfluxDB + Telegraf + Grafana)
Custom DevOps Monitoring System in MelOn (with InfluxDB + Telegraf + Grafana)
Seungmin Yu
About Visual C++ 10
About  Visual C++ 10About  Visual C++ 10
About Visual C++ 10
ル旭 豕

More from Lee Gyeong Hoon (8)

Vae
VaeVae
Vae
Lee Gyeong Hoon
Svmtf
SvmtfSvmtf
Svmtf
Lee Gyeong Hoon
The fastalgorithmfordeepbeliefnets
The fastalgorithmfordeepbeliefnetsThe fastalgorithmfordeepbeliefnets
The fastalgorithmfordeepbeliefnets
Lee Gyeong Hoon
Convolutional rnn
Convolutional rnnConvolutional rnn
Convolutional rnn
Lee Gyeong Hoon
碁碁 20170929
碁碁 20170929碁碁 20170929
碁碁 20170929
Lee Gyeong Hoon
Where to Apply Dropout in Recurrent Neural Networks for Handwriting Recognition?
Where to Apply Dropout in Recurrent Neural Networks for Handwriting Recognition?Where to Apply Dropout in Recurrent Neural Networks for Handwriting Recognition?
Where to Apply Dropout in Recurrent Neural Networks for Handwriting Recognition?
Lee Gyeong Hoon

Mylab

  • 1. [Lab1] Basic Tensorflow Prepared by Gyeong-hoon Lee Data Mining Lab. 503 E-mail : ghlee0304@cnu.ac.kr
  • 2. 1) prompt谿曙 れ ロ. pip3 install -upgrade tensorflow 2) tensorflow windows 蟆曙 C++ 2015 覦壱 れ螳 . るジ讓 襷一 企Ν 危 襷 願鍵 https://www.microsoft.com/en-us/download/details.aspx?id=53587 How to Install Tensorflow (1)
  • 3. 3) れ企 殊 れ How to Install Tensorflow (2) 豌危 れ 企Ν れ企 れ
  • 4. How to Install Tensorflow (3) 4) れ螳 襭給. 企ゼ 誤蠍 伎 れ螻 螳 讌. C:> python >>> import tensorflow as tf >>> tf.__version__ 1.2.1 >>> a = tf.constant(1) >>> b = tf.constant(2) >>> c = tf.add(a, b) >>> sess = tf.Session() >>> print(sess.run(c)) 3 <cmd ろ覃 > <idle ろ 覃>
  • 5. Python Libraries for numerical computation in tensorflow - numpy : 覦一伎 伎 豺 螻一 觜襯願 蠍 殊企襴 [tutorial site] https://docs.scipy.org/doc/numpy-dev/user/quickstart.html >>> pip3 install numpy - pandas : 企, 襴讀 煙 襭 伎 一危磯ゼ 所 る蠍 殊企襴 [tutorial site] http://pandas.pydata.org/pandas-docs/stable/10min.html >>> pip3 install pandas - matplotlib : 一危一 覿 豢 煙 蠏碁襯 牛 誤 殊企襴 [tutorial site] https://matplotlib.org/users/pyplot_tutorial.html >>> pip3 install matplotlib Other libraries
  • 6. Tensorflow 襭蟲譟 : Constant Constant れ梗 螳 螳豌企 朱 覲蟆渚伎. 磯Μ螳 燕 碁 覲襯 覿蠍 伎 覓語伎 name 朱誤磯ゼ .
  • 7. 1) placeholder 襦覿 れ 螳 覦蠍 襴(place)襯 讌螻(hold) 碁 磯殊 煙 螳 螳讌讌 2) feed_dict (feed dictionary) - 蠏碁 placeholder 碁 螳 ロ 覃, 蠏 螳れ , 覓語, 襴ろ, numpy 覦一伎 - 伎 (dictionary) {key :value} 螳讌 襭 Tensorflow 襭蟲譟 : PlaceHolder input螳 襭 int or float 焔 input 覈 tensor shape node 企 () () ()
  • 8. Tensorflow 襭蟲譟 : PlaceHolder - Example 3) placeholder shape ) shape = [] : 0谿 , れ梗 - shape = [3] : 1谿 - shape = [1,3] : 2谿 * 覈(shape) 螳 襦 一一 螳ロ. 4) placeholder feed_dict襦 螳 - sess.run(, feed_dict={伎ろ : 螳})
  • 10. 1. 誤磯 螳 Lab01:Tensorflow 蠍磯蓋 殊企 in [ ]. 朱 觚襦れ 谿襦襦 豢螳願覃伎 ろ企慨螻 ろ 蟆郁骸 覃伎 貂′伎 覲願 襴. 豢螻殊-1 (10 11手讌 豢)
  • 11. 豢螻殊-2 (10 11手讌 豢) 2. れ 蠏碁襦 蟲 貊襯 燕螻 - a b襯 tf.constant 5 3朱 蟲 - a b襯 tf.placeholder襯 伎 蟲螻 (a,b)=(1,2), (3,4), (5,6),(7,8), (9,10) 蟶朱 ろ 襦 rank 1 襦 ロ 5 3 input input mul add add 23 a b c d e
  • 12. Tensorflow 襭蟲譟 : Variable Variable 襾語 煙 螳 磯 覲蟆暑 螳 ロ 覦覯 . Session.run() 語 讌覃伎 覲蟆 螳ロ 螳 覲願蠍 Variable 螳豌企ゼ . , 豐蠍壱襯 讌 朱 variable 螳 轟 讌 朱襦 覦 tf.global_variables_initializer() 襯 ろ伎狩. 豐蠍郁 讌 讌伎朱 覦覯螻 覓伎 豐蠍郁 燕 襯 伎 覦覯 . Variable - example
  • 13. tf.reduce_mean tf.reduce_mean tf.reduce_mean example x = np.array([[1,2,3], [4,5,6], [7,8,9]]) a = tf.reduce_mean(x,axis=0) [4 5 6] a = tf.reduce_mean(x,axis=1) [2 5 8] a = tf.reduce_mean(x) 5 x = np.array([[1, 2, 3], [4, 5, 6], [7, 8, 9]]) x = np.array([[1, 2, 3], [4, 5, 6], [7, 8, 9]]) 4 5 6 2 5 8 case 1 : axis=0 case 2 : axis=1
  • 14. tf.assign tf.assign 覲 襦 螳 麹蠍 . Example 1 a = tf.Variable(initial_value=3, dtype = tf.float32) b = tf.assign(a,1) or a.assign(1) sess = tf.Session() sess.run(tf.global_variables_initializer()) print(sess.run(a)) 3.0 print(sess.run(b)) 1.0 print(sess.run(a)) 1.0
  • 15. How to load and save data np.loadtxt(filename, dtype, delimiter, skiprows) Example import numpy as np np.loadtxt(".../data.csv", delimiter=',', dtype=np.float32) # skiprows = n 蟆曙, n覯讌 譴蟾讌 誤螻 覿. np.savetxt(filename, X, delimiter) Example import numpy as np a = np.array([[1,2,3],[4,5,6],[7,8,9]]) np.savetxt(".../data.csv", a, delimiter=',')
  • 16. 3. 誤磯 螳 Lab02 (linear regression) 殊企 Full code with placeholder伎 貊襯 れ 一危磯ゼ 螳讌螻 ろ企慨螻 ろ 蟆郁骸 覃伎 貂′伎 覲願 襴. X=[1,2,3,4,,10], Y=[2.2, 5.2, 6.1, 7.9, 10.5, 11.8, 15, 16, 18.2, 20] 4. 誤磯 螳 Lab03 (linear regression cost 豕) 殊企襯 谿瑚 3覯 一危磯ゼ 螳讌螻 cost 蠏碁襯 蠏碁Μ螻 ろ覃伎 貂′伎 覲願 豢螳 5. data.csv 殊 一危磯ゼ 曙 4/5襯 training set朱 螻 襾語 1/5 test set朱 伎, training set朱 linear regression test set 豌 れ 豸♀螻 れ螳 襴壱誤螻, 豌 cost 蠏螳 襴壱誤 貊襯 燕螻 ろ誤. 豢螻殊-3 (10 11手讌 豢)
  • 17. 豢螻殊 豢 蠍壱 1谿 : 10 12 蟾讌 (10 襷 豈) 2谿 : 10 12 れ 螳 蟾讌(7 襷 豈) 危 豢 覩語豢襦 螳譯( ) 豢 覦覯 1) Source 貊 (.py) 2) ろ 蟆郁骸 覃 貂′伎 燕 覲願 3) 1)螻 2)襯 启 l 豢 企 貂殊れ 豢. 4) 启 覦 朱 : CS00_螻殊覯_覯_企 豢
  • 19. Hypothesis : linear function Prediction : 豸♀ 0.5覲企 襯 蠍一朱 class label 蟆一 magic.csv 殊 一危磯ゼ 曙 4/5襯 training set朱 螻 襾語 1/5 test set朱 , training set朱 linear classification test set accuracy襯 蟲 襴壱誤 貊襯 燕. Step 企至 れ伎 test set accuracy襯 詞 讌 螻ろ伎 . 豢螻殊1 (10 25手讌 豢) linear hypothesis 伎 classification
  • 20. Hypothesis : logistic function Prediction : 豸♀ 0.5覲企 襯 蠍一朱 class label 蟆一 magic.csv 殊 一危磯ゼ 曙 4/5襯 training set朱 螻 襾語 1/5 test set朱 , training set朱 logistic classification test set accuracy襯 蟲 襴壱誤 貊襯 燕. Step 企至 れ伎 test set accuracy襯 詞 讌 螻ろ伎 . magic.csv : Data are MC generated to simulate registration of high energy gamma particles in an atmospheric Cherenkov telescope instance 19020螳, feature: 10螳, class: 2螳 豢螻殊2 (10 25手讌 豢) logistic classification
  • 21. Lab06 殊企 貊襯 谿瑚 image.csv 殊 一危磯ゼ 曙 4/5襯 training set朱 螻 襾語 1/5 test set朱, training set朱 softmax classification test set 襯 襴壱誤 貊襯 燕. Step 企至 れ伎 test set accuracy襯 詞 讌 螻ろ伎 . magic.csv : 殊 企語 一危磯 覯暑覃, , , 覃, 谿, 蟆暑, 襯 企 企る 企伎 instance 2310螳, feature: 19螳, class: 7螳 豢螻殊3 (10 25手讌 豢) softmax classification
  • 22. 豢螻殊 豢 蠍壱 1谿 : 10 25 蟾讌 (10 襷 豈) 2谿 : 10 25 れ 螳 蟾讌(7 襷 豈) 危 豢 覩語豢襦 螳譯( ) 豢 覦覯 1) Source 貊 (.py) 2) ろ 蟆郁骸 覃 貂′伎 燕 覲願 3) 1)螻 2)襯 启 l 豢 企 貂殊れ 豢. 4) 启 覦 朱 : CS00_螻殊覯_覯_企 豢
  • 24. [Lab 7-2]襯 谿瑚 Mnist 一危磯ゼ 覿 , Training set朱 softmax classification 覈語 牛螻 襷 epoch襷 train螻 validation, test set 襯 豸′ ロ Epoch 磯ジ Train, validation, test set 襯 蠏碁襦 蠏碁 觜蟲 Learning rate襯 0.01, 0.1, 0.5襦 蟆郁骸れ 觜蟲伎 覿 豢螻殊3 (11 1手讌 豢) mnist 一危磯ゼ 伎 softmax classification
  • 25. matplotlib 殊企襴襯 伎 蠏碁襯 蠏碁Π. Example) import matplotlib.pyplot as plt import numpy as np fig = plt.figure() data1 = np.array([1,2,3,4,5,6,7,8,9,10]) data2 = data1**2 plt.plot(data1, k--, lable=data1) plt.plot(data2, r--, lable=data2) plt.legend() #覯襦 plt.show() #蠏碁 覲伎願鍵 蠏碁 蠏碁Μ蠍(matplotlib 伎) * 谿瑚 : https://matplotlib.org/index.html
  • 26. 豢 螻殊 豢 蠍壱 1谿 : 11 1 蟾讌 (10 襷 豈) 2谿 : 11 8 蟾讌(7 襷 豈) 危 豢 覩語豢襦 螳譯( ) 豢 覦覯 1) Source 貊 (.py) 2) ろ 蟆郁骸 覃 貂′伎 燕 覲願 3) 1)螻 2)襯 启 l 豢 企 貂殊れ 豢. 4) 启 覦 朱 : CS00_螻殊覯_覯_企 豢
  • 28. Tensorboard (tf.summary.FileWriter覯) tf.summary.FileWriter(name) writer = tf.summary.FileWriter(dirname) writer.add_graph(sess.graph) Example Step1) py殊 襷れ れ 燕螻 ろ import tensorflow as tf a = tf.constant(1,name='input_a') b = tf.constant(2,name='input_b') c = tf.add(a,b,name='sum_c') sess = tf.Session() writer = tf.summary.FileWriter("./board1") writer.add_graph(sess.graph) Step2) board1 启螳 蟆朱讌 蟆暑 れ board1 启 殊 蟆朱讌
  • 29. Tensorboard Step3) cmd谿曙 願 board1 启蟾讌 企 D:/SL/board1 朱 Step4) cmd谿曙 れ tensorboard -logdir=board1 譯殊襯 chrome 覿 l朱 るジ讓所骸 螳 蠏碁殊 ) 覲企 覃
  • 30. Tensorboard (覲旧″ ) xor_nn.py xor覓語襯 蠍 豸旧朱 襷 蟲譟 W1 = tf.Variable(tf.random_normal([2, 2]), name='weight1') b1 = tf.Variable(tf.random_normal([2]), name='bias1') layer1 = tf.sigmoid(tf.matmul(X, W1) + b1) W2 = tf.Variable(tf.random_normal([2, 1]), name='weight2') b2 = tf.Variable(tf.random_normal([1]), name='bias2') hypothesis = tf.sigmoid(tf.matmul(layer1, W2) + b2) ) 覲企 覃 xor_nn.py * 豸旧朱 襷 螳 蟲譟一 覲企 磯Μ螳 襷 碁(襯 れ weight bias) 危エ覲願鍵螳 企給.
  • 31. Tensorboard (with tf.name_scope(name)覯) with tf.name_scope(name) 碁襯 螳蠍 ク襦 企朱 覓玖鍵 . ) xor_nn_name_scope.py with tf.name_scope('Layer1'): W1 = tf.Variable(tf.random_normal([2, 10]), name='weight1') b1 = tf.Variable(tf.random_normal([10]), name='bias1') layer1 = tf.sigmoid(tf.matmul(X, W1) + b1) with tf.name_scope('Layer2'): W2 = tf.Variable(tf.random_normal([10, 10]), name='weight2') b2 = tf.Variable(tf.random_normal([10]), name='bias2') layer2 = tf.sigmoid(tf.matmul(layer1, W2) + b2) ) 覲企 覃 xor_nn_name_scope.py
  • 32. Tensorboard (tf.summary.scalar) tf.summary.scalar(name, value) 碁 scalar 企麹 螳れ 覈 豢企ゼ 危 ) cost, accuracy, entropy ) xor_nn_summary_scalar_hist.py cost = -tf.reduce_mean(Y * tf.log(hypothesis) + (1 - Y)*tf.log(1 - hypothesis)) cost_scalar = tf.summary.scalar('cost',cost) summary = tf.summary.merge_all() with tf.Session() as sess: writer = tf.summary.FileWriter("./board4") writer.add_graph(sess.graph) for step in range(10001): s,_ = sess.run([summary,train], feed_dict={X: x_data, Y: y_data}) writer.add_summary(s, global_step=step) ) 覲企 覃(SCALARS tab)
  • 33. Tensorboard (tf.summary.histogram) tf.summary.histogram(name, value) 碁 vector 企麹 螳れ 覈 覿襯 誤蠍 ) weight, bias ) xor_nn_summary_scalar_hist.py with tf.name_scope('Layer1'): W1 = tf.Variable(tf.random_normal([2, 10]), name='weight1') b1 = tf.Variable(tf.random_normal([10]), name='bias1') layer1 = tf.sigmoid(tf.matmul(X, W1) + b1) W1_hist = tf.summary.histogram('weights1',W1) b1_hist = tf.summary.histogram('biases1',b1) layer1_hist = tf.summary.histogram('layer1',layer1) 危 tf.summary.scalar 螻殊 ) 覲企 覃(HISTOGRAM tab)
  • 34. Tensorboard (multiple_run) 螳 螳 觜蟲螻 , 蟆暑 覦 觜蟲螻 parameter 螳 螳 磯 蟆暑襯 襷れ 蠏碁襯 ロ伎朱 . ) train =tf.train.GradientDescentOptimizer(learning_rate=0.1).minimize(cost) tf.summary.FileWriter(./logs/lr0.01) train =tf.train.GradientDescentOptimizer(learning_rate=0.01).minimize(cost) tf.summary.FileWriter(./logs/lr0.1) tensorboard --logdir=./logs
  • 35. [Lab 7-2]襯 谿瑚 Mnist 一危磯ゼ 覿 , Train set 伎 softmax classifier襯 牛 貊襯 れ 1. with tf.name_scope(name) 伎 蠏碁襯 覲企 螳. 2. tf.summary.scalar()襯 伎 cost accuray襯 覲企 epoch 磯 蠏碁襯 蠏碁Μ螻 覲企 覃伎 貂′. 3. tf.summary.histogram() 伎 w b histogram 覲企 願 epoch 磯ジ w b 覲襯 覿. * 螳 螻殊 覲企 覃伎 貂′ 覲願 燕. 豢螻殊1 (11 15手讌 豢) mnist 一危 伎 覲企
  • 36. [Lab 10] 谿瑚 image.csv 殊 一危磯ゼ 曙 4/5襯 training set朱 螻 襾語 1/5 test set朱, training set 伎 softmax classifier襯 螻 test set 伎 襯 豸′. (蠍磯蓋 (epoch) 2,000) れ 螳 蟆曙一 襷蟆 牛蟆曙 覲蟆渚 牛 test set 襯 觜蟲. 1. 豸旧 1豸旧朱 vs 豸旧 3豸旧朱 2. 豸旧 3豸旧 softmax classification Xavier initializer 伎 vs random normal initializer 3. 豸旧 3願 xavier豐蠍壱襯 貊 dropout (keep_prob=0.7) vs dropout 讌 豢螻殊2 (11 15手讌 豢) deep softmax classification
  • 37. 豢 蠍壱 豢 蠍壱 1谿 : 11 15 蟾讌 (10 襷 豈) 2谿 : 11 22 蟾讌(7 襷 豈) 危 豢 覩語豢襦 螳譯( ) 豢 覦覯 1) Source 貊 (.py) 2) ろ 蟆郁骸 覃 貂′伎 燕 覲願 3) 1)螻 2)襯 启 l 豢 企 貂殊れ 豢. 4) 启 覦 朱 : CS00_螻殊覯_覯_企 豢
  • 39. Cifar10 60,000螳 32x32 color image(training image : 50,000螳, test image : 10,000螳)襦 企 . (Download site https://www.cs.toronto.edu/~kriz/cifar.html) 10螳 企(airplane, automobile, bird, cat, deer, dog, frog, horse, ship, truck)襯 螳讌螻 . Baseline results - cuda-convnet : CNN 牛 18% ろ る 螳讌 Cifar10 Dataset
  • 40. Cifar-10 python version れ 覦. れ企 殊 豢 覃 れ螻 螳 朱れ 詞 . train set 10,000螳 5螳襦 伎 . Cifar10 Dataset Download 企Ν!!
  • 41. 1) unpickle 一危一 襭蟲譟磯 (dictionary)企 key襦 data labels襯 螳讌 . 2) 1~5襦 伎 train 一危磯ゼ 豎譯手 feature label 襦 螻殊 . Cifar10 一危磯ゼ 至鍵 伎 unpickle企朱 襯 . Cifar10 Dataset Download [谿語^] https://www.cs.toronto.edu/~kriz/cifar.html) ロ 蟆暑
  • 42. Cifar10 一危磯ゼ Download螻 企ゼ numpy npy襦 襷れ伎朱 貊襯 螻 螻牛 れ 襯 觚企Ν. れ 螳 殊 焔. npy 殊 れ螻 螳 曙 . Cifar10 Dataset Download [Note] Cifar10 train一危磯 50,000螳企, 螳 れ RGB 3豈 螳讌 32x32企語襯 螳螳 1x3072 覯″磯 .
  • 43. [Lab 11-2]襯 谿瑚 trainX.npy, trainY.npy, testX.npy, testY.npy殊 一危磯ゼ 曙 覩碁 覦一 伎襯 100朱 一危磯ゼ 旧る CNN 蟲螻, 蟾螻 蟆 (deep and wide) 蟲譟磯ゼ 覲貅螳覃伎 test accuracy螳 螳 覈語 谿場殊. ろ 蟆郁骸襯 貂′螻 覲願襯 燕. (, 覈語 伎襯 覈 狩覃 code seed襯 tf.set_random_seed(0) 朱 れ.) 豢螻殊 (11 29手讌 豢) CNN
  • 44. 豢 蠍壱 豢 蠍壱 1谿 : 11 29 蟾讌 (10 襷 豈) 2谿 : 12 06 蟾讌(7 襷 豈) 危 豢 覩語豢襦 螳譯( ) 豢 覦覯 1) Source 貊 (.py) 2) ろ 蟆郁骸 覃 貂′伎 燕 覲願 3) 1)螻 2)襯 启 l 豢 企 貂殊れ 豢. 4) 启 覦 朱 : CS06_螻殊覯_覯_企 豢