Skip to content

Commit

Permalink
添加了对类型的详细介绍
Browse files Browse the repository at this point in the history
  • Loading branch information
lijin-THU committed Oct 12, 2015
1 parent 377bf2b commit fc7d4fc
Showing 1 changed file with 33 additions and 3 deletions.
36 changes: 33 additions & 3 deletions 09. theano/09.02 theano basics.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -288,9 +288,39 @@
"source": [
"除了 `T.scalar()` 标量之外,`Theano` 中还有很多符号变量类型,这些都包含在 `tensor`(张量)子模块中,而且 `tensor` 中也有很多函数对它们进行操作。\n",
"\n",
"- `T.matrix()` 矩阵\n",
"- `T.scalar()` 标量\n",
"- `T.vector()` 向量"
"- `T.scalar(name=None, dtype=config.floatX)` \n",
" - 标量,shape - ()\n",
"- `T.vector(name=None, dtype=config.floatX)` \n",
" - 向量,shape - (?,)\n",
"- `T.matrix(name=None, dtype=config.floatX)` \n",
" - 矩阵,shape - (?,?)\n",
"- `T.row(name=None, dtype=config.floatX)` \n",
" - 行向量,shape - (1,?)\n",
"- `T.col(name=None, dtype=config.floatX)` \n",
" - 列向量,shape - (?,1)\n",
"- `T.tensor3(name=None, dtype=config.floatX)`\n",
" - 3 维张量,shape - (?,?,?)\n",
"- `T.tensor4(name=None, dtype=config.floatX)`\n",
" - 4 维张量,shape - (?,?,?,?)\n",
"\n",
"`shape` 中为 1 的维度支持 `broadcast` 机制。\n",
"\n",
"除了直接指定符号变量的类型(默认 `floatX`),还可以直接在每类前面加上一个字母来定义不同的类型:\n",
"\n",
"- `b` int8\n",
"- `w` int16\n",
"- `i` int32\n",
"- `d` float64\n",
"- `f` float32\n",
"- `c` complex64\n",
"- `z` complex128\n",
"\n",
"例如 `T.dvector()` 表示的就是一个 `float64` 型的向量。\n",
"\n",
"除此之外,还可以用它们的复数形式一次定义多个符号变量:\n",
"\n",
" x,y,z = T.vectors('x','y','z')\n",
" x,y,z = T.vectors(3)"
]
},
{
Expand Down

0 comments on commit fc7d4fc

Please sign in to comment.