tensorflow - 如何在 Keras 中将多个数据集与一个模型一起使用?

标签 tensorflow neural-network keras artificial-intelligence forecasting

我正在使用 LSTM 网络尝试使用 Keras 和 Tensorflow 进行外汇预测。 我当然希望它在许多天的交易中进行训练,但要做到这一点,我必须给它连续的数据,其中有大的跳跃和没有移动的阶段......当市场关闭时......这并不理想由于这些跳跃和没有运动的阶段而“困惑”。或者我使用一天一分钟的数据,但这样我的训练数据时间非常有限,模型也不会很好。

您有解决此问题的想法吗? 这是我当前的代码:

CODE

谢谢

最佳答案

如果您计划按顺序将多个数据集拟合为数据切片,则类似这样的方法可行:

for _ in range(10):
#somehow cut the data into slices and fit them one by one
    model.fit(data_slice, label_slice ......)

因为对 fit 的连续调用将逐步训练单个模型。

关于tensorflow - 如何在 Keras 中将多个数据集与一个模型一起使用?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50913520/

相关文章:

python - 使用 tf.data 实现 tensorflow 输入管道时出错

python - 在 tfp 中训练变分贝叶斯神经网络时,如何分别可视化损失中不同项的演化?

python - 如何使用 Keras 可视化神经网络架构?

image-processing - 什么是inception和vgg16的输出维度

tensorflow - Keras 前 5 名预测

python - Anaconda 安装的 cudatoolkit 和 cudnn 会影响我当前的配置吗?

python - 对象检测训练的 Cloud ML Engine 警告消息 : Ignoring ground truth with image id

python - 神经网络不产生结果

python - `pip list` 和 anaconda 包列表中的 Keras 但无法导入

python - 在单独的线程中从 Tensorflow 模型返回层激活和权重