Skip to content

Commit 3f3a805

Browse files
committed
document updated.
1 parent 5b82356 commit 3f3a805

File tree

10 files changed

+70
-30
lines changed

10 files changed

+70
-30
lines changed

docs/source/Constant.md

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,50 @@
11
# Chapter. Constant
22

3+
In TensorFlow, a constant is a special Tensor that cannot be modified while the graph is running. Like in a linear model $\tilde{y_i}=\boldsymbol{w}x_i+b$, constant $b$ can be represented as a Constant Tensor. Since the constant is a Tensor, it also has all the data characteristics of Tensor, including:
4+
5+
* value: scalar value or constant list matching the data type defined in TensorFlow;
6+
* dtype: data type;
7+
* shape: dimensions;
8+
* name: constant's name;
9+
10+
在TensorFlow中,常量是一种特殊的Tensor,它在计算图运行的时候,不能被修改。比如在线性模型里$\tilde{y_i}=\boldsymbol{w}x_i+b$, 常数$b$就可以用一个常量来表示。既然常量是一种Tensor,那么它也就具有Tensor的所有数据特性,它包括:
11+
12+
* value: 符合TensorFlow中定义的数据类型的常数值或者常数列表;
13+
* dtype:数据类型;
14+
* shape:常量的形状;
15+
* name:常量的名字;
16+
17+
18+
19+
##### How to create a Constant
20+
21+
TensorFlow provides a handy function to create a Constant. In TF.NET, you can use the same function name `tf.constant` to create it. TF.NET takes the same name as python binding to the API. Naming, although this will make developers who are used to C# naming habits feel uncomfortable, but after careful consideration, I decided to give up the C# convention naming method.
22+
23+
TensorFlow提供了一个很方便的函数用来创建一个Constant, 在TF.NET,可以使用同样的函数名`tf.constant`来创建,TF.NET采取尽可能使用和python binding一样的命名方式来对API命名,虽然这样会让习惯C#命名习惯的开发者感到不舒服,但我经过深思熟虑之后还是决定放弃C#的约定命名方式。
24+
25+
Initialize a scalar constant:
26+
27+
```csharp
28+
var c1 = tf.constant(3); // int
29+
var c2 = tf.constant(1.0f); // float
30+
var c3 = tf.constant(2.0); // double
31+
var c4 = tf.constant("Big Tree"); // string
32+
```
33+
34+
Initialize a constant through ndarray:
35+
36+
```csharp
37+
// dtype=int, shape=(2, 3)
38+
var nd = np.array(new int[][]
39+
{
40+
new int[]{3, 1, 1},
41+
new int[]{2, 3, 1}
42+
});
43+
var tensor = tf.constant(nd);
44+
```
45+
46+
##### Dive in Constant
47+
48+
Now let's explore how constant works.
49+
50+
现在让我探究一下`tf.constant`是怎么工作的。

