SlideShare a Scribd company logo
Introduce
Career:

•LINE+

•Samsung Electronics

•NCSoft

•Joyon

• S/W
Interesting:

•Beer

•BTS, Oasis

•Games

•3D Graphics Engine

•Deep Learning

•
1. Background

2. AI Requirements

3. Deep Learning

•Dataset, Preprocessing

•Neural Networks

•Train/Test, Inference

4. Demo

5. A/B Test
Index
Background
AI ' ', ‘ '
.
AI
FSM(Finite State Machine) ,
AI .
AI
..
Problem
State


.
..
경우의 수 경우의 수
경우의 수경우의 수
경우의 수경우의 수
경우의 수
경우의 수
…
: 

“ 사람같은 AI 만들어주실 수 있나요? ”

:
“ 네? 사람같은 AI요?
‘사람같음’ 을 정의하기 어렵고, 경우의 수가 너무 많아요.. ”
Project
A Log-based Human Like Game AI.
Offline
AI Agent.
?
Our game planners needed a human-like defense AI
to play for players when they were offline..
AI requirements
1. When ( )
It predicts the Timing that a unit would be deployed.
2. Where ( )
It predicts the Location
that a unit would be deployed on a map (grid size: 42x35).
3. What ( )
It predicts the Cards that it would be picked.
Dataset
“ Action state 1446+1 Floating point ”
Index Meaningg
0 (Length: 1)
1~45 (Deck) (Length: 45)
46 ~ 945 (Length: 900)
946 ~ 1445 (Length: 500)
1446 Label (= Class, Action , ) (Length: 1)
0 1 2 3 4~6 7~9 10~12
•••
12 14 8 1
Unit Deck

2
Unit Deck
3
Unit Deck
4Player Unit
Cost
Unit Deck 1
Code Level Remain
Cost
46 47 48 49 50 51 52~57
•••
1446
10 6 21 13 0.78497 1
Unit 2
3
Unit 1 on Map
Code Level X Y Dead Rate Player Type Y(Class)
Index
Sample
Meaning
Index
Sample
Meaning
X DATA
Y DATA
Y = WX + B
Log format
1. => Players

2. => FrameCount

3. => BattleMap { ( / / /AI), ( / / / )}

4. => Action { ( ) }
Preprocessing
RAW file size 321.12 GB
Number of 

battle counts
450,967
Tools Spark, Mesos, Zeppelin, Hadoop
Language Scala
System CPU 4 Cores, RAM 256 GB, HDD 14.5 TB
“ !!”
RAW data
Parsing
using Spark, Zeppelin and Scala
“Zeppelin ”
Preprocessed data
“ ”
Preprocessing
RAW data file size => 321.12 GB
Preprocessed file size => 48.8 MB
4 Cores, RAM 256 GB => 7 !!
;;
, ???
..
Preprocessing
RAW file size 321.12 GB
Number of 

battle counts
450,967
Process time 21 mins
Preprocessed

file size
48.8 MB
Tools Spark, Mesos, Zeppelin, Hadoop
Language Scala
System CPU 160 Cores, RAM 512 GB, HDD 14.5 TB
Time
4 Cores, RAM 256 GB => 7 hours

160 Cores, RAM 512 GB => 21 mins
Speed up(x20)
Neural Networks
What & Where & When
Binary Classification
(Timing)
Regression
(Location)
using CNN
using LSTM
Multinomial Classification
(Card)
using CNN
1D Convolution + Softmax
1D Convolution + Regression
Stacked LSTM + Softmax
What ( )
1446 x 1 1446 x 32 723 x 32 723 x 64 362 x 64 362 x 128 (1 x 1) x 46336 (1 x 1) x 512 (1 x 1) x 10
0
1
2
3
4
5
6
7
8
9
(1 x 1) x 10
Deck

Mask
Max Pooling

(1 x 2)
1D Conv

(1 x 5)
1D Conv

(1 x 5)
Max Pooling

(1 x 2)
1D Conv

(1 x 5) Flatten
Fully

connected

512 neurons
Fully

connected

10 neurons
Softmax
(1 x 1) x 128
Fully

connected

128 neurons
(1 x 1) x 10
Class

(One Hot Encoding Index) 0 7 5 2
Input
if Argmax = 0
Loss: Cross-Entropy
tf.reduce_mean(tf.nn.softmax_cross_entropy_with_logits(Y, Y’))
0.5
Probability
0.01
0.03
0.01
0.05
0.01
0.07
0.02
0.2
0.1
Sum = 1.0
• Log data: 1 Dimension.

• Property SNAPSHOT data.

• Not SCREENSHOT(Image) data.
Where ( )
1446 x 1 1446 x 32 723 x 32 723 x 64 362 x 64 362 x 128 (1 x 1) x 46336 (1 x 1) x 1024 (1 x 1) x 2
Max Pooling

(1 x 2)
1D Conv

(1 x 5)
1D Conv

(1 x 5)
Max Pooling

(1 x 2)
1D Conv

(1 x 5)
Flatten
Fully

connected

1024 neurons
Fully

connected

2 neurons
Regression
(1 x 1) x 128
Fully

connected

128 neurons
(1 x 1) x 2
Input
(10, 10)
<Game Map Grid>
Loss: L2 Distance
tf.reduce_mean(tf.squared_difference(POS_X, POS_X’))

tf.reduce_mean(tf.squared_difference(POS_Y, POS_Y’))
32
42
10 (X)
10 (Y)
Index Value
• Log data:1 Dimension.

• Property SNAPSHOT data.

• Not SCREENSHOT(Image) data.
0
1
When ( )
0.28 0.72 Output
LSTMLSTM
States States StatesInput
Time t-3 t-2 t-1
Softmax
t
Prediction
“Action” “Wait” “Wait” “Output”
Stacked

LSTM
Sequence length: 3
Sample
LSTMLSTM
(30 x 10)
Class

