【发布时间】:2023-03-20 21:28:01
【问题描述】:
我想存储中间结果以避免对一件事进行多次计算。我正在寻找的是这样的:
h1_activ = sigmoid(self.bias_visiblie + T.dot(D, self.W))
h1_sample = h1_activ > rnds.uniform((n_samples, self.n_hidden ))
f_h1_sample = theano.function(
inputs=[D],
outputs=h1_sample,
# I'd like to take the result from 'h1_sample' and store it into 'H1_sample'
updates=[(self.H1_sample, ??? )]
)
上面的代码当然不会运行,但是有没有办法做这样的事情?将中间值存储到共享变量中?
【问题讨论】: