Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
aba531c0
提交
aba531c0
authored
5月 27, 2013
作者:
Frederic
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fix doc indentation. They are part of their section, not at the global scope.
上级
cb6e3a07
显示空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
18 行增加
和
16 行删除
+18
-16
nnet.txt
doc/library/tensor/nnet/nnet.txt
+18
-16
没有找到文件。
doc/library/tensor/nnet/nnet.txt
浏览文件 @
aba531c0
...
@@ -79,9 +79,9 @@
...
@@ -79,9 +79,9 @@
:Return type: same as x
:Return type: same as x
:Returns: elementwise softplus: :math:`softplus(x) = \log_e{\left(1 + \exp(x)\right)}`.
:Returns: elementwise softplus: :math:`softplus(x) = \log_e{\left(1 + \exp(x)\right)}`.
.. note:: The underlying code will return an exact 0 if an element of x is too small.
.. note:: The underlying code will return an exact 0 if an element of x is too small.
.. code-block:: python
.. code-block:: python
x,y,b = T.dvectors('x','y','b')
x,y,b = T.dvectors('x','y','b')
W = T.dmatrix('W')
W = T.dmatrix('W')
...
@@ -94,9 +94,9 @@
...
@@ -94,9 +94,9 @@
:Return type: same as x
:Return type: same as x
:Returns: a symbolic 2D tensor whose ijth element is :math:`softmax_{ij}(x) = \frac{\exp{x_{ij}}}{\sum_k\exp(x_{ik})}`.
:Returns: a symbolic 2D tensor whose ijth element is :math:`softmax_{ij}(x) = \frac{\exp{x_{ij}}}{\sum_k\exp(x_{ik})}`.
The softmax function will, when applied to a matrix, compute the softmax values row-wise.
The softmax function will, when applied to a matrix, compute the softmax values row-wise.
.. code-block:: python
.. code-block:: python
x,y,b = T.dvectors('x','y','b')
x,y,b = T.dvectors('x','y','b')
W = T.dmatrix('W')
W = T.dmatrix('W')
...
@@ -113,12 +113,12 @@ The softmax function will, when applied to a matrix, compute the softmax values
...
@@ -113,12 +113,12 @@ The softmax function will, when applied to a matrix, compute the softmax values
:Return type: same as target
:Return type: same as target
:Returns: a symbolic tensor, where the following is applied elementwise :math:`crossentropy(t,o) = -(t\cdot log(o) + (1 - t) \cdot log(1 - o))`.
:Returns: a symbolic tensor, where the following is applied elementwise :math:`crossentropy(t,o) = -(t\cdot log(o) + (1 - t) \cdot log(1 - o))`.
The following block implements a simple auto-associator with a sigmoid
The following block implements a simple auto-associator with a
nonlinearity and a reconstruction error which corresponds to the binary
sigmoid nonlinearity and a reconstruction error which corresponds
cross-entropy (note that this assumes that x will contain values between 0 and
to the binary cross-entropy (note that this assumes that x will
1):
contain values between 0 and
1):
.. code-block:: python
.. code-block:: python
x, y, b = T.dvectors('x', 'y', 'b')
x, y, b = T.dvectors('x', 'y', 'b')
W = T.dmatrix('W')
W = T.dmatrix('W')
...
@@ -145,14 +145,16 @@ cross-entropy (note that this assumes that x will contain values between 0 and
...
@@ -145,14 +145,16 @@ cross-entropy (note that this assumes that x will contain values between 0 and
:Return type: tensor of rank one-less-than `coding_dist`
:Return type: tensor of rank one-less-than `coding_dist`
.. note:: An application of the scenario where *true_dist* has a 1-of-N representation
.. note:: An application of the scenario where *true_dist* has a
is in classification with softmax outputs. If `coding_dist` is the output of
1-of-N representation is in classification with softmax
the softmax and `true_dist` is a vector of correct labels, then the function
outputs. If `coding_dist` is the output of the softmax and
will compute ``y_i = - \log(coding_dist[i, one_of_n[i]])``, which corresponds
`true_dist` is a vector of correct labels, then the function
to computing the neg-log-probability of the correct class (which is typically
will compute ``y_i = - \log(coding_dist[i, one_of_n[i]])``,
the training criterion in classification settings).
which corresponds to computing the neg-log-probability of the
correct class (which is typically the training criterion in
classification settings).
.. code-block:: python
.. code-block:: python
y = T.nnet.softmax(T.dot(W, x) + b)
y = T.nnet.softmax(T.dot(W, x) + b)
cost = T.nnet.categorical_crossentropy(y, o)
cost = T.nnet.categorical_crossentropy(y, o)
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论