(One Hot Encoding Index) 0 1
LSTM
Loss: Cross-Entropy
tf.reduce_mean(tf.nn.softmax_cross_entropy_with_logits(Y, Y’))
Fully connected layer
LSTM
Action
if Argmax = 1
Wait ActionMeaning
http://cs231n.stanford.edu/slides/2016/winter1516_lecture10.pdf
When
(Regression , Distribution)
0: Wait
1: Action
0: Wait
1: Action
Frame count
Frame count
Frame count
Frame count
import tensorflow as tf
import numpy as np
base_ch = 32
layer1 = ConvLayer(X, IS_TRAINING, input_ch=1, output_ch=base_ch, kernel_size=5, name='conv1')
layer1 = PReLU(layer1, shape=base_ch, name='relu1')
layer1 = PoolingLayer(layer1, kernel_size=2, name='pooling1')
layer2 = ConvLayer(layer1, IS_TRAINING, input_ch=base_ch, output_ch=base_ch * 2, kernel_size=5, name='conv2')
layer2 = PReLU(layer2, shape=base_ch*2, name='relu2')
layer2 = PoolingLayer(layer2, kernel_size=2, name='pooling2')
layer3 = ConvLayer(layer2, IS_TRAINING, input_ch=base_ch * 2, output_ch=base_ch * 4, kernel_size=5, name='conv3')
layer3 = PReLU(layer3, shape=base_ch * 4, name='relu3')
flattened_shape = np.prod([s.value for s in layer3.get_shape()[1:]])
flatten = tf.reshape(layer3, [-1, flattened_shape], name="flatten")
fc1 = FCLayer(flatten, name="fc1", n_out=512)
fc1 = ReLUDropout(fc1);
fc2 = FCLayer(fc1, name="fc2", n_out=128)
fc2 = ReLUDropout(fc2);
fc3 = FCLayer(fc2, name="fc3", n_out=num_of_classes)
output_layer = fc3
Train
import tensorflow as tf
X = tf.placeholder(tf.float32, [None, num_of_feature_elements, 1], name="input")
Y = tf.placeholder(tf.int32, [None, 1])
MASK = tf.placeholder(tf.float32, [None, num_of_classes], name="mask")
IS_TRAINING = tf.placeholder(tf.bool, [], name="is_training")
DROPOUT_KEEP_PROB = tf.placeholder(tf.float32, name="dropout_keep_prob")
output_layer = tf.multiply(output_layer, MASK)
HYPOTHESIS = tf.nn.softmax(output_layer)
COST = tf.reduce_mean(tf.nn.softmax_cross_entropy_with_logits(logits=output_layer, labels=Y_one_hot))
OPTIMIZER = tf.train.AdamOptimizer(learning_rate).minimize(COST)
PREDICTION = tf.argmax(HYPOTHESIS, 1, name="prediction")
correct_prediction = tf.equal(prediction, tf.argmax(Y_one_hot, 1))
ACCURACY = tf.reduce_mean(tf.cast(correct_prediction, tf.float32))
x_batch_data = x_batch_data[shuffle_idx]
y_batch_data = y_batch_data[shuffle_idx]
mask_batch_data = mask_batch_data[shuffle_idx]
_, loss, acc = sess.run([OPTIMIZER, COST, ACCURACY],
feed_dict={X: np.expand_dims(x_batch_data, axis=2),
Y: y_batch_data, MASK: mask_batch_data,
DROPOUT_KEEP_PROB: 0.7, IS_TRAINING: True})
Train
Deck
Backpropagation .
<https://en.wikipedia.org/wiki/Gradient_descent, https://lazyprogrammer.me/tag/gradient-descent>
Test
import tensorflow as tf
x_batch_data = x_data[batch_mask]
y_batch_data = y_data[batch_mask]
mask_batch_data = mask_data[batch_mask]
pred, pred_values = sess.run([PREDICTION, HYPOTHESIS],
feed_dict={X: np.expand_dims(x_batch_data, axis=2),
MASK: mask_batch_data, DROPOUT_KEEP_PROB: 1.0,
IS_TRAINING: False})
for p, y in zip(pred, y_batch_data.flatten()):
class_try_count_list[p][0] += 1
if p == int(y):
total_correct_count += 1
class_true_count_list[int(y)][0] += 1
Save training logs
Import os
import shutil
import datetime
import time
timestamep = datetime.datetime.now().strftime("%Y_%m_%d_%H_%M_%S")
save_path = root_path + "LV10_Save_CNN_WHAT_" + timestamep + "/"
result_train_file_path = save_path + "result_" + timestamep + ".txt"
if os.path.exists(save_path):
shutil.rmtree(save_path)
os.makedirs(save_path)
train_log_file = open(result_train_file_path, 'w')
def SaveAndPrint(file, str_message):
print(str_message, end="")
file.write(str_message)
file.flush()
Training logs
Open!
Training logs
,
,
.
Training logs
Hyperparameter
Input file
“ hidden size ?”
“ ?”
“ ?”
“X, Y Matrix shape ?”
X, Y
Training logs
Class
“ Step ?”
“Class ?”
“Ground Truth ?”
Training logs
Model
“ ?”
“ ?”
“ ?”
“ ?”
Log DB .
Training logs
Step Epoch Model Validation Code ,
Check .
,
Stop;
Hyperparameter .
(Batch size, Hidden size, Learning rate, RNN Sequence length, RNN Multi count, CNN layer count, CNN Filter size .. .. ;;)
AutoML ..
Experimental results
Gathering period 2018/03/13 ~ 04/24 ( 43 )
Number of battle counts 450,967
Total file size 321.12 GB
Neural Networks
CNN (Convolutional Neural Network)

LSTM (Long Short-Term Memory)
Tools Spark, Mesos, Zeppelin, Hadoop, Tensorflow, Unity3D
Language Python, Scala, C#, C
System GTX 1080, CPU i7-6700K, RAM 32GB, HDD 2TB
Accuracy for Card 83.99%
Accuracy for Timing 70.94%
Accuracy for Location 4.15 Distance (cm), (= 1 )
Level
(Blue) V.S. Ground Truth(Red)
Inference:
LineGameTensorFlow library
libLineGameTensorflow.dylib / .so
TensorFlow Library ,

Model Inference Native Library
Inference: Game Loop
Hybrid
• RuleSet
•
• AI On/Off
Card PickCard(DeckInfo userDeckInfo)
{
Card card = RuelSet.RandomPick( userDeckInfo );
if( bUseDeepAI ) {
Card deepAICard = PickByDeepAI( userDeckInfo );
if( null != deepAICard ) {
card = deepAICard;
}
}
return card;
}
Real-time inference
1 : ( )
2 : / ( , , )
1
2 if AI ,
// .
" C# MonoBehaviour Inference ”
// Inference .
// ( )
!!
(RuleSet) AI
V.S.
AI
A deep learning AI was trained by the player logs.

So, does it play like human?
Let’s watch clips!!
Demo: A
Demo: B
· 적절한 타이밍에 전략 구사
· 매번 다른 전략 구사
· 각개격파 전술 구사
· 즉각적
· 빠른 판단(대응)
· 코어 유저
· 능숙함
· 생각하게 함
· 기다렸다 유닛 소환
· 공격자 유닛 확인 뒤 방어 유닛 배치
· 탱커 앞 세우고 뒤에 딜러 소환
· 유저의 선택에 따라 적절한 유닛 소환
· 가끔 허를 찌르는 위치로 배치
· 적절하지 않는 곳에 유닛 배치
· 다양한 공격 방향과 진행에 잘 대응 못함
· 장기적 대응
· 클리어하기 어려움
· 단순한 패턴
· 적절한 유닛 소환
· 의미없는 유닛 소환
· 랜덤하게 유닛 소환
· 비효율적인 유닛 소환
· 상대를 공격할 수 없는 유닛 소환
· 건물 파괴 시점에 적절한 유닛 소환
· 미리 유닛 소환
· 실수가 덜한 느낌
· 적절한 배치
· 누군가가 지켜보고 있는 것 같음
· 라인 계속 유지
· 공격적인 패턴
· 단기적 대응
A/B Test
‣ /
‣
‣
‣ (Rule)
· 비슷한 플레이 패턴
· 다른 패턴
· 멍청함
· 긴장감
· 상성 유닛 소환
· 상황에 맞게 잘 대처함
· 능동적인(적극적인) 대응
· 구분하기 힘들다
· 둘다 재밌다
알고리듬 AI 딥러닝 AI
.

