Developing Machine Learning Applications With TensorFlow

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 22

Developing Machine

Learning Applications
with TensorFlow
Marc Anthony Reyes (@marcreyesph)
AI Developer Intern, Wela School Systems
BS Computer Science, Xavier University – Ateneo de Cagayan
About Me
• 19 years of age (September 7, 1998)
• 3rd Year BS Computer Science
• Creative Lead at GDG Cagayan de Oro
• Likes The Purge (The First Purge is coming soon in
theaters in July)
• Loves cats

Portions of this slide is using Algorithmia’s Machine Learning presentation. Visit https://blog.algorithmia.com/building-intelligent-applications/ for details.
When I had a first
glimpse on ML
What is Machine
Learning?
What is Machine Learning?
• Arthur Samuel, an American pioneer in the field of
computer gaming and artificial intelligence, coined the
term “Machine Learning” in 1959 while at IBM.
• “A computer program is said to learn from experience E
with respect to some class of tasks T and performance
measure P if its performance at tasks in T, as measured
by P, improves with experience E” (Mitchell, 1997)

Portions of this slide is using Algorithmia’s Machine Learning presentation. Visit https://blog.algorithmia.com/building-intelligent-applications/ for details.
Types of Learning
• Supervised learning
The computer is presented with example inputs and their
desired outputs, given by a “teacher”, and the goal is to
learn a general rule that maps inputs to outputs.
• Unsupervised learning
No labels are given to the learning algorithm, leaving it on
its own to find structure in its input. Unsupervised
learning can be a goal in itself (discovering hidden patterns
in data) or a means towards an end (feature learning)

Portions of this slide is using Algorithmia’s Machine Learning presentation. Visit https://blog.algorithmia.com/building-intelligent-applications/ for details.
What can Machine Learning do?
• Natural Language Processing (NLP)
• Sentiment analysis (“I do not like that
book”)
• Language detection
• Image recognition
• Cat or dog, model of car, types of objects in
frame
• Facial recognition (group photos by
individual)
• Hotdog or not hotdog?
• Prediction
• Trends (weather, stocks, product sales)
• Agents
• Automated game players, chatbots

Portions of this slide is using Algorithmia’s Machine Learning presentation. Visit https://blog.algorithmia.com/building-intelligent-applications/ for details.
Machine Learning Libraries
• Natural Language Toolkit (NLTK)
• Language processing in Python:
Parts of speech, named entities,
parse trees
• TensorFlow
• Open source software library for
numerical computation
• Flexible architecture
• Originally made by researchers
and engineers at Google Brain
• TensorFlow Lite: Machine Learning
apps for android

Portions of this slide is using Algorithmia’s Machine Learning presentation. Visit https://blog.algorithmia.com/building-intelligent-applications/ for details.
What is TensorFlow?
• TensorFlow is an open-source
software library for dataflow
programming across a range of
tasks. It is a symbolic math
library, and also used for machine
learning applications such as
neural networks.
• In May 2017 Google announced a
software stack specifically for
Android development, TensorFlow
Lite, beginning with Android Oreo.

Portions of this presentation are use Algorithmia’s Machine Learning presentation. Visit https://blog.algorithmia.com/building-intelligent-applications/ for details.
What is required from me?
• Mathematics
• Understanding of Statistics, Linear Algebra (Matrix Operations, Tensors),
Calculus
• Programming
• Knowledge in Python, Scala, Java, or R
• Domain Knowledge
• Know your problem and your data
• Software Engineering
• Questions about performance and integration of ML models
• Burning passion to pursue ML
• Don’t get frustrated if you don’t get it the first time
• Practice, practice, practice
• Read books
Portions of this slide is using Algorithmia’s Machine Learning presentation. Visit https://blog.algorithmia.com/building-intelligent-applications/ for details.
Building ML Apps with
TensorFlow Eager
Execution
What is Eager Execution?
• TensorFlow's eager execution is an imperative
programming environment that evaluates operations
immediately, without building graphs.
• Operations return concrete values instead of
constructing a computational graph to run later.
Graph Execution vs Eager Execution

Graph Execution Eager Execution


import tensorflow as tf import tensorflow as tf

sess = tf.InteractiveSession() tf.enable_eager_execution()


tf.executing_eagerly() # Prints true
a = tf.constant(3)
b = tf.constant(5) a = 3
b = 5
multiply = tf.multiply(a, b)
print(multiply) # prints multiply = tf.multiply(a, b)
Tensor("Mul_2:0", shape=(), dtype=int32)
multiply.eval(feed_dict={a: 3, b: 5})
print(multiply) # prints 15
# prints 15
What do I need?

Interactive IDE Data Processing and Visualization ML Libraries


(e.g. Jupyter Notebook) Libraries (e.g. TensorFlow, Theano,
(e.g. matplotlib, ggplot2, Scikit-learn)
numpy, scipy)
Demo:
Iris
Classification
Problem
The Iris Classification Problem

The Iris genus entails about 300 species, but our program will classify only the following
three: Iris setosa, Iris virginica, and Iris versicolor.
Things to consider
• Make sure your images are of lesser file size for faster
processing
• Your images should be of the same dimensions; machine
learning works on image datasets of the same sizes
• Check the version of the data visualization library you’re
using
• Choosing the right activation function and Machine
Learning algorithm for your ML projects (LSTM for NLP,
SVM for Image Processing Classification, etc)
• Funded by Jollibee FEP
Youth Program
• Develop an intelligent pest
and crop monitoring
system via drone imaging
• Analyze crop health and
whether crops are infested
by gathering image data
and analyzing them with
image processing
Tanumbotics
(from left to right:
Marc Anthony Reyes,
Jessa Balagtas, Joseph
Philip Fernan Gaston,
John Neijzen, Fidel
Ivan Racines)
Conclusion

“It always seems impossible


until it is done”
–Nelson Mandela
is looking
for a Web
Developer
Thank you
very much!
Social Media / @marcreyesph
E-mail / hello@marcreyes.ph

You might also like