简体   繁体   English

如何绘制theano.tensor值?

[英]How can I plot theano.tensor value?

To visualize TensorType(float64, matrix) as an image using imshow, How could I that?I cannot directly use imshow on Tensor since it gives me this error 为了使用imshow将TensorType(float64,matrix)可视化为图像,我该怎么办?我无法直接在Tensor上使用imshow,因为它给了我这个错误

mat is not a numpy array, neither a scalar

When I try to convert datatype to array using numpy.asarray I get 当我尝试使用numpy.asarray将数据类型转换为数组时,我得到了

 mat data type = 17 is not supported

Is there any way to convert to uint8 datatype? 有什么方法可以转换为uint8数据类型吗?

Theano tensors are symbolic variables, with no value attached to them. Theano张量是符号变量,没有任何附加值。 If you want to plot something it is probably a shared variable (the weights of your network), in which case you can grab the values with my_shared.get_value() , or the output of the network when you pass an input, in which case I believe it should already be a numpy array. 如果要绘制某些内容,则它可能是一个共享变量(网络的权重),在这种情况下,您可以使用my_shared.get_value()来获取值,或者在传递输入时获取网络的输出,在这种情况下我相信它应该已经是一个numpy数组。

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

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