More Related Content

What's hot

Ibm's deep blue chess grandmaster chips
Ibm's deep blue chess grandmaster chipsIbm's deep blue chess grandmaster chips
Ibm's deep blue chess grandmaster chips
Nadeeshaan Gunasinghe
 
The Ring programming language version 1.5.4 book - Part 48 of 185
The Ring programming language version 1.5.4 book - Part 48 of 185The Ring programming language version 1.5.4 book - Part 48 of 185
The Ring programming language version 1.5.4 book - Part 48 of 185
Mahmoud Samir Fayed
 
Introduction to Stockfish bitboard representation and magic bitboard
Introduction to Stockfish bitboard representation and magic bitboardIntroduction to Stockfish bitboard representation and magic bitboard
Introduction to Stockfish bitboard representation and magic bitboard
Taiyou Kuo
 
libGDX: Tiled Maps
libGDX: Tiled MapslibGDX: Tiled Maps
libGDX: Tiled Maps
Jussi Pohjolainen
 
Intro to programming games with clojure
Intro to programming games with clojureIntro to programming games with clojure
Intro to programming games with clojure
Juio Barros
 
AlphaGo in Depth
AlphaGo in Depth AlphaGo in Depth
AlphaGo in Depth
Mark Chang
 
Initiation concrète-à-la-virtualisation-devoxx-fr-2021
Initiation concrète-à-la-virtualisation-devoxx-fr-2021Initiation concrète-à-la-virtualisation-devoxx-fr-2021
Initiation concrète-à-la-virtualisation-devoxx-fr-2021
Pierre-Antoine Grégoire
 
The Ring programming language version 1.5.2 book - Part 47 of 181
The Ring programming language version 1.5.2 book - Part 47 of 181The Ring programming language version 1.5.2 book - Part 47 of 181
The Ring programming language version 1.5.2 book - Part 47 of 181
Mahmoud Samir Fayed
 
Fun with sensors - JSConf.asia 2014
Fun with sensors - JSConf.asia 2014Fun with sensors - JSConf.asia 2014
Fun with sensors - JSConf.asia 2014
Jan Jongboom
 
Scaling Deep Learning with MXNet
Scaling Deep Learning with MXNetScaling Deep Learning with MXNet
Scaling Deep Learning with MXNet
AI Frontiers
 
Implementing a Simple Game using libGDX
Implementing a Simple Game using libGDXImplementing a Simple Game using libGDX
Implementing a Simple Game using libGDX
Jussi Pohjolainen
 
ZaCon 4 (2012) - Game Hacking
ZaCon 4 (2012) - Game HackingZaCon 4 (2012) - Game Hacking
ZaCon 4 (2012) - Game Hacking
HypnZA
 
Unity遊戲程式設計 - 2D Platformer遊戲
Unity遊戲程式設計 - 2D Platformer遊戲Unity遊戲程式設計 - 2D Platformer遊戲
Unity遊戲程式設計 - 2D Platformer遊戲
吳錫修 (ShyiShiou Wu)
 
Fast and Light-weight Binarized Neural Network Implemented in an FPGA using L...
Fast and Light-weight Binarized Neural Network Implemented in an FPGA using L...Fast and Light-weight Binarized Neural Network Implemented in an FPGA using L...
Fast and Light-weight Binarized Neural Network Implemented in an FPGA using L...
ryuz88
 
Game.log
Game.logGame.log
Game.log
TAOS3210
 
IkaLog_overview_en
IkaLog_overview_enIkaLog_overview_en
IkaLog_overview_en
Takeshi HASEGAWA
 
The most awesome build ever!
The most awesome build ever!The most awesome build ever!
The most awesome build ever!
Christine Shock
 
Gash Has No Privileges
Gash Has No PrivilegesGash Has No Privileges
Gash Has No Privileges
David Evans
 
The Internet
The InternetThe Internet
The Internet
David Evans
 
Erlang/N2O at KNPMeetup 2015
Erlang/N2O at KNPMeetup 2015Erlang/N2O at KNPMeetup 2015
Erlang/N2O at KNPMeetup 2015
Oleg Zinchenko
 

What's hot (20)

Ibm's deep blue chess grandmaster chips
Ibm's deep blue chess grandmaster chipsIbm's deep blue chess grandmaster chips
Ibm's deep blue chess grandmaster chips
 
The Ring programming language version 1.5.4 book - Part 48 of 185
The Ring programming language version 1.5.4 book - Part 48 of 185The Ring programming language version 1.5.4 book - Part 48 of 185
The Ring programming language version 1.5.4 book - Part 48 of 185
 
Introduction to Stockfish bitboard representation and magic bitboard
Introduction to Stockfish bitboard representation and magic bitboardIntroduction to Stockfish bitboard representation and magic bitboard
Introduction to Stockfish bitboard representation and magic bitboard
 
libGDX: Tiled Maps
libGDX: Tiled MapslibGDX: Tiled Maps
libGDX: Tiled Maps
 
Intro to programming games with clojure
Intro to programming games with clojureIntro to programming games with clojure
Intro to programming games with clojure
 
AlphaGo in Depth
AlphaGo in Depth AlphaGo in Depth
AlphaGo in Depth
 
Initiation concrète-à-la-virtualisation-devoxx-fr-2021
Initiation concrète-à-la-virtualisation-devoxx-fr-2021Initiation concrète-à-la-virtualisation-devoxx-fr-2021
Initiation concrète-à-la-virtualisation-devoxx-fr-2021
 
The Ring programming language version 1.5.2 book - Part 47 of 181
The Ring programming language version 1.5.2 book - Part 47 of 181The Ring programming language version 1.5.2 book - Part 47 of 181
The Ring programming language version 1.5.2 book - Part 47 of 181
 
Fun with sensors - JSConf.asia 2014
Fun with sensors - JSConf.asia 2014Fun with sensors - JSConf.asia 2014
Fun with sensors - JSConf.asia 2014
 
Scaling Deep Learning with MXNet
Scaling Deep Learning with MXNetScaling Deep Learning with MXNet
Scaling Deep Learning with MXNet
 
Implementing a Simple Game using libGDX
Implementing a Simple Game using libGDXImplementing a Simple Game using libGDX
Implementing a Simple Game using libGDX
 
