12/08/2018, 14:36

Build a Machine Learning Application with TensorFlow Part I

Nowadays, there are lots of marching learning applications such as chat bot, game, stock prediction, object recognition, machine translation, speech recognition, self-serving car .etc. Meanwhile, I have beed fascinated with machine learning since I studied this at my university. Therefore, I have ...

Nowadays, there are lots of marching learning applications such as chat bot, game, stock prediction, object recognition, machine translation, speech recognition, self-serving car .etc. Meanwhile, I have beed fascinated with machine learning since I studied this at my university. Therefore, I have committed to build my own machine learning applications in this year. After month of my research, I found TensorFlow which help me to build machine learning application easily. So, what is TensorFlow?

What is TensorFlow?

TensorFlow is a famous machine learning library which created by google brain team and is being open sourced under the Apache 2.0 open source license. It suite for students, researchers, hobbyists, hackers, engineers, developers, inventors and innovators to have some fun or use this product to build their amazing products. it can be run on many platforms such as CPUs or GPUs, and on desktop, server, or mobile and no need of any additional special hardware. It also come with many languages Python, C++, Java, or Go programs, and lots of company already use TensorFlow to build their products such as google, twitter, ebay, dropbox,... Now it time to set it up on our local machine, so we can play around with it too.

Set up TensorFlow

There are lots of ways to install TensorFlow but in this article I am going to use pip for the installation on my machine. And here the command need for install TensorFlow:

# Mac OS X
$ sudo easy_install pip
$ sudo easy_install --upgrade six
$ pip install tensorflow
# Mac OS X, CPU only, Python 2.7:
$ export TF_BINARY_URL=https://storage.googleapis.com/tensorflow/mac/cpu/tensorflow-0.12.1-py2-none-any.whl
# Python 2
$ sudo pip install --upgrade $TF_BINARY_URL

And you can find a full detail of installation instruction from here.

Test TensorFlow

$ python
>>> import tensorflow as tf
>>> hello = tf.constant('Hello, TensorFlow!')
>>> sess = tf.Session()
>>> print(sess.run(hello))
Hello, TensorFlow!
>>> a = tf.constant(10)
>>> b = tf.constant(32)
>>> print(sess.run(a + b))
42
>>>

Resources

  • TensorFlow official web site
  • TensorFlow download and set up instruction
  • Free Course Deep Learning by Google https://www.udacity.com/course/deep-learning--ud730

What Next

For the next articles, I am going to show you how can we easily and quicky use TensorFlow to build a chat bot, image recognition, stock prediction and more. However, you need to know python first since we are going to use python language for our development. So, be ready to build our awesome APPs.

0