Coder Social home page Coder Social logo

stock_predict_with_lstm's Issues

你好,输出图我看不太懂

你好,输出的图我不太明白
plt.plot(list(range(len(normalize_data), len(normalize_data) + len(predict))), predict, color='r')
红色线表示normalize_data之后的预测值,对吗?但是我的形状有些奇怪,没看懂··
wx20180123-173555
非常感谢!

请教关于训练和预测时的数据格式的问题

代码中的注释有写到,在非连续训练模式下,每time_step行数据会作为一个样本,两个样本错开一行,比如:1-20行,2-21行
比如有1000行的数据,n_past为10,特征是5个,那么构建出来的train_x shape为(991,10,5),train_y shape为(991,10,1),也就是对于每一个样本,使用过去10条数据来预测结果,并和真值相比较。

但是如果是用来预测,构建的test_X的shape是(100,10,5),test_Y的shape是(1000,1,5),在源码处也可以看到不是使用连续方式来构建的test_X。
所以构建出来的LSTM模型并不是输入过去n_past条数据,模型输出预测的这一条数据吗?

请问如何获取预测后的数据

非常感谢楼主,您的代码直接就能运行了,质量真棒!
想请教个问题:为什么stock_predict_1.py每次执行预测的结果都不一样呢?model_save1里的文件即使删除后重新运行也是不一样的结果。

现象:每次执行计算的next_seq值都不一样,所以预测的结果也不同
next_seq=sess.run(pred,feed_dict={X:[prev_seq]})
print ("------------->"+str(next_seq))

会不会有未来函数呢

self.mean = np.mean(self.data, axis=0) # 数据的均值和方差
self.std = np.std(self.data, axis=0)
self.norm_data = (self.data - self.mean)/self.std # 归一化,去量纲

您好,代码运行后有个问题想请教您

ValueError: Attempt to have a second RNNCell use the weights of a variable scope that already has weights: 'sec_lstm/rnn/basic_lstm_cell'; and the cell was not constructed as BasicLSTMCell(..., reuse=True). To share the weights of an RNNCell, simply reuse it in your second calculation, or create a new one with the argument reuse=True.

最近初学tensorflow,在博客上看到您的代码下载了运行后报了错,我在网上搜了很多方案都不行,非常困惑,恳请您能指点一下,谢谢

do_train_visualized = False

我把这个do_train_visualized = False改成True会报错:ConnectionRefusedError: [WinError 10061] 由于目标计算机积极拒绝,无法连接。该怎么解决。

dropout并没有使用

stock_predict_2.py 中,定义了drop = tf.nn.rnn_cell.DropoutWrapper(basicLstm, output_keep_prob=keep_prob) ,但是实际并没有使用它,这里产生作用了吗?

question about do_continue_train

Hello, thanks for you work.
In your case, while set do_continue_train is False, the train data must be a continuous series and can only be a series. So, my problem is, how should I train my data with serveral multi-series data?
Looking forward to your reply, thank you.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.