ZaCon 4 (2012) - Game Hacking
ZaCon 4 (2012) - Game HackingZaCon 4 (2012) - Game Hacking
ZaCon 4 (2012) - Game Hacking
 
Unity遊戲程式設計 - 2D Platformer遊戲
Unity遊戲程式設計 - 2D Platformer遊戲Unity遊戲程式設計 - 2D Platformer遊戲
Unity遊戲程式設計 - 2D Platformer遊戲
 
Fast and Light-weight Binarized Neural Network Implemented in an FPGA using L...
Fast and Light-weight Binarized Neural Network Implemented in an FPGA using L...Fast and Light-weight Binarized Neural Network Implemented in an FPGA using L...
Fast and Light-weight Binarized Neural Network Implemented in an FPGA using L...
 
Game.log
Game.logGame.log
Game.log
 
IkaLog_overview_en
IkaLog_overview_enIkaLog_overview_en
IkaLog_overview_en
 
The most awesome build ever!
The most awesome build ever!The most awesome build ever!
The most awesome build ever!
 
Gash Has No Privileges
Gash Has No PrivilegesGash Has No Privileges
Gash Has No Privileges
 
The Internet
The InternetThe Internet
The Internet
 
Erlang/N2O at KNPMeetup 2015
Erlang/N2O at KNPMeetup 2015Erlang/N2O at KNPMeetup 2015
Erlang/N2O at KNPMeetup 2015
 

Similar to A Development of Log-based Game AI using Deep Learning

dCUDA: Distributed GPU Computing with Hardware Overlap
 dCUDA: Distributed GPU Computing with Hardware Overlap dCUDA: Distributed GPU Computing with Hardware Overlap
dCUDA: Distributed GPU Computing with Hardware Overlap
inside-BigData.com
 
TensorFrames: Google Tensorflow on Apache Spark
TensorFrames: Google Tensorflow on Apache SparkTensorFrames: Google Tensorflow on Apache Spark
TensorFrames: Google Tensorflow on Apache Spark
Databricks
 
Haskell for data science
Haskell for data scienceHaskell for data science
Haskell for data science
John Cant
 
MongoDB: Optimising for Performance, Scale & Analytics
MongoDB: Optimising for Performance, Scale & AnalyticsMongoDB: Optimising for Performance, Scale & Analytics
MongoDB: Optimising for Performance, Scale & Analytics
Server Density
 
Ensuring High Availability for Real-time Analytics featuring Boxed Ice / Serv...
Ensuring High Availability for Real-time Analytics featuring Boxed Ice / Serv...Ensuring High Availability for Real-time Analytics featuring Boxed Ice / Serv...
Ensuring High Availability for Real-time Analytics featuring Boxed Ice / Serv...
MongoDB
 
NTU ML TENSORFLOW
NTU ML TENSORFLOWNTU ML TENSORFLOW
NTU ML TENSORFLOW
Mark Chang
 
GPUs in Big Data - StampedeCon 2014
GPUs in Big Data - StampedeCon 2014GPUs in Big Data - StampedeCon 2014
GPUs in Big Data - StampedeCon 2014
StampedeCon
 
Numpy Talk at SIAM
Numpy Talk at SIAMNumpy Talk at SIAM
Numpy Talk at SIAM
Enthought, Inc.
 
Python utan-stodhjul-motorsag
Python utan-stodhjul-motorsagPython utan-stodhjul-motorsag
Python utan-stodhjul-motorsagniklal
 
Poker, packets, pipes and Python
Poker, packets, pipes and PythonPoker, packets, pipes and Python
Poker, packets, pipes and Python
Roger Barnes
 
Programar para GPUs
Programar para GPUsProgramar para GPUs
Programar para GPUs
Alcides Fonseca
 
London Spark Meetup Project Tungsten Oct 12 2015
London Spark Meetup Project Tungsten Oct 12 2015London Spark Meetup Project Tungsten Oct 12 2015
London Spark Meetup Project Tungsten Oct 12 2015
Chris Fregly
 
BINARY DATA ADVENTURES IN BROWSER JAVASCRIPT
BINARY DATA ADVENTURES  IN BROWSER JAVASCRIPTBINARY DATA ADVENTURES  IN BROWSER JAVASCRIPT
BINARY DATA ADVENTURES IN BROWSER JAVASCRIPT
Or Hiltch
 
Stupid Canvas Tricks
Stupid Canvas TricksStupid Canvas Tricks
Stupid Canvas Tricks
deanhudson
 
Parallel Graphics in Frostbite - Current & Future (Siggraph 2009)
Parallel Graphics in Frostbite - Current & Future (Siggraph 2009)Parallel Graphics in Frostbite - Current & Future (Siggraph 2009)
Parallel Graphics in Frostbite - Current & Future (Siggraph 2009)
Johan Andersson
 
JavaScript on the GPU
JavaScript on the GPUJavaScript on the GPU
JavaScript on the GPU
Jarred Nicholls
 
yt: An Analysis and Visualization System for Astrophysical Simulation Data
yt: An Analysis and Visualization System for Astrophysical Simulation Datayt: An Analysis and Visualization System for Astrophysical Simulation Data
yt: An Analysis and Visualization System for Astrophysical Simulation Data
John ZuHone
 
Deep Dive on Deep Learning (June 2018)
Deep Dive on Deep Learning (June 2018)Deep Dive on Deep Learning (June 2018)
Deep Dive on Deep Learning (June 2018)
Julien SIMON
 
Building a Scalable Distributed Stats Infrastructure with Storm and KairosDB
Building a Scalable Distributed Stats Infrastructure with Storm and KairosDBBuilding a Scalable Distributed Stats Infrastructure with Storm and KairosDB
Building a Scalable Distributed Stats Infrastructure with Storm and KairosDB
Cody Ray
 
ruby2600 - an Atari 2600 emulator written in Ruby
ruby2600 - an Atari 2600 emulator written in Rubyruby2600 - an Atari 2600 emulator written in Ruby
ruby2600 - an Atari 2600 emulator written in Ruby
Carlos Duarte do Nascimento
 

Similar to A Development of Log-based Game AI using Deep Learning (20)

dCUDA: Distributed GPU Computing with Hardware Overlap
 dCUDA: Distributed GPU Computing with Hardware Overlap dCUDA: Distributed GPU Computing with Hardware Overlap
dCUDA: Distributed GPU Computing with Hardware Overlap
 
TensorFrames: Google Tensorflow on Apache Spark
TensorFrames: Google Tensorflow on Apache SparkTensorFrames: Google Tensorflow on Apache Spark
TensorFrames: Google Tensorflow on Apache Spark
 
Haskell for data science
Haskell for data scienceHaskell for data science
Haskell for data science
 
