简体   繁体   English

Theano-计算theano矩阵列表的元素明智和

[英]Theano - Compute element wise sum of list of theano matrix

I have a list of theano matrices(using in a neural network implementation). 我有一个theano矩阵列表(在神经网络实现中使用)。 I need to perform element wise sum on the corresponding elements. 我需要对相应的元素执行按元素求和。

Eg Input : x1 = [<TensorType(float64, matrix)>, <TensorType(float64, matrix)> , <TensorType(float64, matrix)>] 例如输入: x1 = [<TensorType(float64, matrix)>, <TensorType(float64, matrix)> , <TensorType(float64, matrix)>]

Output : <TensorType(float64, matrix)> -> which is the element wise sum of the 3 matrices.

Looked at a few posts but unable to figure out how to proceed. 看了几篇文章,但无法弄清楚如何进行。 Please advice. 请指教。 Thanks in advance. 提前致谢。

您可以在theano中使用扫描功能,并且必须确保列表中的每个矩阵都具有相同的形状。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM