[英]Why LSTM give different output despite I use the same code?
I ran code from this link (for predict price of sp500) and I found that output (predicted price) are not the same when I ran the code for second and third time. 我从此链接运行了代码(用于sp500的预测价格),当我第二次和第三次运行代码时,发现输出(预测价格)不相同。 They are not even close sometimes. 他们有时甚至不靠近。 I just know the basic knowledge of LSTM and never code it before. 我只知道LSTM的基本知识,而以前从未编写过代码。
It is better to seed the inbuilt pseudo-random number generator. 最好植入内置的伪随机数生成器。 Kindly try using the following: 请尝试使用以下方法:
import random
import numpy as np
from tensorflow import set_random_seed
random.seed(10)
np.random.seed(10)
set_random_seed(10)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.