MongoDB: Optimising for Performance, Scale & Analytics
MongoDB: Optimising for Performance, Scale & AnalyticsMongoDB: Optimising for Performance, Scale & Analytics
MongoDB: Optimising for Performance, Scale & Analytics
 
Ensuring High Availability for Real-time Analytics featuring Boxed Ice / Serv...
Ensuring High Availability for Real-time Analytics featuring Boxed Ice / Serv...Ensuring High Availability for Real-time Analytics featuring Boxed Ice / Serv...
Ensuring High Availability for Real-time Analytics featuring Boxed Ice / Serv...
 
NTU ML TENSORFLOW
NTU ML TENSORFLOWNTU ML TENSORFLOW
NTU ML TENSORFLOW
 
GPUs in Big Data - StampedeCon 2014
GPUs in Big Data - StampedeCon 2014GPUs in Big Data - StampedeCon 2014
GPUs in Big Data - StampedeCon 2014
 
Numpy Talk at SIAM
Numpy Talk at SIAMNumpy Talk at SIAM
Numpy Talk at SIAM
 
Python utan-stodhjul-motorsag
Python utan-stodhjul-motorsagPython utan-stodhjul-motorsag
Python utan-stodhjul-motorsag
 
Poker, packets, pipes and Python
Poker, packets, pipes and PythonPoker, packets, pipes and Python
Poker, packets, pipes and Python
 
Programar para GPUs
Programar para GPUsProgramar para GPUs
Programar para GPUs
 
London Spark Meetup Project Tungsten Oct 12 2015
London Spark Meetup Project Tungsten Oct 12 2015London Spark Meetup Project Tungsten Oct 12 2015
London Spark Meetup Project Tungsten Oct 12 2015
 
BINARY DATA ADVENTURES IN BROWSER JAVASCRIPT
BINARY DATA ADVENTURES  IN BROWSER JAVASCRIPTBINARY DATA ADVENTURES  IN BROWSER JAVASCRIPT
BINARY DATA ADVENTURES IN BROWSER JAVASCRIPT
 
Stupid Canvas Tricks
Stupid Canvas TricksStupid Canvas Tricks
Stupid Canvas Tricks
 
Parallel Graphics in Frostbite - Current & Future (Siggraph 2009)
Parallel Graphics in Frostbite - Current & Future (Siggraph 2009)Parallel Graphics in Frostbite - Current & Future (Siggraph 2009)
Parallel Graphics in Frostbite - Current & Future (Siggraph 2009)
 
JavaScript on the GPU
JavaScript on the GPUJavaScript on the GPU
JavaScript on the GPU
 
yt: An Analysis and Visualization System for Astrophysical Simulation Data
yt: An Analysis and Visualization System for Astrophysical Simulation Datayt: An Analysis and Visualization System for Astrophysical Simulation Data
yt: An Analysis and Visualization System for Astrophysical Simulation Data
 
Deep Dive on Deep Learning (June 2018)
Deep Dive on Deep Learning (June 2018)Deep Dive on Deep Learning (June 2018)
Deep Dive on Deep Learning (June 2018)
 
Building a Scalable Distributed Stats Infrastructure with Storm and KairosDB
Building a Scalable Distributed Stats Infrastructure with Storm and KairosDBBuilding a Scalable Distributed Stats Infrastructure with Storm and KairosDB
Building a Scalable Distributed Stats Infrastructure with Storm and KairosDB
 
ruby2600 - an Atari 2600 emulator written in Ruby
ruby2600 - an Atari 2600 emulator written in Rubyruby2600 - an Atari 2600 emulator written in Ruby
ruby2600 - an Atari 2600 emulator written in Ruby
 

Recently uploaded

Citrus Greening Disease and its Management
Citrus Greening Disease and its ManagementCitrus Greening Disease and its Management
Citrus Greening Disease and its Management
subedisuryaofficial
 
PRESENTATION ABOUT PRINCIPLE OF COSMATIC EVALUATION
PRESENTATION ABOUT PRINCIPLE OF COSMATIC EVALUATIONPRESENTATION ABOUT PRINCIPLE OF COSMATIC EVALUATION
PRESENTATION ABOUT PRINCIPLE OF COSMATIC EVALUATION
ChetanK57
 
Richard's entangled aventures in wonderland
Richard's entangled aventures in wonderlandRichard's entangled aventures in wonderland
Richard's entangled aventures in wonderland
Richard Gill
 
THE IMPORTANCE OF MARTIAN ATMOSPHERE SAMPLE RETURN.
THE IMPORTANCE OF MARTIAN ATMOSPHERE SAMPLE RETURN.THE IMPORTANCE OF MARTIAN ATMOSPHERE SAMPLE RETURN.
THE IMPORTANCE OF MARTIAN ATMOSPHERE SAMPLE RETURN.
Sérgio Sacani
 
Structures and textures of metamorphic rocks
Structures and textures of metamorphic rocksStructures and textures of metamorphic rocks
Structures and textures of metamorphic rocks
kumarmathi863
 
Seminar of U.V. Spectroscopy by SAMIR PANDA
 Seminar of U.V. Spectroscopy by SAMIR PANDA Seminar of U.V. Spectroscopy by SAMIR PANDA
Seminar of U.V. Spectroscopy by SAMIR PANDA
SAMIR PANDA
 
plant biotechnology Lecture note ppt.pptx
plant biotechnology Lecture note ppt.pptxplant biotechnology Lecture note ppt.pptx
plant biotechnology Lecture note ppt.pptx
yusufzako14
 
filosofia boliviana introducción jsjdjd.pptx
filosofia boliviana introducción jsjdjd.pptxfilosofia boliviana introducción jsjdjd.pptx
filosofia boliviana introducción jsjdjd.pptx
IvanMallco1
 
FAIR & AI Ready KGs for Explainable Predictions
FAIR & AI Ready KGs for Explainable PredictionsFAIR & AI Ready KGs for Explainable Predictions
FAIR & AI Ready KGs for Explainable Predictions
Michel Dumontier
 
extra-chromosomal-inheritance[1].pptx.pdfpdf
extra-chromosomal-inheritance[1].pptx.pdfpdfextra-chromosomal-inheritance[1].pptx.pdfpdf
extra-chromosomal-inheritance[1].pptx.pdfpdf
DiyaBiswas10
 
Hemoglobin metabolism_pathophysiology.pptx
Hemoglobin metabolism_pathophysiology.pptxHemoglobin metabolism_pathophysiology.pptx
Hemoglobin metabolism_pathophysiology.pptx
muralinath2
 
NuGOweek 2024 Ghent - programme - final version
NuGOweek 2024 Ghent - programme - final versionNuGOweek 2024 Ghent - programme - final version
NuGOweek 2024 Ghent - programme - final version
pablovgd
 
Viksit bharat till 2047 India@2047.pptx
Viksit bharat till 2047  India@2047.pptxViksit bharat till 2047  India@2047.pptx
Viksit bharat till 2047 India@2047.pptx
rakeshsharma20142015
 
