Theano-功能

Theano-功能 (Theano - Functions)

Theano function acts like a hook for interacting with the symbolic graph. A symbolic graph is compiled into a highly efficient execution code. It achieves this by restructuring mathematical equations to make them faster. It compiles some parts of the expression into C language code. It moves some tensors to the GPU, and so on.

Theano 函数的作用就像是一个与符号图进行交互的钩子。 将符号图编译为高效的执行代码。 它通过重构数学方程以使其更快来实现这一点。 它将表达式的某些部分编译为C语言代码。 它将一些张量移动到GPU,等等。

The efficient compiled code is now given as an input to the Theano function. When you execute the Theano function, it assigns the result of computation to the variables specified by us. The type of optimization may be specified as FAST_COMPILE or FAST_RUN. This is specified in the environment variable THEANO_FLAGS.

现在,将有效的编译代码作为Theano 函数的输入。 当执行Theano 函数时 ,它将计算结果分配给我们指定的变量。 优化类型可以指定为FAST_COMPILE或FAST_RUN。 这是在环境变量THEANO_FLAGS中指定的。

A Theano function is declared using the following syntax −

Theano 函数使用以下语法声明-


f = theano.function ([x], y)

The first parameter [x] is the list of input variables and the second parameter y is the list of output variables.

第一个参数[x]是输入变量的列表,第二个参数y是输出变量的列表。

Having now understood the basics of Theano, let us begin Theano coding with a trivial example.

现在已经了解了Theano的基础知识,让我们从一个简单的例子开始Theano编码。

翻译自: https://www.tutorialspoint.com/theano/theano_functions.htm

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值