def set_inpt(self, inpt, mini_batch_size, timestep_n):
#Reshape 3d to 2d so we can softmax correctly
self.inpt = inpt.reshape((mini_batch_size*timestep_n, self.n_in))
#The wx+b changes our 2d input to be the correct output shape
self.inpt = softmax(T.dot(self.inpt, self.w) + self.b)
#Finally, now that we have the correct output shape, we
#Convert back to 3d, making sure to use self.n_out, since this is the output
#And it's already correctly shaped, just in 2d.
self.output = self.inpt.reshape((mini_batch_size, timestep_n, self.n_out))
layers3D.py 文件源码
python
阅读 19
收藏 0
点赞 0
评论 0
评论列表
文章目录