Submit Search
Upload
iOS와 케라스의 만남
•
3 likes
•
521 views
Mijeong Jeon
Follow
2017 Swift Korea MeetUp #2 발표 자료 Keras를 활용해 iOS에 딥러닝 손으로 그린 모형을 예측하는 모델을 적용시켜 보았습니다.
Read less
Read more
Software
Report
Share
Report
Share
1 of 22
Download now
Download to read offline
Recommended
Introduction to ad-3.4, an automatic differentiation library in Haskell
Introduction to ad-3.4, an automatic differentiation library in Haskell
nebuta
Imugi: Compiler made with Python
Imugi: Compiler made with Python
Han Lee
Python легко и просто. Красиво решаем повседневные задачи
Python легко и просто. Красиво решаем повседневные задачи
Maxim Kulsha
Advanced python
Advanced python
EU Edge
Whiteboarding Coding Challenges in Python
Whiteboarding Coding Challenges in Python
Andrew Ferlitsch
Python programming : Abstract classes interfaces
Python programming : Abstract classes interfaces
Emertxe Information Technologies Pvt Ltd
13. dynamic allocation
13. dynamic allocation
웅식 전
C arrays
C arrays
CGC Technical campus,Mohali
Recommended
Introduction to ad-3.4, an automatic differentiation library in Haskell
Introduction to ad-3.4, an automatic differentiation library in Haskell
nebuta
Imugi: Compiler made with Python
Imugi: Compiler made with Python
Han Lee
Python легко и просто. Красиво решаем повседневные задачи
Python легко и просто. Красиво решаем повседневные задачи
Maxim Kulsha
Advanced python
Advanced python
EU Edge
Whiteboarding Coding Challenges in Python
Whiteboarding Coding Challenges in Python
Andrew Ferlitsch
Python programming : Abstract classes interfaces
Python programming : Abstract classes interfaces
Emertxe Information Technologies Pvt Ltd
13. dynamic allocation
13. dynamic allocation
웅식 전
C arrays
C arrays
CGC Technical campus,Mohali
Python 표준 라이브러리
Python 표준 라이브러리
용 최
Swift 3.0 で変わったところ - 厳選 13 項目 #love_swift #cswift
Swift 3.0 で変わったところ - 厳選 13 項目 #love_swift #cswift
Tomohiro Kumagai
Java: Introduction to Arrays
Java: Introduction to Arrays
Tareq Hasan
Core c sharp and .net quick reference
Core c sharp and .net quick reference
Arduino Aficionado
Arrays in java
Arrays in java
bhavesh prakash
Arrays
Arrays
fahadshakeel
Notes for C Programming for MCA, BCA, B. Tech CSE, ECE and MSC (CS) 4 of 5 by...
Notes for C Programming for MCA, BCA, B. Tech CSE, ECE and MSC (CS) 4 of 5 by...
ssuserd6b1fd
Data structure lab manual
Data structure lab manual
nikshaikh786
Tip Top Typing - A Look at Python Typing
Tip Top Typing - A Look at Python Typing
Patrick Viafore
Advanced Python, Part 2
Advanced Python, Part 2
Zaar Hai
Array lecture
Array lecture
Joan Saño
Rethink programming: a functional approach
Rethink programming: a functional approach
Francesco Bruni
Arrays
Arrays
Aman Agarwal
Arrays in java language
Arrays in java language
Hareem Naz
Python decorators (中文)
Python decorators (中文)
Yiwei Chen
Arrays
Arrays
emartinez.romero
Swift 함수 커링 사용하기
Swift 함수 커링 사용하기
진성 오
Java arrays
Java arrays
Mohammed Sikander
Arrays in C
Arrays in C
Kamruddin Nur
Arrays
Arrays
Rahul Mahamuni
프알못의 Keras 사용기
프알못의 Keras 사용기
Mijeong Jeon
A Tale of Three Deep Learning Frameworks: TensorFlow, Keras, & PyTorch with B...
A Tale of Three Deep Learning Frameworks: TensorFlow, Keras, & PyTorch with B...
Databricks
More Related Content
What's hot
Python 표준 라이브러리
Python 표준 라이브러리
용 최
Swift 3.0 で変わったところ - 厳選 13 項目 #love_swift #cswift
Swift 3.0 で変わったところ - 厳選 13 項目 #love_swift #cswift
Tomohiro Kumagai
Java: Introduction to Arrays
Java: Introduction to Arrays
Tareq Hasan
Core c sharp and .net quick reference
Core c sharp and .net quick reference
Arduino Aficionado
Arrays in java
Arrays in java
bhavesh prakash
Arrays
Arrays
fahadshakeel
Notes for C Programming for MCA, BCA, B. Tech CSE, ECE and MSC (CS) 4 of 5 by...
Notes for C Programming for MCA, BCA, B. Tech CSE, ECE and MSC (CS) 4 of 5 by...
ssuserd6b1fd
Data structure lab manual
Data structure lab manual
nikshaikh786
Tip Top Typing - A Look at Python Typing
Tip Top Typing - A Look at Python Typing
Patrick Viafore
Advanced Python, Part 2
Advanced Python, Part 2
Zaar Hai
Array lecture
Array lecture
Joan Saño
Rethink programming: a functional approach
Rethink programming: a functional approach
Francesco Bruni
Arrays
Arrays
Aman Agarwal
Arrays in java language
Arrays in java language
Hareem Naz
Python decorators (中文)
Python decorators (中文)
Yiwei Chen
Arrays
Arrays
emartinez.romero
Swift 함수 커링 사용하기
Swift 함수 커링 사용하기
진성 오
Java arrays
Java arrays
Mohammed Sikander
Arrays in C
Arrays in C
Kamruddin Nur
Arrays
Arrays
Rahul Mahamuni
What's hot
(20)
Python 표준 라이브러리
Python 표준 라이브러리
Swift 3.0 で変わったところ - 厳選 13 項目 #love_swift #cswift
Swift 3.0 で変わったところ - 厳選 13 項目 #love_swift #cswift
Java: Introduction to Arrays
Java: Introduction to Arrays
Core c sharp and .net quick reference
Core c sharp and .net quick reference
Arrays in java
Arrays in java
Arrays
Arrays
Notes for C Programming for MCA, BCA, B. Tech CSE, ECE and MSC (CS) 4 of 5 by...
Notes for C Programming for MCA, BCA, B. Tech CSE, ECE and MSC (CS) 4 of 5 by...
Data structure lab manual
Data structure lab manual
Tip Top Typing - A Look at Python Typing
Tip Top Typing - A Look at Python Typing
Advanced Python, Part 2
Advanced Python, Part 2
Array lecture
Array lecture
Rethink programming: a functional approach
Rethink programming: a functional approach
Arrays
Arrays
Arrays in java language
Arrays in java language
Python decorators (中文)
Python decorators (中文)
Arrays
Arrays
Swift 함수 커링 사용하기
Swift 함수 커링 사용하기
Java arrays
Java arrays
Arrays in C
Arrays in C
Arrays
Arrays
Similar to iOS와 케라스의 만남
프알못의 Keras 사용기
프알못의 Keras 사용기
Mijeong Jeon
A Tale of Three Deep Learning Frameworks: TensorFlow, Keras, & PyTorch with B...
A Tale of Three Deep Learning Frameworks: TensorFlow, Keras, & PyTorch with B...
Databricks
cluster(python)
cluster(python)
Noriyuki Kojima
Introduction to TensorFlow 2.0
Introduction to TensorFlow 2.0
Databricks
TensorFlow Lite (r1.5) & Android 8.1 Neural Network API
TensorFlow Lite (r1.5) & Android 8.1 Neural Network API
Mr. Vengineer
TensorFlow example for AI Ukraine2016
TensorFlow example for AI Ukraine2016
Andrii Babii
slide-keras-tf.pptx
slide-keras-tf.pptx
RithikRaj25
maXbox starter65 machinelearning3
maXbox starter65 machinelearning3
Max Kleiner
From Tensorflow Graph to Tensorflow Eager
From Tensorflow Graph to Tensorflow Eager
Guy Hadash
Keras and TensorFlow
Keras and TensorFlow
NopphawanTamkuan
vertopal.com_DataEncodingForDataClustering-5 (1).pdf
vertopal.com_DataEncodingForDataClustering-5 (1).pdf
zraibianour
TensorFlow for IITians
TensorFlow for IITians
Ashish Bansal
Neural networks using tensor flow in amazon deep learning server
Neural networks using tensor flow in amazon deep learning server
Ramco Institute of Technology, Rajapalayam, Tamilnadu, India
Programming in C (part 2)
Programming in C (part 2)
SURBHI SAROHA
C sharp chap6
C sharp chap6
Mukesh Tekwani
Power ai tensorflowworkloadtutorial-20171117
Power ai tensorflowworkloadtutorial-20171117
Ganesan Narayanasamy
Machine learning with py torch
Machine learning with py torch
Riza Fahmi
TensorFlow.Data 및 TensorFlow Hub
TensorFlow.Data 및 TensorFlow Hub
Jeongkyu Shin
Python basic
Python basic
Saifuddin Kaijar
NUS-ISS Learning Day 2019-Deploying AI apps using tensor flow lite in mobile ...
NUS-ISS Learning Day 2019-Deploying AI apps using tensor flow lite in mobile ...
NUS-ISS
Similar to iOS와 케라스의 만남
(20)
프알못의 Keras 사용기
프알못의 Keras 사용기
A Tale of Three Deep Learning Frameworks: TensorFlow, Keras, & PyTorch with B...
A Tale of Three Deep Learning Frameworks: TensorFlow, Keras, & PyTorch with B...
cluster(python)
cluster(python)
Introduction to TensorFlow 2.0
Introduction to TensorFlow 2.0
TensorFlow Lite (r1.5) & Android 8.1 Neural Network API
TensorFlow Lite (r1.5) & Android 8.1 Neural Network API
TensorFlow example for AI Ukraine2016
TensorFlow example for AI Ukraine2016
slide-keras-tf.pptx
slide-keras-tf.pptx
maXbox starter65 machinelearning3
maXbox starter65 machinelearning3
From Tensorflow Graph to Tensorflow Eager
From Tensorflow Graph to Tensorflow Eager
Keras and TensorFlow
Keras and TensorFlow
vertopal.com_DataEncodingForDataClustering-5 (1).pdf
vertopal.com_DataEncodingForDataClustering-5 (1).pdf
TensorFlow for IITians
TensorFlow for IITians
Neural networks using tensor flow in amazon deep learning server
Neural networks using tensor flow in amazon deep learning server
Programming in C (part 2)
Programming in C (part 2)
C sharp chap6
C sharp chap6
Power ai tensorflowworkloadtutorial-20171117
Power ai tensorflowworkloadtutorial-20171117
Machine learning with py torch
Machine learning with py torch
TensorFlow.Data 및 TensorFlow Hub
TensorFlow.Data 및 TensorFlow Hub
Python basic
Python basic
NUS-ISS Learning Day 2019-Deploying AI apps using tensor flow lite in mobile ...
NUS-ISS Learning Day 2019-Deploying AI apps using tensor flow lite in mobile ...
More from Mijeong Jeon
Azure_CogSearch_OAI.pdf
Azure_CogSearch_OAI.pdf
Mijeong Jeon
Performance Comparing : ONNX, TF, PyTorch
Performance Comparing : ONNX, TF, PyTorch
Mijeong Jeon
let us: Go! 2019 Summer 앱 수익으로 월세내기
let us: Go! 2019 Summer 앱 수익으로 월세내기
Mijeong Jeon
Azure AutoML 함께 실습하기
Azure AutoML 함께 실습하기
Mijeong Jeon
iOS 모바일에서 한글 손글씨 인식하기(with Keras)
iOS 모바일에서 한글 손글씨 인식하기(with Keras)
Mijeong Jeon
180825 azure ai
180825 azure ai
Mijeong Jeon
내 손 위의 딥러닝_iOS에 딥러닝 심기
내 손 위의 딥러닝_iOS에 딥러닝 심기
Mijeong Jeon
프알못의 Realm 사용기
프알못의 Realm 사용기
Mijeong Jeon
More from Mijeong Jeon
(8)
Azure_CogSearch_OAI.pdf
Azure_CogSearch_OAI.pdf
Performance Comparing : ONNX, TF, PyTorch
Performance Comparing : ONNX, TF, PyTorch
let us: Go! 2019 Summer 앱 수익으로 월세내기
let us: Go! 2019 Summer 앱 수익으로 월세내기
Azure AutoML 함께 실습하기
Azure AutoML 함께 실습하기
iOS 모바일에서 한글 손글씨 인식하기(with Keras)
iOS 모바일에서 한글 손글씨 인식하기(with Keras)
180825 azure ai
180825 azure ai
내 손 위의 딥러닝_iOS에 딥러닝 심기
내 손 위의 딥러닝_iOS에 딥러닝 심기
프알못의 Realm 사용기
프알못의 Realm 사용기
Recently uploaded
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
Christoph Pohl
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
Alina Yurenko
Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...
OnePlan Solutions
The Evolution of Karaoke From Analog to App.pdf
The Evolution of Karaoke From Analog to App.pdf
Power Karaoke
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
umasea
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
OnePlan Solutions
Folding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a series
Philip Schwarz
Professional Resume Template for Software Developers
Professional Resume Template for Software Developers
Vinodh Ram
Salesforce Certified Field Service Consultant
Salesforce Certified Field Service Consultant
AxelRicardoTrocheRiq
Unveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML Diagrams
Ahmed Mohamed
Cloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEE
VICTOR MAESTRE RAMIREZ
What is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need It
Wave PLM
EY_Graph Database Powered Sustainability
EY_Graph Database Powered Sustainability
Neo4j
Unveiling the Future: Sylius 2.0 New Features
Unveiling the Future: Sylius 2.0 New Features
Łukasz Chruściel
Asset Management Software - Infographic
Asset Management Software - Infographic
Hr365.us smith
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
Ortus Solutions, Corp
英国UN学位证,北安普顿大学毕业证书1:1制作
英国UN学位证,北安普顿大学毕业证书1:1制作
qr0udbr0
Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024
Andreas Granig
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Christina Lin
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽❤️🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽❤️🧑🏻 89...
gurkirankumar98700
Recently uploaded
(20)
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...
The Evolution of Karaoke From Analog to App.pdf
The Evolution of Karaoke From Analog to App.pdf
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
Folding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a series
Professional Resume Template for Software Developers
Professional Resume Template for Software Developers
Salesforce Certified Field Service Consultant
Salesforce Certified Field Service Consultant
Unveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML Diagrams
Cloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEE
What is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need It
EY_Graph Database Powered Sustainability
EY_Graph Database Powered Sustainability
Unveiling the Future: Sylius 2.0 New Features
Unveiling the Future: Sylius 2.0 New Features
Asset Management Software - Infographic
Asset Management Software - Infographic
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
英国UN学位证,北安普顿大学毕业证书1:1制作
英国UN学位证,北安普顿大学毕业证书1:1制作
Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽❤️🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽❤️🧑🏻 89...
iOS와 케라스의 만남
1.
iOS Keras
2.
AlphaGoWHY CoreML
3.
You have just
found Keras
4.
• Francois Chollet •
API • TesnsorFlow, Theano, CNTK
5.
############################ ###DNN in TensorFlow
Only### ############################ import tensorflow as tf from tensorflow.examples.tutorials.mnist import input_data ###1. Load data set, and split it if necessary mnist = input_data.read_data_sets("MNIST_data/") ###2. we create a holder, a container to place the computation activities in tensorflow ###identifying format and tensor's r/c, null means any kind VISIBLE_NODES = 784 HIDDEN_NODES = 400 x = tf.placeholder("float", shape=[None, VISIBLE_NODES]) y = tf.placeholder("float", shape=[None, 10]) ###3. We identify weights and biases with tensor shape, start with 0 weights = tf.Variable(tf.random_normal((VISIBLE_NODES, HIDDEN_NODES), mean=0.0, stddev=1. / VISIBLE_NODES)) hidden_bias = tf.Variable(tf.zeros([HIDDEN_NODES])) visible_bias = tf.Variable(tf.zeros([VISIBLE_NODES])) ###4. set up the sigmoid model and multiply x and W with matmul function, building the ###hidden layer and reconstruction layer hidden_activation = tf.nn.sigmoid(tf.matmul(x, weights) + hidden_bias) visible_reconstruction = tf.nn.sigmoid(tf.matmul(hidden_activation, tf.transpose(weights)) + visible_bias) final_hidden_activation = tf.nn.sigmoid(tf.matmul(visible_reconstruction, weights) + hidden_bias) ###5. This process can be understood as being two phases of learning ###positive and negative or, more poetically, waking and sleeping positive_phase = tf.matmul(tf.transpose(x), hidden_activation) negative_phase = tf.matmul(tf.transpose(visible_reconstruction), final_hidden_activation) LEARNING_RATE = 0.01 weight_update = weights.assign_add(LEARNING_RATE * (positive_phase - negative_phase)) visible_bias_update = visible_bias.assign_add(LEARNING_RATE * tf.reduce_mean(x - visible_reconstruction, 0)) hidden_bias_update = hidden_bias.assign_add(LEARNING_RATE * tf.reduce_mean(hidden_activation - final_hidden_activation, 0)) ###6. Now we create the operations for scaling the hidden and visible biases, with loss ###function feedback train_op = tf.group(weight_update, visible_bias_update, hidden_bias_update) loss_op = tf.reduce_sum(tf.square(x - visible_reconstruction)) ###7. We start the session session = tf.Session() session.run(tf.global_variables_initializer()) current_epochs = 0 ###8.Run the session for i in range(20): total_loss = 0 while mnist.train.epochs_completed == current_epochs: batch_inputs, batch_labels = mnist.train.next_batch(100) _, reconstruction_loss = session.run([train_op, loss_op], feed_dict={input_placeholder: batch_inputs}) total_loss += reconstruction_loss print("epochs %s loss %s" % (current_epochs, reconstruction_loss)) current_epochs = mnist.train.epochs_completed ############################## ###DNN in TensorFlow KeRas ### ############################## ###1. Load Data and Splot Data from keras.datasets import mnist from keras.models import Sequential from keras.layers.core import Dense, Activation from keras.utils import np_utils (X_train, Y_train), (X_test, Y_test) = mnist.load_data() ###2.Preprocess X_train = X_train.reshape(60000, 784) X_test = X_test.reshape(10000, 784) X_train = X_train.astype('float32') X_test = X_test.astype('float32') X_train /= 255 X_test /= 255 classes = 10 Y_train = np_utils.to_categorical(Y_train, classes) Y_test = np_utils.to_categorical(Y_test, classes) ###3. Set up parameters input_size = 784 batch_size = 100 hidden_neurons = 400 epochs = 30 ###4.Build the model model = Sequential() model.add(Dense(hidden_neurons, input_dim=input_size)) model.add(Activation('relu')) model.add(Dense(classes, input_dim=hidden_neurons)) model.add(Activation('softmax')) model.compile(loss='categorical_crossentropy', metrics=['accuracy'], optimizer='adadelta') model.fit(X_train, Y_train, batch_size=batch_size, epochs=epochs, verbose=1) ###5.Test score = model.evaluate(X_test, Y_test, verbose=1) print('n''Test accuracy:', score[1]) #Test accuracy: 0.983 VS Keras TensorFlow https://charleshsliao.wordpress.com/2017/06/19/dnn-and-cnn-of-tensorflowkeras-with-mnist-data/ weights = tf.Variable(tf.random_normal((VISIBLE_NODES, HIDDEN_NODES), mean=0.0, stddev=1. / VISIBLE_NODES)) hidden_bias = tf.Variable(tf.zeros([HIDDEN_NODES])) visible_bias = tf.Variable(tf.zeros([VISIBLE_NODES])) hidden_activation = tf.nn.sigmoid(tf.matmul(x, weights) + hidden_bias) visible_reconstruction = tf.nn.sigmoid(tf.matmul(hidden_activation, tf.transpose(weights)) + visible_bias) final_hidden_activation = tf.nn.sigmoid(tf.matmul(visible_reconstruction, weights) + hidden_bias) TensorFlow input_size = 784 batch_size = 100 hidden_neurons = 400 epochs = 30 model = Sequential() model.add(Dense(hidden_neurons, input_dim=input_size)) model.add(Activation('relu')) model.add(Dense(classes, input_dim=hidden_neurons)) model.add(Activation('softmax')) Keras
6.
𝒀 = 𝑤
× 𝑿 + 𝑏 𝒀 𝑤 𝑿 𝑏 𝒀 𝑤 𝑿 𝑏 𝑤 𝑏 ! 𝑤 𝑏 𝑤 𝑏 𝑤 𝑏
7.
𝑤 𝑏 ! :
https://tykimos.github.io/
8.
9.
Rectangle Circle Triangle
10.
11.
from keras.preprocessing.image import
ImageDataGenerator # 1. train_datagen = ImageDataGenerator(rescale=1./255) train_generator = train_datagen.flow_from_directory( ‘data_set/train’, // target_size=(28, 28), // batch_size=10, // class_mode=‘categorical') //
12.
from keras.models import
Sequential from keras.layers import Dense, Flatten from keras.layers.convolutional import Conv2D, MaxPooling2D # 2. model = Sequential() // model.add(Conv2D(32, // ?? kernel_size=(3, 3), // ?? activation=‘relu’, // input_shape=(28, 28, 3)) // ( , ) model.add(Conv2D(64, (3, 3), activation=‘relu')) // model.add(MaxPooling2D(pool_size=(2, 2))) // ?? model.add(Flatten()) // -> ?? model.add(Dense(128, activation=‘relu')) model.add(Dense(4, activation='softmax'))
13.
: https://tykimos.github.io/
14.
: https://tykimos.github.io/
15.
: https://tykimos.github.io/
16.
: https://tykimos.github.io/
17.
# 2. from keras.models
import Sequential from keras.layers import Dense, Flatten from keras.layers.convolutional import Conv2D, MaxPooling2D model = Sequential() // model.add(Conv2D(32, // kernel_size=(3, 3), // activation=‘relu’, // input_shape=(28, 28, 3)) // ( , ) model.add(Conv2D(64, (3, 3), activation=‘relu')) // model.add(MaxPooling2D(pool_size=(2, 2))) // model.add(Flatten()) // -> model.add(Dense(128, activation=‘relu’)) // model.add(Dense(4, activation=‘softmax')) //
18.
# 3. model.compile(loss='categorical_crossentropy', optimizer='adam', metrics=[‘accuracy'])
// # 4. model.fit_generator( train_generator, // steps_per_epoch=30, // / (=300/10) epochs=150) // # 5. score=model.evaluate_generator(test_generator, steps=3)
19.
# 6. coreml import
coremltools coreml_model = coremltools.converters.keras.convert(model, input_names=‘image’, // = output_names=‘class', image_input_names = ‘image', class_labels = ['circle', 'rectangle', ‘triangle'], // is_bgr=True) coreml_model.save(‘shape_detect_with_keras.mlmodel') //
20.
# 7. coreml import
CoreML let model = shape_detect_with_keras() guard let output: shape_detect_with_kerasOutput = try? model.prediction(image: image) else { return }
21.
You have just
found Keras
22.
https://github.com/MijeongJeon/ShapeDetector_Keras_CoreML/ ninevincentg@gmail.com
Download now