Multidimensional LSTM BitCoin Time Series
Using multidimensional LSTM neural networks to create a forecast for Bitcoin price.
For notes around this code and a general explenation for the theory please see my original article HERE
Using multidimensional LSTM neural networks to create a forecast for Bitcoin price.
For notes around this code and a general explenation for the theory please see my original article HERE
Fresh clone, data/bitcoin.csv unzipped, Keras(2.0.6) TensorFlow(1.2.1) Python(3.6.2) (full pip freeze).
[Edit] Also tried on Python 2.7, same error. (full pip freeze)
Full error:
(btc3) lefnire@lefnire-ubuntu:~/Sites/btc/github/Multidimensional-LSTM-BitCoin-Time-Series$ python run.py
Using TensorFlow backend.
> Creating x & y data files...
> Clean datasets created in file `data/clean_data.h5.h5`
> Generating clean data from: data/clean_data.h5 with batch_size: 100
> Clean data has 180610 data rows. Training on 144488 rows with 722 steps-per-epoch
> Compilation Time : 0.010142087936401367
> Testing model on 36122 data rows with 361 steps
2017-08-09 17:15:15.447882: W tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use SSE4.1 instructions, but these are available on your machine and could speed up CPU computations.
2017-08-09 17:15:15.447905: W tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use SSE4.2 instructions, but these are available on your machine and could speed up CPU computations.
2017-08-09 17:15:15.447909: W tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use AVX instructions, but these are available on your machine and could speed up CPU computations.
2017-08-09 17:15:15.447913: W tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use AVX2 instructions, but these are available on your machine and could speed up CPU computations.
2017-08-09 17:15:15.447917: W tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use FMA instructions, but these are available on your machine and could speed up CPU computations.
2017-08-09 17:15:15.563391: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:893] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero
2017-08-09 17:15:15.563705: I tensorflow/core/common_runtime/gpu/gpu_device.cc:940] Found device 0 with properties:
name: GeForce GTX 1080 Ti
major: 6 minor: 1 memoryClockRate (GHz) 1.582
pciBusID 0000:01:00.0
Total memory: 10.90GiB
Free memory: 10.02GiB
2017-08-09 17:15:15.563716: I tensorflow/core/common_runtime/gpu/gpu_device.cc:961] DMA: 0
2017-08-09 17:15:15.563719: I tensorflow/core/common_runtime/gpu/gpu_device.cc:971] 0: Y
2017-08-09 17:15:15.563724: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1030] Creating TensorFlow device (/gpu:0) -> (device: 0, name: GeForce GTX 1080 Ti, pci bus id: 0000:01:00.0)
> Compilation Time : 0.009964227676391602
Epoch 1/2
Exception in thread Thread-1:
Traceback (most recent call last):
File "/home/lefnire/anaconda3/envs/btc3/lib/python3.6/site-packages/tensorflow/python/client/session.py", line 942, in _run
allow_operation=False)
File "/home/lefnire/anaconda3/envs/btc3/lib/python3.6/site-packages/tensorflow/python/framework/ops.py", line 2584, in as_graph_element
return self._as_graph_element_locked(obj, allow_tensor, allow_operation)
File "/home/lefnire/anaconda3/envs/btc3/lib/python3.6/site-packages/tensorflow/python/framework/ops.py", line 2663, in _as_graph_element_locked
raise ValueError("Tensor %s is not an element of this graph." % obj)
ValueError: Tensor Tensor("lstm_1_input:0", shape=(?, ?, 4), dtype=float32) is not an element of this graph.
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/lefnire/anaconda3/envs/btc3/lib/python3.6/threading.py", line 916, in _bootstrap_inner
self.run()
File "/home/lefnire/anaconda3/envs/btc3/lib/python3.6/threading.py", line 864, in run
self._target(*self._args, **self._kwargs)
File "run.py", line 64, in fit_model_threaded
epochs=configs['model']['epochs']
File "/home/lefnire/anaconda3/envs/btc3/lib/python3.6/site-packages/keras/legacy/interfaces.py", line 87, in wrapper
return func(*args, **kwargs)
File "/home/lefnire/anaconda3/envs/btc3/lib/python3.6/site-packages/keras/models.py", line 1117, in fit_generator
initial_epoch=initial_epoch)
File "/home/lefnire/anaconda3/envs/btc3/lib/python3.6/site-packages/keras/legacy/interfaces.py", line 87, in wrapper
return func(*args, **kwargs)
File "/home/lefnire/anaconda3/envs/btc3/lib/python3.6/site-packages/keras/engine/training.py", line 1840, in fit_generator
class_weight=class_weight)
File "/home/lefnire/anaconda3/envs/btc3/lib/python3.6/site-packages/keras/engine/training.py", line 1565, in train_on_batch
outputs = self.train_function(ins)
File "/home/lefnire/anaconda3/envs/btc3/lib/python3.6/site-packages/keras/backend/tensorflow_backend.py", line 2268, in __call__
**self.session_kwargs)
File "/home/lefnire/anaconda3/envs/btc3/lib/python3.6/site-packages/tensorflow/python/client/session.py", line 789, in run
run_metadata_ptr)
File "/home/lefnire/anaconda3/envs/btc3/lib/python3.6/site-packages/tensorflow/python/client/session.py", line 945, in _run
+ e.args[0])
TypeError: Cannot interpret feed_dict key as Tensor: Tensor Tensor("lstm_1_input:0", shape=(?, ?, 4), dtype=float32) is not an element of this graph.
I realize you're likely not keen on supporting a blog-post's code-demo, but just in case someone has top-of-the-dome.
As you can see I scaled back everything to the original. You can also notice the SP500 trend is usually upward rather the scaled graph predicted many down trends.
Hi,
When I try to train the LSTM I get the following error:
TypeError: Cannot interpret feed_dict key as Tensor: Tensor Tensor("lstm_1_input:0", shape=(?, ?, 4), dtype=float32) is not an element of this graph.
Any suggestions? Thanks!
Dears,
I am confused about the standardise method in the code -
def zero_base_standardise(self, data, abs_base=pd.DataFrame()):
"""Standardise dataframe to be zero based percentage returns from i=0"""
if(abs_base.empty): abs_base = data.iloc[0]
data_standardised = (data/abs_base)-1
return (abs_base, data_standardised)
My understanding about the standarise is -
(x - mean) / standard_deviation
mean = sum(x) / count(x)
standard_deviation = sqrt( sum( (x - mean)^2 ) / count(x))
I think (data/abs_base)-1
should be far from standardised values, could you please kindly let me know if I misunderstood anything?
Thank you very much!
I coppied and pasted code from multidementional forcasting into a spreadsheet for the bitcoin multi dimentional forcasting software to run on 300 lines.
I am not shure why the data line plotted only and the predicted line was behind it or invisible or not plotted.
I pasted it for all the columns the 2 columns of data.
here is where I got my data set from https://www.itl.nist.gov/div898/handbook/pmc/section4/pmc451.htm
Stock Price Prediction Using Deep Learning Univariate Time Series Predicting stock price using historical data of a company using Neural networks for
Price-Prediction-For-a-Dream-Home ROADMAP TO THIS LINEAR REGRESSION BASED HOUSE PRICE PREDICTION PREDICTION MODEL Import all the dependencies of the p
ttopt Description Gradient-free global optimization algorithm for multidimensional functions based on the low rank tensor train (TT) format and maximu
Package Description The difficulties in acquiring spectroscopic data have been a major challenge for supernova surveys. snlstm is developed to provide
Neural Fractal Create Fractals Using Complex-Valued Neural Networks! Home Page Features Define Dynamical Systems Using Complex-Valued Neural Networks
About This repository contains the code of a PaddlePaddle implementation of STGCN based on the paper Spatio-Temporal Graph Convolutional Networks: A D
Stock Price Prediction of Apple Inc. Using Recurrent Neural Network OHLC Average Prediction of Apple Inc. Using LSTM Recurrent Neural Network Dataset:
RNN-Playwrite a reccurrent neural netowrk that when trained on a peice of text and fed a starting prompt will write its on 250 character text using LS
Quasi-Recurrent Neural Network (QRNN) for PyTorch Updated to support multi-GPU environments via DataParallel - see the the multigpu_dataparallel.py ex
Recurrent Bitcoin Network A Data Science Thesis Project About This repository contains the source code for implementing Bitcoin price prediciton using
Complex-Valued Neural Networks (CVNN) Done by @NEGU93 - J. Agustin Barrachina Using this library, the only difference with a Tensorflow code is that y
neural_network_for_stock_price_prediction Neural networks for stock price predic
本教程将通过一个示例对LSTM进行介绍。通过搭建训练LSTM网络,我们将训练一个模型来生成唐诗。本文将对该实现进行详尽的解释,并阐明此模型的工作方式和原因。并不需要过多专业知识,但是可能需要新手花一些时间来理解的模型训练的实际情况。为了节省时间,请尽量选择GPU进行训练。
A tour through tensorflow with financial data I present several models ranging in complexity from simple regression to LSTM and policy networks. The s
Forecasting directional movements of stock-prices for intraday trading using LSTM and random-forest https://arxiv.org/abs/2004.10178 Pushpendu Ghosh,
Hand Gesture Recognition Deep learning based hand gesture recognition using LSTM and MediaPipie. Demo video using PingPong Robot Files Pretrained mode
RealTime Sign Language Detection using Action Recognition Approach Real-Time Sign Language is commonly predicted using models whose architecture consi
Using LSTM to detect spoofing attacks in an Air-Ground network Specifications IDE: Spider Packages: Tensorflow 2.1.0 Keras NumPy Scikit-learn Matplotl
Image Captioning using CNN ,LSTM and Attention This is a deeplearning model which tries to summarize an image into a text . Installation Install this