Skip to content

Commit 6b46ea8

Browse files
committed
update of revising chapter 1
1 parent dc0c7dc commit 6b46ea8

13 files changed

+323
-465
lines changed

tex_pdf/api/python/c4s01_framework.tex

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -863,7 +863,7 @@ \subsubsection{class \lstinline{tf.Operation}} \label{class-tf.operation}
863863
\begin{center}\rule{0.5\linewidth}{\linethickness}\end{center}
864864

865865
\paragraph{\texorpdfstring{\lstinline{tf.Operation.run(feed_dict=None, session=None)}
866-
}{tf.Operation.run(feed_dict=None, session=None) }}\label{tf.operation.runfeedux5fdictnone-sessionnone}
866+
}{tf.Operation.run(feed_dict=None, session=None) }}\label{tf.operation.run}
867867

868868
Runs this operation in a \lstinline{Session}.
869869

@@ -1115,7 +1115,7 @@ \subsubsection{\texorpdfstring{\lstinline{class tf.Tensor}
11151115
\begin{center}\rule{0.5\linewidth}{\linethickness}\end{center}
11161116

11171117
\paragraph{\texorpdfstring{\lstinline{tf.Tensor.eval(feed_dict=None, session=None)}
1118-
}{tf.Tensor.eval(feed_dict=None, session=None) }}\label{tf.tensor.evalfeedux5fdictnone-sessionnone}
1118+
}{tf.Tensor.eval(feed_dict=None, session=None) }}\label{tf.tensor.eval}
11191119

11201120
Evaluates this tensor in a \lstinline{Session}.
11211121

tex_pdf/api/python/c4s12_client.tex

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,7 @@ \subsection{Session management }\label{session-management}
6767

6868
\begin{center}\rule{0.5\linewidth}{\linethickness}\end{center}
6969

70-
\subsubsection{\texorpdfstring{\texttt{class\ tf.Session}
71-
}{class tf.Session }}\label{class-tf.session}
70+
\subsubsection{class \lstinline{tf.Session}} \label{class-tf.session}
7271

7372
A class for running TensorFlow operations.
7473

@@ -165,7 +164,7 @@ \subsubsection{\texorpdfstring{\texttt{class\ tf.Session}
165164
\begin{center}\rule{0.5\linewidth}{\linethickness}\end{center}
166165

167166
\paragraph{\texorpdfstring{\texttt{tf.Session.run(fetches,\ feed\_dict=None)}
168-
}{tf.Session.run(fetches, feed\_dict=None) }}\label{tf.session.runfetches-feedux5fdictnone}
167+
}{tf.Session.run(fetches, feed\_dict=None) }}\label{tf.session.run}
169168

170169
Runs the operations and evaluates the tensors in \texttt{fetches}.
171170

Lines changed: 25 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,24 @@
1+
%!TEX program = xelatex
2+
% Encoding: UTF8
3+
% SEIKA 2016 | [email protected]
14

2-
%✠% \section {Introduction}
3-
\section{简介}
5+
% Chapter 1
6+
% Section 1.1 Introduction
47

5-
%✠% Let's get you up and running with TensorFlow!
6-
❂本章的目的是让你了解和运行 TensorFlow!
8+
\section{Introduction || 简介}
79

