python - 如何在本地使用 sageMath 安装 Theano 库?

标签 python machine-learning theano sage

我想知道使用 SageMath 安装 Theano 库的步骤?

最佳答案

只需在终端中运行 pip 即可安装 theano。

$ sage -pip install theano

下次运行 Sage 时,theano 可用。

sage: from theano import *
sage: import theano.tensor as T
sage: from theano import function
sage: x = T.dscalar('x')
sage: y = T.dscalar('y')
sage: z = x + y
sage: f = function([x, y], z)
sage: f(2, 3)
array(5.0)
sage: numpy.allclose(f(16.3, 12.1), 28.4)
True
sage: type(x)
<class 'theano.tensor.var.TensorVariable'>

关于python - 如何在本地使用 sageMath 安装 Theano 库?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40741283/

相关文章:

python - 正则表达式,如何在 12/24 小时时间戳中删除冒号以外的所有非字母数字?

r - R Catboost处理分类变量

machine-learning - 如何将 ELMo 嵌入表示为一维数组?

callback - 如何监控 Theano/Keras 中的张量值?

python - 无法在 Django 1.11.13 上安装 Django-Channel

python - 如何在 python 中单击带有 Selenium 的复选框

python - 如何纠正 ASCII 数据中的格式错误或使用 python 正确读取数据?

python - One-Hot 编码的 Keras 自定义损失

python - keras v1.2.2 与 keras v2+ 的奇怪行为(准确度存在巨大差异)

keras - 从网络丢失中排除零填充区域 - Keras 2.0 Theno 后端(分段网络)