Large scale production of streptomycin.pptx
Large scale production of streptomycin.pptxLarge scale production of streptomycin.pptx
Large scale production of streptomycin.pptx
Cherry
 
(May 29th, 2024) Advancements in Intravital Microscopy- Insights for Preclini...
(May 29th, 2024) Advancements in Intravital Microscopy- Insights for Preclini...(May 29th, 2024) Advancements in Intravital Microscopy- Insights for Preclini...
(May 29th, 2024) Advancements in Intravital Microscopy- Insights for Preclini...
Scintica Instrumentation
 
GBSN - Biochemistry (Unit 5) Chemistry of Lipids
GBSN - Biochemistry (Unit 5) Chemistry of LipidsGBSN - Biochemistry (Unit 5) Chemistry of Lipids
GBSN - Biochemistry (Unit 5) Chemistry of Lipids
Areesha Ahmad
 
Multi-source connectivity as the driver of solar wind variability in the heli...
Multi-source connectivity as the driver of solar wind variability in the heli...Multi-source connectivity as the driver of solar wind variability in the heli...
Multi-source connectivity as the driver of solar wind variability in the heli...
Sérgio Sacani
 
SCHIZOPHRENIA Disorder/ Brain Disorder.pdf
SCHIZOPHRENIA Disorder/ Brain Disorder.pdfSCHIZOPHRENIA Disorder/ Brain Disorder.pdf
SCHIZOPHRENIA Disorder/ Brain Disorder.pdf
SELF-EXPLANATORY
 
insect morphology and physiology of insect
insect morphology and physiology of insectinsect morphology and physiology of insect
insect morphology and physiology of insect
anitaento25
 
insect taxonomy importance systematics and classification
insect taxonomy importance systematics and classificationinsect taxonomy importance systematics and classification
insect taxonomy importance systematics and classification
anitaento25
 

Recently uploaded (20)

Citrus Greening Disease and its Management
Citrus Greening Disease and its ManagementCitrus Greening Disease and its Management
Citrus Greening Disease and its Management
 
PRESENTATION ABOUT PRINCIPLE OF COSMATIC EVALUATION
PRESENTATION ABOUT PRINCIPLE OF COSMATIC EVALUATIONPRESENTATION ABOUT PRINCIPLE OF COSMATIC EVALUATION
PRESENTATION ABOUT PRINCIPLE OF COSMATIC EVALUATION
 
Richard's entangled aventures in wonderland
Richard's entangled aventures in wonderlandRichard's entangled aventures in wonderland
Richard's entangled aventures in wonderland
 
THE IMPORTANCE OF MARTIAN ATMOSPHERE SAMPLE RETURN.
THE IMPORTANCE OF MARTIAN ATMOSPHERE SAMPLE RETURN.THE IMPORTANCE OF MARTIAN ATMOSPHERE SAMPLE RETURN.
THE IMPORTANCE OF MARTIAN ATMOSPHERE SAMPLE RETURN.
 
Structures and textures of metamorphic rocks
Structures and textures of metamorphic rocksStructures and textures of metamorphic rocks
Structures and textures of metamorphic rocks
 
Seminar of U.V. Spectroscopy by SAMIR PANDA
 Seminar of U.V. Spectroscopy by SAMIR PANDA Seminar of U.V. Spectroscopy by SAMIR PANDA
Seminar of U.V. Spectroscopy by SAMIR PANDA
 
plant biotechnology Lecture note ppt.pptx
plant biotechnology Lecture note ppt.pptxplant biotechnology Lecture note ppt.pptx
plant biotechnology Lecture note ppt.pptx
 
filosofia boliviana introducción jsjdjd.pptx
filosofia boliviana introducción jsjdjd.pptxfilosofia boliviana introducción jsjdjd.pptx
filosofia boliviana introducción jsjdjd.pptx
 
FAIR & AI Ready KGs for Explainable Predictions
FAIR & AI Ready KGs for Explainable PredictionsFAIR & AI Ready KGs for Explainable Predictions
FAIR & AI Ready KGs for Explainable Predictions
 
extra-chromosomal-inheritance[1].pptx.pdfpdf
extra-chromosomal-inheritance[1].pptx.pdfpdfextra-chromosomal-inheritance[1].pptx.pdfpdf
extra-chromosomal-inheritance[1].pptx.pdfpdf
 
Hemoglobin metabolism_pathophysiology.pptx
Hemoglobin metabolism_pathophysiology.pptxHemoglobin metabolism_pathophysiology.pptx
Hemoglobin metabolism_pathophysiology.pptx
 
NuGOweek 2024 Ghent - programme - final version
NuGOweek 2024 Ghent - programme - final versionNuGOweek 2024 Ghent - programme - final version
NuGOweek 2024 Ghent - programme - final version
 
Viksit bharat till 2047 India@2047.pptx
Viksit bharat till 2047  India@2047.pptxViksit bharat till 2047  India@2047.pptx
Viksit bharat till 2047 India@2047.pptx
 
Large scale production of streptomycin.pptx
Large scale production of streptomycin.pptxLarge scale production of streptomycin.pptx
Large scale production of streptomycin.pptx
 
(May 29th, 2024) Advancements in Intravital Microscopy- Insights for Preclini...
(May 29th, 2024) Advancements in Intravital Microscopy- Insights for Preclini...(May 29th, 2024) Advancements in Intravital Microscopy- Insights for Preclini...
(May 29th, 2024) Advancements in Intravital Microscopy- Insights for Preclini...
 
GBSN - Biochemistry (Unit 5) Chemistry of Lipids
GBSN - Biochemistry (Unit 5) Chemistry of LipidsGBSN - Biochemistry (Unit 5) Chemistry of Lipids
GBSN - Biochemistry (Unit 5) Chemistry of Lipids
 
Multi-source connectivity as the driver of solar wind variability in the heli...
Multi-source connectivity as the driver of solar wind variability in the heli...Multi-source connectivity as the driver of solar wind variability in the heli...
Multi-source connectivity as the driver of solar wind variability in the heli...
 
SCHIZOPHRENIA Disorder/ Brain Disorder.pdf
SCHIZOPHRENIA Disorder/ Brain Disorder.pdfSCHIZOPHRENIA Disorder/ Brain Disorder.pdf
SCHIZOPHRENIA Disorder/ Brain Disorder.pdf
 
insect morphology and physiology of insect
insect morphology and physiology of insectinsect morphology and physiology of insect
insect morphology and physiology of insect
 
insect taxonomy importance systematics and classification
insect taxonomy importance systematics and classificationinsect taxonomy importance systematics and classification
insect taxonomy importance systematics and classification
 

