我想知道使用 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/