docs/source/Foreword.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
One of the most nerve-wracking periods when releasing the first version of an open source project occurs when the [gitter](https://gitter.im/sci-sharp/community) community is created. You are all alone, eagerly hoping and wishing for the first user to come along. I still vividly remember those days.
44

5-
最让人紧张的时刻是当我为自己的开源项目发布第一个版本并在gitter里开放一个聊天社区,而里面只有你一个人,饥渴地期待第一个进入聊天室的用户,我仍然清楚地记得那个时期。
5+
最让人紧张的时刻是当我为自己的开源项目发布第一个版本并在gitter里开放一个聊天社区,而里面只有你一个人,饥渴地等待第一个进入聊天室的用户,我仍然清楚地记得那个时期。
66

77

88

docs/source/FrontCover.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,6 @@
2323

2424
#### An Open Source Machine Learning Framework for Everyone
2525

26-
####
27-
2826

2927

3028

@@ -36,7 +34,7 @@
3634

3735

3836
<p style='float:right;'>
39-
<b>Haiping Chen & Christian Kahr</b><br/>
37+
<b>Haiping Chen</b><br/>
4038
<b>Christmas, 2018</b><br/>
4139
</p>
4240

@@ -46,3 +44,4 @@
4644

4745

4846

47+

docs/source/Graph.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# Chapter. Graph
2+

docs/source/Operation.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# Chapter. Operation
2+

docs/source/Placeholder.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# Chapter. Placeholder
2+

docs/source/Preface.md

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,33 +2,27 @@
22

33
# Preface
44

5+
Why do I start the TensorFlow.NET project?
56

7+
In a few days, it was Christmas in 2018. I watched my children grow up and be sensible every day, and I felt that time passed too fast. IT technology updates are faster than ever, and a variety of front-end technologies are emerging. Big data, Artificial Intelligence and Blockchain, Container technology and Microservices, Distributed Computing and Serverless technology are dazzling. The Amazon AI service interface claims that engineers who don't need any machine learning experience can use it, so that the idea of just calming down for two years and planning to switch to an AI architecture in the future is a splash of cold water.
68

9+
再过几天就是2018年圣诞节,看着孩子一天天长大并懂事,感慨时间过得太快。IT技术更新换代比以往任何时候都更快,各种前后端技术纷纷涌现。大数据,人工智能和区块链,容器技术和微服务,分布式计算和无服务器技术,让人眼花缭乱。Amazon AI服务接口宣称不需要具有任何机器学习经验的工程师就能使用,让像我这样刚静下心来学习了两年并打算将来转行做AI架构的想法泼了一桶凉水。
710

811

912

13+
TensorFlow is an open source project for machine learning especially for deep learning. It's used for both research and production at Google company. It's designed according to dataflow programming pattern across a range of tasks. TensorFlow is not just a deep learning library. As long as you can represent your calculation process as a data flow diagram, you can use TensorFlow for distributed computing. TensorFlow uses a computational graph to build a computing network while operating on the graph. Users can write their own upper-level models in Python based on TensorFlow, or extend the underlying C++ custom action code to TensorFlow.
1014

15+
TensorFlow是一个用于机器学习的开源项目,尤其适用于深度学习。 它最初是谷歌公司的用于内部研究和生产的工具,后来开源出来给社区使用。TensorFlow并不仅仅是一个深度学习库,只要可以把你的计算过程表示称一个数据流图的过程,就可以使用TensorFlow来进行分布式计算。TensorFlow用计算图的方式建立计算网络,同时对图进行操作。用户可以基于TensorFlow的基础上用python编写自己的上层模型,也可以扩展底层的C++自定义操作代码添加到TensorFlow中。
1116

1217

1318

14-
15-
16-
17-
Why do I start the TensorFlow.NET project?
18-
19-
我为什么会写TensorFlow.NET?
20-
21-
再过几天就是2018年圣诞节,看着孩子一天天长大并懂事,感慨时间过得太快。IT技术更新换代比以往任何时候都更快,各种前后端技术纷纷涌现。大数据,人工智能和区块链,容器技术和微服务,分布式计算和无服务器技术,让人眼花缭乱。Amazon AI服务接口宣称不需要具有任何机器学习经验的工程师就能使用,让像我这样刚静下心来学习了两年并打算将来转行做AI架构的想法泼了一桶凉水。
22-
23-
TensorFlow is an open source project for machine learning especially for deep learning. It's used for both research and production at Google company. It's designed according to dataflow programming pattern across a range of tasks.
24-
25-
19+
In order to avoid confusion, the unique classes defined in TensorFlow are not translated in this book. For example, Tensor, Graph, Shape will retain the English name.
2620

2721
为了避免混淆,本书中对TensorFlow中定义的特有类不进行翻译,比如Tensor, Graph, Shape这些词都会保留英文名称。
2822

2923

3024

31-
术语简称:
25+
Terminology:
3226

3327
TF: Google TensorFlow
3428

docs/source/Session.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# Chapter. Session
2+

docs/source/Variable.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# Chapter. Variable
2+

docs/source/index.rst

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -6,29 +6,18 @@
66
Welcome to TensorFlow.NET's documentation!
77
==========================================
88

9-
.. toctree::
10-
:maxdepth: 2
11-
:caption: Contents:
12-
13-
14-
15-
Indices and tables
16-
==================
17-
18-
* :ref:`Front Cover <front-cover>`
19-
20-
.. _front-cover:
219

2210
.. toctree::
2311
:maxdepth: 3
24-
:caption: Get Started with TensorFlow.NET:
12+
:caption: The Definitive Guide to TensorFlow.NET
2513

2614
FrontCover
2715
Foreword
2816
Preface
2917
HelloWorld
3018
Tensor
3119
Constant
20+
Placeholder
3221
Variable
3322
Operation
3423
Graph

0 commit comments

Comments
 (0)