A Development of Log-based Game AI using Deep Learning

  • 1.
  • 3. 1. Background 2. AI Requirements 3. Deep Learning •Dataset, Preprocessing •Neural Networks •Train/Test, Inference 4. Demo 5. A/B Test Index
  • 4. Background AI ' ', ‘ ' . AI FSM(Finite State Machine) , AI . AI ..
  • 5. Problem State 
 . .. 경우의 수 경우의 수 경우의 수경우의 수 경우의 수경우의 수 경우의 수 경우의 수 …
  • 6. : “ 사람같은 AI 만들어주실 수 있나요? ”
 : “ 네? 사람같은 AI요? ‘사람같음’ 을 정의하기 어렵고, 경우의 수가 너무 많아요.. ”
  • 7. Project A Log-based Human Like Game AI. Offline AI Agent.
  • 8. ? Our game planners needed a human-like defense AI to play for players when they were offline..
  • 9. AI requirements 1. When ( ) It predicts the Timing that a unit would be deployed. 2. Where ( ) It predicts the Location that a unit would be deployed on a map (grid size: 42x35). 3. What ( ) It predicts the Cards that it would be picked.
  • 10. Dataset “ Action state 1446+1 Floating point ” Index Meaningg 0 (Length: 1) 1~45 (Deck) (Length: 45) 46 ~ 945 (Length: 900) 946 ~ 1445 (Length: 500) 1446 Label (= Class, Action , ) (Length: 1) 0 1 2 3 4~6 7~9 10~12 ••• 12 14 8 1 Unit Deck 2 Unit Deck 3 Unit Deck 4Player Unit Cost Unit Deck 1 Code Level Remain Cost 46 47 48 49 50 51 52~57 ••• 1446 10 6 21 13 0.78497 1 Unit 2 3 Unit 1 on Map Code Level X Y Dead Rate Player Type Y(Class) Index Sample Meaning Index Sample Meaning X DATA Y DATA Y = WX + B
  • 11. Log format 1. => Players 2. => FrameCount 3. => BattleMap { ( / / /AI), ( / / / )} 4. => Action { ( ) }
  • 12. Preprocessing RAW file size 321.12 GB Number of battle counts 450,967 Tools Spark, Mesos, Zeppelin, Hadoop Language Scala System CPU 4 Cores, RAM 256 GB, HDD 14.5 TB “ !!”
  • 14. Parsing using Spark, Zeppelin and Scala “Zeppelin ”
  • 16. Preprocessing RAW data file size => 321.12 GB Preprocessed file size => 48.8 MB 4 Cores, RAM 256 GB => 7 !! ;; , ??? ..
  • 17. Preprocessing RAW file size 321.12 GB Number of battle counts 450,967 Process time 21 mins Preprocessed
 file size 48.8 MB Tools Spark, Mesos, Zeppelin, Hadoop Language Scala System CPU 160 Cores, RAM 512 GB, HDD 14.5 TB Time 4 Cores, RAM 256 GB => 7 hours 160 Cores, RAM 512 GB => 21 mins Speed up(x20)
  • 18. Neural Networks What & Where & When Binary Classification (Timing) Regression (Location) using CNN using LSTM Multinomial Classification (Card) using CNN 1D Convolution + Softmax 1D Convolution + Regression Stacked LSTM + Softmax
  • 19. What ( ) 1446 x 1 1446 x 32 723 x 32 723 x 64 362 x 64 362 x 128 (1 x 1) x 46336 (1 x 1) x 512 (1 x 1) x 10 0 1 2 3 4 5 6 7 8 9 (1 x 1) x 10 Deck Mask Max Pooling (1 x 2) 1D Conv (1 x 5) 1D Conv (1 x 5) Max Pooling (1 x 2) 1D Conv (1 x 5) Flatten Fully connected 512 neurons Fully connected 10 neurons Softmax (1 x 1) x 128 Fully connected 128 neurons (1 x 1) x 10 Class (One Hot Encoding Index) 0 7 5 2 Input if Argmax = 0 Loss: Cross-Entropy tf.reduce_mean(tf.nn.softmax_cross_entropy_with_logits(Y, Y’)) 0.5 Probability 0.01 0.03 0.01 0.05 0.01 0.07 0.02 0.2 0.1 Sum = 1.0 • Log data: 1 Dimension. • Property SNAPSHOT data. • Not SCREENSHOT(Image) data.
  • 20. Where ( ) 1446 x 1 1446 x 32 723 x 32 723 x 64 362 x 64 362 x 128 (1 x 1) x 46336 (1 x 1) x 1024 (1 x 1) x 2 Max Pooling (1 x 2) 1D Conv (1 x 5) 1D Conv (1 x 5) Max Pooling (1 x 2) 1D Conv (1 x 5) Flatten Fully connected 1024 neurons Fully connected 2 neurons Regression (1 x 1) x 128 Fully connected 128 neurons (1 x 1) x 2 Input (10, 10) <Game Map Grid> Loss: L2 Distance tf.reduce_mean(tf.squared_difference(POS_X, POS_X’)) tf.reduce_mean(tf.squared_difference(POS_Y, POS_Y’)) 32 42 10 (X) 10 (Y) Index Value • Log data:1 Dimension. • Property SNAPSHOT data. • Not SCREENSHOT(Image) data. 0 1
  • 21. When ( ) 0.28 0.72 Output LSTMLSTM States States StatesInput Time t-3 t-2 t-1 Softmax t Prediction “Action” “Wait” “Wait” “Output” Stacked LSTM Sequence length: 3 Sample LSTMLSTM (30 x 10) Class (One Hot Encoding Index) 0 1 LSTM Loss: Cross-Entropy tf.reduce_mean(tf.nn.softmax_cross_entropy_with_logits(Y, Y’)) Fully connected layer LSTM Action if Argmax = 1 Wait ActionMeaning http://cs231n.stanford.edu/slides/2016/winter1516_lecture10.pdf
  • 22. When (Regression , Distribution) 0: Wait 1: Action 0: Wait 1: Action Frame count Frame count Frame count Frame count
  • 23. import tensorflow as tf import numpy as np base_ch = 32 layer1 = ConvLayer(X, IS_TRAINING, input_ch=1, output_ch=base_ch, kernel_size=5, name='conv1') layer1 = PReLU(layer1, shape=base_ch, name='relu1') layer1 = PoolingLayer(layer1, kernel_size=2, name='pooling1') layer2 = ConvLayer(layer1, IS_TRAINING, input_ch=base_ch, output_ch=base_ch * 2, kernel_size=5, name='conv2') layer2 = PReLU(layer2, shape=base_ch*2, name='relu2') layer2 = PoolingLayer(layer2, kernel_size=2, name='pooling2') layer3 = ConvLayer(layer2, IS_TRAINING, input_ch=base_ch * 2, output_ch=base_ch * 4, kernel_size=5, name='conv3') layer3 = PReLU(layer3, shape=base_ch * 4, name='relu3') flattened_shape = np.prod([s.value for s in layer3.get_shape()[1:]]) flatten = tf.reshape(layer3, [-1, flattened_shape], name="flatten") fc1 = FCLayer(flatten, name="fc1", n_out=512) fc1 = ReLUDropout(fc1); fc2 = FCLayer(fc1, name="fc2", n_out=128) fc2 = ReLUDropout(fc2); fc3 = FCLayer(fc2, name="fc3", n_out=num_of_classes) output_layer = fc3 Train
  • 24. import tensorflow as tf X = tf.placeholder(tf.float32, [None, num_of_feature_elements, 1], name="input") Y = tf.placeholder(tf.int32, [None, 1]) MASK = tf.placeholder(tf.float32, [None, num_of_classes], name="mask") IS_TRAINING = tf.placeholder(tf.bool, [], name="is_training") DROPOUT_KEEP_PROB = tf.placeholder(tf.float32, name="dropout_keep_prob") output_layer = tf.multiply(output_layer, MASK) HYPOTHESIS = tf.nn.softmax(output_layer) COST = tf.reduce_mean(tf.nn.softmax_cross_entropy_with_logits(logits=output_layer, labels=Y_one_hot)) OPTIMIZER = tf.train.AdamOptimizer(learning_rate).minimize(COST) PREDICTION = tf.argmax(HYPOTHESIS, 1, name="prediction") correct_prediction = tf.equal(prediction, tf.argmax(Y_one_hot, 1)) ACCURACY = tf.reduce_mean(tf.cast(correct_prediction, tf.float32)) x_batch_data = x_batch_data[shuffle_idx] y_batch_data = y_batch_data[shuffle_idx] mask_batch_data = mask_batch_data[shuffle_idx] _, loss, acc = sess.run([OPTIMIZER, COST, ACCURACY], feed_dict={X: np.expand_dims(x_batch_data, axis=2), Y: y_batch_data, MASK: mask_batch_data, DROPOUT_KEEP_PROB: 0.7, IS_TRAINING: True}) Train Deck Backpropagation . <https://en.wikipedia.org/wiki/Gradient_descent, https://lazyprogrammer.me/tag/gradient-descent>
  • 25. Test import tensorflow as tf x_batch_data = x_data[batch_mask] y_batch_data = y_data[batch_mask] mask_batch_data = mask_data[batch_mask] pred, pred_values = sess.run([PREDICTION, HYPOTHESIS], feed_dict={X: np.expand_dims(x_batch_data, axis=2), MASK: mask_batch_data, DROPOUT_KEEP_PROB: 1.0, IS_TRAINING: False}) for p, y in zip(pred, y_batch_data.flatten()): class_try_count_list[p][0] += 1 if p == int(y): total_correct_count += 1 class_true_count_list[int(y)][0] += 1
  • 26. Save training logs Import os import shutil import datetime import time timestamep = datetime.datetime.now().strftime("%Y_%m_%d_%H_%M_%S") save_path = root_path + "LV10_Save_CNN_WHAT_" + timestamep + "/" result_train_file_path = save_path + "result_" + timestamep + ".txt" if os.path.exists(save_path): shutil.rmtree(save_path) os.makedirs(save_path) train_log_file = open(result_train_file_path, 'w') def SaveAndPrint(file, str_message): print(str_message, end="") file.write(str_message) file.flush()
  • 29. Training logs Hyperparameter Input file “ hidden size ?” “ ?” “ ?” “X, Y Matrix shape ?” X, Y
  • 30. Training logs Class “ Step ?” “Class ?” “Ground Truth ?”
  • 31. Training logs Model “ ?” “ ?” “ ?” “ ?” Log DB .
  • 32. Training logs Step Epoch Model Validation Code , Check . , Stop; Hyperparameter . (Batch size, Hidden size, Learning rate, RNN Sequence length, RNN Multi count, CNN layer count, CNN Filter size .. .. ;;) AutoML ..
  • 33. Experimental results Gathering period 2018/03/13 ~ 04/24 ( 43 ) Number of battle counts 450,967 Total file size 321.12 GB Neural Networks CNN (Convolutional Neural Network) LSTM (Long Short-Term Memory) Tools Spark, Mesos, Zeppelin, Hadoop, Tensorflow, Unity3D Language Python, Scala, C#, C System GTX 1080, CPU i7-6700K, RAM 32GB, HDD 2TB Accuracy for Card 83.99% Accuracy for Timing 70.94% Accuracy for Location 4.15 Distance (cm), (= 1 )
  • 34. Level
  • 35. (Blue) V.S. Ground Truth(Red)
  • 36. Inference: LineGameTensorFlow library libLineGameTensorflow.dylib / .so TensorFlow Library ,
 Model Inference Native Library
  • 37. Inference: Game Loop Hybrid • RuleSet • • AI On/Off
  • 38. Card PickCard(DeckInfo userDeckInfo) { Card card = RuelSet.RandomPick( userDeckInfo ); if( bUseDeepAI ) { Card deepAICard = PickByDeepAI( userDeckInfo ); if( null != deepAICard ) { card = deepAICard; } } return card; } Real-time inference 1 : ( ) 2 : / ( , , ) 1 2 if AI , // . " C# MonoBehaviour Inference ” // Inference . // ( )
  • 39. !! (RuleSet) AI V.S. AI A deep learning AI was trained by the player logs.
 So, does it play like human? Let’s watch clips!!
  • 41.
  • 43.
  • 44. · 적절한 타이밍에 전략 구사 · 매번 다른 전략 구사 · 각개격파 전술 구사 · 즉각적 · 빠른 판단(대응) · 코어 유저 · 능숙함 · 생각하게 함 · 기다렸다 유닛 소환 · 공격자 유닛 확인 뒤 방어 유닛 배치 · 탱커 앞 세우고 뒤에 딜러 소환 · 유저의 선택에 따라 적절한 유닛 소환 · 가끔 허를 찌르는 위치로 배치 · 적절하지 않는 곳에 유닛 배치 · 다양한 공격 방향과 진행에 잘 대응 못함 · 장기적 대응 · 클리어하기 어려움 · 단순한 패턴 · 적절한 유닛 소환 · 의미없는 유닛 소환 · 랜덤하게 유닛 소환 · 비효율적인 유닛 소환 · 상대를 공격할 수 없는 유닛 소환 · 건물 파괴 시점에 적절한 유닛 소환 · 미리 유닛 소환 · 실수가 덜한 느낌 · 적절한 배치 · 누군가가 지켜보고 있는 것 같음 · 라인 계속 유지 · 공격적인 패턴 · 단기적 대응 A/B Test ‣ / ‣ ‣ ‣ (Rule) · 비슷한 플레이 패턴 · 다른 패턴 · 멍청함 · 긴장감 · 상성 유닛 소환 · 상황에 맞게 잘 대처함 · 능동적인(적극적인) 대응 · 구분하기 힘들다 · 둘다 재밌다 알고리듬 AI 딥러닝 AI
  • 45. .