theano
nlpming
自然语言处理爱好者
展开
-
theano set_subtensor
emb_shifted = tensor.zeros_like(emb) #生成和 emb 形状相同的零矩阵emb_shifted = tensor.set_subtensor(emb_shifted[1:], emb[:-1]) #set_subtensor 用于给tensor赋值emb = emb_shifted #第一层全部变为 0原创 2017-08-25 13:44:08 · 1398 阅读 · 0 评论 -
theano,numpy tile函数
numpy中的函数tile相当于复制>>> import numpy as np>>> x=np.tile([[1,0],[0,1]],(4,4))>>> xarray([[1, 0, 1, 0, 1, 0, 1, 0], [0, 1, 0, 1, 0, 1, 0, 1], [1, 0, 1, 0, 1, 0, 1, 0], [0原创 2017-08-24 12:04:38 · 322 阅读 · 0 评论 -
theano switch函数
IfElse vs SwitchBoth ops build a condition over symbolic variables.IfElse takes a boolean condition and two variables as inputs.Switch takes a tensor as condition and two variables as inputs.转载 2017-08-24 11:18:40 · 1052 阅读 · 0 评论 -
theano DisconnectedInputError
参考此网址的内容:http://deeplearning.net/software/theano/library/gradient.html原创 2017-09-15 00:31:31 · 568 阅读 · 0 评论