diff --git a/README.md b/README.md index 042b5d2..500f30e 100644 --- a/README.md +++ b/README.md @@ -101,7 +101,8 @@ Jeff回信原文: 这样的一个高技术领域的文档,我们在翻译的过程中,难免会有不完善的地方,希望请大家一起帮助我们持续改进文档的翻译质量,帮助更多的人,方法: - 在GitHub上提Issue或Pull Request,地址为: [https://github.com/jikexueyuanwiki/tensorflow-zh](https://github.com/jikexueyuanwiki/tensorflow-zh) -- 加入我们的QQ群提建议--协同翻译群:248320884,技术交流群:551830261 +- 加入TensorFlow技术交流群,与TensorFlower们一起研究交流技术干货--TensorFlow技术交流群:782484288 +- 对翻译感兴趣?加入协同翻译群:248320884,与翻译大神一道研究TensorFlow的本地化 - 给我们写邮件: wiki@jikexueyuan.com ## 感谢支持 diff --git a/SOURCE/how_tos/variable_scope/index.md b/SOURCE/how_tos/variable_scope/index.md index aadc0c0..abfbe15 100755 --- a/SOURCE/how_tos/variable_scope/index.md +++ b/SOURCE/how_tos/variable_scope/index.md @@ -55,7 +55,7 @@ result1 = my_image_filter(image1, variables_dict) result2 = my_image_filter(image2, variables_dict) ``` 虽然使用上面的方式创建变量是很方便的,但是在这个模块代码之外却破坏了其封装性: -* 在构建试图的代码中标明变量的名字,类型,形状来创建. +* 在构建视图的代码中标明变量的名字,类型,形状来创建. * 当代码改变了,调用的地方也许就会产生或多或少或不同类型的变量. 解决此类问题的方法之一就是使用类来创建模块,在需要的地方使用类来小心地管理他们需要的变量. diff --git a/SOURCE/tutorials/mnist_beginners.md b/SOURCE/tutorials/mnist_beginners.md index f518f7e..a277e35 100755 --- a/SOURCE/tutorials/mnist_beginners.md +++ b/SOURCE/tutorials/mnist_beginners.md @@ -20,7 +20,7 @@ MNIST是一个入门级的计算机视觉数据集,它包含各种手写数字 MNIST数据集的官网是[Yann LeCun's website](http://yann.lecun.com/exdb/mnist/)。在这里,我们提供了一份python源代码用于自动下载和安装这个数据集。你可以下载[这份代码](https://raw.githubusercontent.com/tensorflow/tensorflow/master/tensorflow/examples/tutorials/mnist/input_data.py),然后用下面的代码导入到你的项目里面,也可以直接复制粘贴到你的代码文件里面。 ```python -import tensorflow.examples.tutorials.mnist.input_data +import tensorflow.examples.tutorials.mnist.input_data as input_data mnist = input_data.read_data_sets("MNIST_data/", one_hot=True) ``` diff --git a/SOURCE/tutorials/word2vec/word2vec_basic.py b/SOURCE/tutorials/word2vec/word2vec_basic.py index 7176aa8..3785600 100755 --- a/SOURCE/tutorials/word2vec/word2vec_basic.py +++ b/SOURCE/tutorials/word2vec/word2vec_basic.py @@ -138,7 +138,7 @@ def generate_batch(batch_size, num_skips, skip_window): # tf.nce_loss automatically draws a new sample of the negative labels each # time we evaluate the loss. loss = tf.reduce_mean( - tf.nn.nce_loss(nce_weights, nce_biases, embed, train_labels, + tf.nn.nce_loss(nce_weights, nce_biases, train_labels,embed, num_sampled, vocabulary_size)) # Construct the SGD optimizer using a learning rate of 1.0. @@ -216,7 +216,7 @@ def plot_with_labels(low_dim_embs, labels, filename='tsne.png'): tsne = TSNE(perplexity=30, n_components=2, init='pca', n_iter=5000) plot_only = 500 low_dim_embs = tsne.fit_transform(final_embeddings[:plot_only,:]) - labels = dictionary.keys()[:plot_only] + labels = list(dictionary.keys())[:plot_only] plot_with_labels(low_dim_embs, labels) except ImportError: diff --git a/tex_pdf/get_started/c1s01_introduction.tex b/tex_pdf/get_started/c1s01_introduction.tex index f1c8512..51a5b03 100644 --- a/tex_pdf/get_started/c1s01_introduction.tex +++ b/tex_pdf/get_started/c1s01_introduction.tex @@ -41,7 +41,7 @@ \section{Introduction || 简介} train = optimizer.minimize(loss) # Before starting, initialize the variables. We will 'run' this first. -init = tf.initialize_all_variables() +init = tf.global_variables_initializer() # Launch the graph. sess = tf.Session() diff --git a/tex_pdf/get_started/c1s03_basic_usage.tex b/tex_pdf/get_started/c1s03_basic_usage.tex index c89b59a..9a84a61 100644 --- a/tex_pdf/get_started/c1s03_basic_usage.tex +++ b/tex_pdf/get_started/c1s03_basic_usage.tex @@ -99,7 +99,7 @@ \subsection{Overview | 总览} Ⓔ \textcolor{etc}{The default graph now has three nodes: two constant() ops and one matmul() op. To actually multiply the matrices, and get the result of the multiplication, you must launch the graph in a session.} -Ⓒ 默认图现在拥有三个节点,两个\lstinline{constant()} op,一个\lstinline{matmul()} op. 为了真正进行矩阵乘法运算,得到乘法结果, 你必须在一个会话(session)中载入动这个图。 +Ⓒ 默认图现在拥有三个节点,两个\lstinline{constant()} op,一个\lstinline{matmul()} op. 为了真正进行矩阵乘法运算,得到乘法结果, 你必须在一个会话(session)中载入启动这个图。 %%% @@ -201,7 +201,7 @@ \subsection{Interactive Usage | 交互式使用} x.initializer.run() # Add an op to subtract 'a' from 'x'. Run it and print the result -sub = tf.sub(x, a) +sub = tf.subtract(x, a) print(sub.eval()) # ==> [-2. -1.] @@ -239,7 +239,7 @@ \subsection{Variables | 变量} # Variables must be initialized by running an `init` Op after having # launched the graph. We first have to add the `init` Op to the graph. -init_op = tf.initialize_all_variables() +init_op = tf.global_variables_initializer() # Launch the graph and run the ops. with tf.Session() as sess: @@ -282,7 +282,7 @@ \subsection{Fetches | 取回} input2 = tf.constant(2.0) input3 = tf.constant(5.0) intermed = tf.add(input2, input3) -mul = tf.mul(input1, intermed) +mul = tf.multiply(input1, intermed) with tf.Session() as sess: result = sess.run([mul, intermed]) @@ -311,7 +311,7 @@ \subsection{Feeds | 供给} \begin{lstlisting} input1 = tf.placeholder(tf.float32) input2 = tf.placeholder(tf.float32) -output = tf.mul(input1, input2) +output = tf.multiply(input1, input2) with tf.Session() as sess: print(sess.run([output], feed_dict={input1:[7.], input2:[2.]})) @@ -324,4 +324,4 @@ \subsection{Feeds | 供给} Ⓒ 如果没有正确供给, \lstinline{placeholder()} 操作将会产生一个错误提示.关于feed的规模更大的案例,参见\hyperref[minist_tf]{MNIST 全连通 feed 教程}以及其\href{https://tensorflow.googlesource.com/tensorflow/+/master/tensorflow/g3doc/tutorials/mnist/fully_connected_feed.py}{源代码}。 -\href{http://tensorflow.org/get_started/basic_usage.md}{原文:Basic Usage} \ No newline at end of file +\href{http://tensorflow.org/get_started/basic_usage.md}{原文:Basic Usage}