8-
%✠% 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.
10+
\textcolor{etc}{Let's get you up and running with TensorFlow!}
911

10-
❂在开始之前, 让我们先看一段使用 Python API 撰写的 TensorFlow 示例代码,
12+
Ⓒ 本章的目的是让你了解和运行 TensorFlow!
13+
14+
\textcolor{etc}{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.}
15+
16+
Ⓒ 在开始之前, 让我们先看一段使用 Python API 撰写的 TensorFlow 示例代码,
1117
让你对将要学习的内容有初步的印象.
1218

13-
%✠% Here's a little Python program that makes up some data in two dimensions, and then fits a line to it.
19+
\textcolor{etc}{Here's a little Python program that makes up some data in two dimensions, and then fits a line to it.}
1420

15-
下面这段短小的Python程序将把一些数据放入二维空间,再用一条线来拟合这些数据。
21+
下面这段短小的Python程序将把一些数据放入二维空间,再用一条线来拟合这些数据。
1622

1723
\begin{lstlisting}
1824
import tensorflow as tf
@@ -34,7 +40,7 @@ \section{简介}
3440
optimizer = tf.train.GradientDescentOptimizer(0.5)
3541
train = optimizer.minimize(loss)
3642

37-
# Before starting, initialize the variables. We will 'run' this first.
43+
# Before starting, initialize the variables. We will 'run' this first.
3844
init = tf.initialize_all_variables()
3945

4046
# Launch the graph.
@@ -43,44 +49,31 @@ \section{简介}
4349

4450
# Fit the line.
4551
for step in xrange(201):
46-
sess.run(train)
47-
if step % 20 == 0:
48-
print(step, sess.run(W), sess.run(b))
52+
sess.run(train)
53+
if step % 20 == 0:
54+
print(step, sess.run(W), sess.run(b))
4955

5056
# Learns best fit is W: [0.1], b: [0.3]
5157
\end{lstlisting}
5258

53-
%✠% 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.
59+
\textcolor{etc}{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.}
5460

55-
%✠% 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.
61+
Ⓒ 以上代码的第一部分构建了数据的流向图(flow graph)。在一个session被建立并且\lstinline{run()}函数被运行前,TensorFlow不会进行任何实质的计算。
5662

57-
❂以上代码的第一部分构建了数据的流向图(flow graph)。在一个session被建立并且\lstinline{run()}函数被运行前,TensorFlow不会进行任何实质的计算。
63+
\textcolor{etc}{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.}
5864

59-
为了进一步激发你的学习欲望,我们想让你先看一下TensorFlow是如何解决一个经典的机器学习问题的。在神经网络领域,最为经典的问题莫过于MNIST手写数字分类。为此,我们准备了两篇不同的教程,分别面向初学者和专家。如果你已经使用其它软件训练过许多MNIST模型, 请参阅\hyperref[MINIST_pros]{高级教程(红色药丸)}。如果你以前从未听说过 MNIST, 请先阅读\hyperref[MINIST_beginner]{初级教程(蓝色药丸)}。如果你的水平介于这两类人之间,我们建议你先快速浏览\hyperref[MINIST_beginner]{初级教程}, 然后再阅读\hyperref[MINIST_pros]{高级教程}。
65+
为了进一步激发你的学习欲望,我们想让你先看一下TensorFlow是如何解决一个经典的机器学习问题的。在神经网络领域,最为经典的问题莫过于MNIST手写数字分类。为此,我们准备了两篇不同的教程,分别面向初学者和专家。如果你已经使用其它软件训练过许多MNIST模型, 请参阅\hyperref[MINIST_pros]{高级教程(红色药丸)}。如果你以前从未听说过 MNIST, 请先阅读\hyperref[MINIST_beginner]{初级教程(蓝色药丸)}。如果你的水平介于这两类人之间,我们建议你先快速浏览\hyperref[MINIST_beginner]{初级教程}, 然后再阅读\hyperref[MINIST_pros]{高级教程}。
6066

6167
% Add pics and links here.
6268

63-
%✠% If you're already sure you want to learn and install TensorFlow you can skip these and charge ahead. Don't worry, you'll still get to see MNIST -- we'll also use MNIST as an example in our technical tutorial where we elaborate on TensorFlow features.
69+
\textcolor{etc}{If you're already sure you want to learn and install TensorFlow you can skip these and charge ahead. Don't worry, you'll still get to see MNIST -- we'll also use MNIST as an example in our technical tutorial where we elaborate on TensorFlow features.}
6470

6571
\begin{center}
6672
\includegraphics[width=.45\textwidth]{../SOURCE/images/blue_pill.png}
6773
\includegraphics[width=.45\textwidth]{../SOURCE/images/red_pill.png}
6874
\end{center}
6975

70-
如果你已下定决心准备学习和安装TensorFlow,你可以略过这些文字,直接阅读
71-
后面的章节\footnote{\textbf{推荐随后阅读内容}:\hyperref[download_install]{1 下载与安装}, \hyperref[basic_usage]{2 基本使用}, \hyperref[tf_mech101]{3 TensorFlow 101}.}。不用担心,你仍然会看到MNIST--在阐述TensorFlow的特性时,
76+
如果你已下定决心准备学习和安装TensorFlow,你可以略过这些文字,直接阅读
77+
后面的章节\footnote{\textbf{推荐随后阅读内容}:\hyperref[download_install]{1 下载与安装}, \hyperref[basic_usage]{2 基本使用}, \hyperref[tf_mech101]{3 TensorFlow 101}.}。不用担心,你仍然会看到MNIST---在阐述TensorFlow的特性时,
7278
我们还会使用MNIST作为一个样例。
7379

74-
75-
%✠% \textbf{Recommended Next Steps}
76-
%✠%Download and Setup
77-
%✠%Basic Usage
78-
%✠%TensorFlow Mechanics 101
79-
80-
81-
%% \textbf{推荐随后阅读内容}:
82-
%% \begin{itemize}
83-
%% \item \hyperref[download_install]{下载与安装}\\
84-
%% \item \hyperref[basic_usage]{基本使用}\\
85-
%% \item \hyperref[tf_mech101]{TensorFlow 101}\\
86-
%% \end{itemize}

0 commit comments

Comments
 (0)