- Download tensorflow at https://www.tensorflow.org/install/
- If using conda, download at https://conda.io/docs/user-guide/install/download.html
- Tensor: an array or matrix of values
- Method of defining tensors and operations on tensors
- Each operation of two tensors returns another tensor
- Tensorflow defines many useful operations out of the box (such as softmax), making it easy to create neural nets
- Tensorflow lets you define tensors and operations in python, and then runs them very efficiently in C, only returning to python after all computation is finished
- Windows: install natively with pip or use conda
- Linux and Mac: install with pip or with virtualenv
- If using conda, follow conda installation wizard
- With pip, simply run pip3 install --upgrade tensorflow
- open up an interactive console and start python
- let's simply compute the dot product of two tensors X, Y using tf
- to create a tensor X, use tf.placeholder()
- "X*Y" is a shorthand for matrix multiplication; this will multiply our tensors
- to actually begin computation, define an interactive session and use it to evaluate our tensors
Code:
>>>X = tf.placeholder(tf.float32,[3], name='X')
>>>Y = tf.placeholder(tf.float32,[3], name='Y')
>>>mult = X * tf.transpose(Y)
>>>sess = tf.InteractiveSession()
>>>sess.run(mult, feed_dict={X:[1,2,3], Y:[1,2,3]})
Follow the instructions at https://www.tensorflow.org/versions/r1.1/get_started/mnist/beginners
These instructions are for an outdated version of tensorflow, but still work. I choose this tutorial because it is very simple, and exposes the math behind the neural network. More recent tutorials focus on data manipulation/feature extraction and use of the high level estimators API.
Those wishing more experience with ML and tensorflow should follow the more recent tutorial, available here: https://www.tensorflow.org/get_started/get_started_for_beginners