Theano调用函数而不更新共享变量

时间:2016-11-18 19:29:04

标签: python neural-network theano

在Theano中,是否可以调用函数,以便在编译计算图之前不会自动更新您指定的共享变量?

例如,我有以下功能来训练RNN:

train = theano.function(
    inputs=[x, h0, t],
    outputs=[loss, p],
    updates=updates  # updates the parameters using GD
)

但是,当我只想从模型中采样(而不是训练它)时,我想调用相同的函数,但不会自动更新参数。

谢谢。

0 个答案:

没有答案