简体   繁体   中英

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. They are not even close sometimes. I just know the basic knowledge of LSTM and never code it before.

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)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM