brief introduction

The purpose of this chapter is to let you understand and run TensorFlow!

Before we begin, let's take a look at a TensorFlow sample code written in Python API, which gives you a preliminary impression of what you are going to learn.

This short Python program generates some three-dimensional data, and then uses a plane to match it.

 Import Tensorflow As TF Import Numpy As NP NumPy uses phony to generate pseudo data (data data). X_data = np.float32 (np.random.rand). Two , One hundred ) Random input Y_data = ([ Zero point one zero zero , Zero point two zero zero [x_data] + Zero point three zero zero

 A linear model for the construction of Chinese oak
 Wei B = tf.Variable (tf.zeros [[ One ] 
W = tf.Variable (tf.random_uniform [[ One , Two ], - One , One ) 
y = tf.matmul (W, x_data) + B Minimization of variance Loss = tf.reduce_mean (tf.square (Y - y_data)) 
optimizer = tf.train.GradientDescentOptimizer ( Zero point five 
train = optimizer.minimize (loss) Initialization variable Init = tf.initialize_all_variables () Graph diagram Sess = tf.Session () (init) Fit plane
 For Step In Xrange ( Zero , Two hundred and one ): (train) If Step% Twenty = = Zero : Print Step, (W), (b) The best fitting result is W: [[0.100 0.200]], b: [0.300].

In order to further stimulate your desire to learn, we want you to see how TensorFlow first solves the classic machine learning problem. In the field of neural network, the most classic problem is the MNIST handwritten numerals classification. We have prepared two different tutorials for beginners and experts in machine learning field. If you have trained many MNIST models using other software, please read the advanced tutorial (red pill link). If you have never heard of MNIST before, please read the junior tutorial (blue pill link). If your level is between these two groups of people, we suggest you quickly browse the junior course and then read the advanced course.

The picture is authorized by CC BY-SA 4; the original author W. Carter.

If you have made up your mind to learn and install TensorFlow, you can skip these words and read the chapters later. Don't worry, you will still see MNIST -- when we describe the characteristics of TensorFlow, we will also use MNIST as a sample.

Recommendation read later:

Original text: Introduction Translation: @doc001 Proofreading: @yangtze