问题标签 [theano]
For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.
python - 在 pymc 3 中提供测试值
我正在探索在 pymc 中使用有界分布。我试图在两个值之间绑定 Gamma 先验分布。由于缺少测试值,模型规范似乎失败了。我怎样才能传递一个 testval 参数,以便我能够指定这些类型的模型?
为了完整起见,我已经包含了错误,以及下面的一个最小示例。谢谢!
AttributeError: <pymc.quickclass.Gamma object at 0x110a62890> has no default value to use, checked for: ['median', 'mean', 'mode'] pass testval argument or provide one of these.
编辑:出于参考目的,这是一个利用有界伽马先验分布的简单工作模型:
theano - 我可以避免使用“Theano.scan”吗?
我有 3 维张量("tensor3"
——一个矩阵数组),我想计算theano.sandbox.linalg.det
每个矩阵的行列式( )。有没有办法在不使用的情况下计算每个行列式theano.scan
?当我尝试直接调用det
张量时,我得到了错误
但是我读到这scan
很慢并且不能很好地并行化,并且如果可能的话,应该只使用张量操作。是这样吗?在这种情况下我可以避免使用扫描吗?
python - Theano 元素明智的最大值
我试图
s=max(ele, 0)
在 theano 中的矩阵上找到元素的值。我对theano没有太多经验。
到目前为止我有
这可行,但并不漂亮,我认为我应该能够使用theano.tensor.maximum
它。
在matlab中,做我想做的事,我会写
linmax=@(x) max (x, zeros (size (x)))
python - Op和Function有什么区别
Theano 具有 Ops 和函数。
有什么不同?
函数看起来不错且易于定义,例如:
Ops 的定义似乎很复杂。所有抽象类之类的东西theano.tesnor.tanh
都theano.tensor.nnet.sigmoid
被定义为 Ops。我不确定区别。
我将如何将上述linmax
函数编写为操作?
python - 有人可以帮助解释 Theano 教程示例中的一行代码吗?
在 Theano 教程中提供的逻辑回归示例中,函数中有一行代码negative_log_likelihood
如下:
有人可以帮助解释上述代码最后一行中方括号的确切用途吗?会怎么[T.arange(y.shape[0]), y]
解读?
谢谢!
generics - 测试集样本的 Theano 打印概率
在 DL 教程中,我试图根据 将“输入”传递给 Theano 中的函数的目的/意义是什么来打印测试样本的概率? 但我收到以下错误。我需要添加一些 theano_flags 吗?
如何解决问题?
TypeError: 无法将 Type Generic (of Variable ) 转换为 Type TensorType(float64, matrix)。您可以尝试手动转换为 TensorType(float64, matrix)。
(我的数据的特征数=120,classes=2,test_set batch size=1)
部分代码是:
从theano导入pp
python - 用 Theano 寻找最近的点
在一组权重向量中,我如何以优化 theano 方式找到最接近给定实例向量的值。还是我需要使用numpy?
python - 返回 Theano 向量中值的索引
Theano 中返回 Vector 中特定值的索引的过程是什么?在 NumPy 中,这将是numpy.where(my_array==x)
. TheanoTensor.where
是一个 switch 语句。
c++ - Reusing compiled Theano functions
Suppose I have implemented the following function in Theano:
When I try to run it a graph of computations is constructed, the function gets optimized and compiled.
How can I reuse this compiled chunk of code from within a Python script and/or a C++ application?
EDIT: The goal is to construct a deep learning network and reuse it in a final C++ app.
python - Theano 与已有的 python 代码集成
我有一个简单的问题,我希望已经在网上找到了一个简单的答案,但我没有。
由于矩阵运算,我有一个 python 项目可以与 numpy 一起使用。我想加快代码速度,所以我做了一些分析以找出适合这项工作的工具。原来开销不是python,而是矩阵运算。因此我认为我应该使用 Theano(特别是考虑到我正在实现机器学习算法的情况,这就是为之而生的)。
我项目的大部分开销都在一个函数中,我想知道是否有可能只用 theano 重写该函数,然后从中取出 numpy 数组并像往常一样继续计算。
这再次只是为了测试在不承诺更改大量代码的情况下我将获得多少速度。
谢谢!
编辑:万一是这个功能