Tensorflow 01 Introduction - yoshiweb/labs GitHub Wiki
Tensorflow - 01 Introduction
https://www.tensorflow.org/versions/r0.10/get_started/index.html
Introduction
導入
Let's get you up and running with TensorFlow!
TensorFlowで実行してみましょう!
But before we even get started, let's peek at what TensorFlow code looks like in the Python API, so you have a sense of where we're headed.
私たちも、始める前に、しかし、のは、Python APIのように見えるものTensorFlowコードを覗いてみましょう、あなたは、私たちが向かっている場所の感覚を持っています。
Here's a little Python program that makes up some data in two dimensions, and then fits a line to it.
これは、2つの次元でいくつかのデータを構成し、それに行を収まる小さなPythonプログラムです。
import tensorflow as tf
import numpy as np
# Create 100 phony x, y data points in NumPy, y = x * 0.1 + 0.3
x_data = np.random.rand(100).astype(np.float32)
y_data = x_data * 0.1 + 0.3
# Try to find values for W and b that compute y_data = W * x_data + b
# (We know that W should be 0.1 and b 0.3, but TensorFlow will
# figure that out for us.)
W = tf.Variable(tf.random_uniform([1], -1.0, 1.0))
b = tf.Variable(tf.zeros([1]))
y = W * x_data + b
# Minimize the mean squared errors.
loss = tf.reduce_mean(tf.square(y - y_data))
optimizer = tf.train.GradientDescentOptimizer(0.5)
train = optimizer.minimize(loss)
# Before starting, initialize the variables. We will 'run' this first.
init = tf.initialize_all_variables()
# Launch the graph.
sess = tf.Session()
sess.run(init)
# Fit the line.
for step in range(201):
sess.run(train)
if step % 20 == 0:
print(step, sess.run(W), sess.run(b))
# Learns best fit is W: [0.1], b: [0.3]
The first part of this code builds the data flow graph. TensorFlow does not actually run any computation until the session is created and the run function is called.
このコードの最初の部分では、データフローグラフを構築します。 セッションが作成されるまでTensorFlowは、実際に計算を実行していないrun 関数が呼び出されます。
To whet your appetite further, we suggest you check out what a classical machine learning problem looks like in TensorFlow. In the land of neural networks the most "classic" classical problem is the MNIST handwritten digit classification. We offer two introductions here, one for machine learning newbies, and one for pros. If you've already trained dozens of MNIST models in other software packages, please take the red pill. If you've never even heard of MNIST, definitely take the blue pill. If you're somewhere in between, we suggest skimming blue, then red.
さらに、あなたの食欲を満たすために、我々はあなたが古典的な機械学習の問題はTensorFlowでどのように見えるかをチェックしてください示唆しています。 ニューラルネットワークの土地で最も「古典的な「古典的な問題がMNIST手書き数字の分類です。 我々は2つのここで紹介、機械学習初心者のための1、およびプロのための1つを提供しています。 あなたは既に他のソフトウェアパッケージにMNISTモデルの数十を訓練してきた場合は、赤いピルを服用してください。 あなたもMNIST聞いたことがない場合は、間違いなく青い錠剤を取ります。 あなたはどこかの間であれば、我々はその後、赤、青のスキミングを示唆しています。
あなたは既に確認している場合、あなたは学び、あなたがこれらをスキップして先に充電することができますTensorFlowインストールしたいです。心配しないで、あなたはまだMNISTを見るために取得します - 私たちはまた、我々はTensorFlowの機能について詳しく説明当社の技術チュートリアルの例としてMNISTを使用します。