deep-learning-bitcoin

授权协议 Apache-2.0 License
开发语言 Python
所属分类 神经网络/人工智能、 机器学习/深度学习
软件类型 开源软件
地区 不详
投 递 者 越安翔
操作系统 跨平台
开源组织
适用人群 未知
 软件概览

When Bitcoin meets Artificial Intelligence

Exploiting Bitcoin prices patterns with Deep Learning. Like OpenAI, we train our models on raw pixel data. Exactly how an experienced human would see the curves and takes an action.

So far, we achieved:

  • Download Bitcoin tick data
  • Convert to 5-minute data
  • Convert to Open High Low Close representation
  • Train a simple AlexNet on 20,000 samples: accuracy is 70% for predicting if asset will go UP or DOWN. Training is done on NVIDIA DIGITS and with the Caffe framework.
  • Quantify how much the price will go UP or DOWN. Because the price can go UP by epsilon percent 99% of the time, and pulls back by 50%
  • Train on 1,000,000+ samples (at least)
  • Apply more complex Conv Nets (at least Google LeNet)
  • Integrate bar volumes on the generated OHLC (Open, High, Low, Close) image
  • Use CNN attention to know what's important for which image. Maybe only a fraction of the image matters for the prediction

Results on 20,000 samples (small dataset)


Training on 5 minute price data (Coinbase USD)



Some examples of the training set


Illustration of the dataset from CoinbaseUSD

                     price_open  price_high  price_low  price_close      volume  close_price_returns close_price_returns_bins  close_price_returns_labels
DateTime_UTC                                                                                                                                             
2017-05-29 11:55:00     2158.86     2160.06    2155.78      2156.00   21.034283             0.000000          (-0.334, 0.015]                           5
2017-05-29 12:00:00     2155.98     2170.88    2155.79      2158.53   47.772555             0.117347           (0.015, 0.364]                           6
2017-05-29 12:05:00     2158.49     2158.79    2141.12      2141.92  122.332090            -0.769505        (-1.0322, -0.683]                           3
2017-05-29 12:10:00     2141.87     2165.90    2141.86      2162.44   87.253402             0.958019          (0.713, 1.0623]                           8
  • Scroll right to see all the columns!
  • Volumes are displayed in BTC.
  • Returns are in percentage and are computed on the close prices.

How to get started?

git clone https://github.com/philipperemy/deep-learning-bitcoin.git
cd deep-learning-bitcoin
./data_download.sh # will download it to /tmp/
python3 data_generator.py /tmp/btc-trading-patterns/ /tmp/coinbaseUSD.csv 1 # 1 means we want to use quantiles on returns. 0 would mean we are interested if the bitcoin goes UP or DOWN only.

If you are interested into building a huge dataset (coinbase.csv contains around 18M rows), it's preferrable to run the program in background mode:

nohup python3 -u data_generator.py /tmp/btc-trading-patterns/ /tmp/coinbaseUSD.csv 1 > /tmp/btc.out 2>&1 &
tail -f /tmp/btc.out

If you ever see this error:

_tkinter.TclError: no display name and no $DISPLAY environment variable

Please refer to this solution: https://stackoverflow.com/questions/37604289/tkinter-tclerror-no-display-name-and-no-display-environment-variable

Run with Docker

To build the docker image just execute

docker build -t dlb .

from the repository folder and then run the container

docker run -it --name dlb -v $PWD:/app dlb /bin/bash

the current folder will be mounted into /app. To verify the correct mountexecute inside the container

root@c11ef702a6d6:/app# mount| grep app
/dev/sda2 on /app type ext4 (rw,relatime,errors=remount-ro,data=ordered)
 相关资料
  • 人工神经网络(ANN)是一种高效的计算系统,其中心主题借鉴了生物神经网络的类比。 神经网络是机器学习的一种模型。 在20世纪80年代中期和90年代初期,在神经网络中进行了许多重要的建筑改进。 在本章中,您将了解有关深度学习的更多信息,这是一种人工智能的方法。 深度学习源自十年来爆炸性的计算增长,成为该领域的一个重要竞争者。 因此,深度学习是一种特殊的机器学习,其算法受到人脑结构和功能的启发。 机器

  • 深度学习 我们可以在Personal Computer上完成庞大的任务 深度学习是一种适应于各类问题的万能药 神经网络 神经网络出现于80年代,但当时计算机运行慢,数据集很小,神经网络不适用 现在神经网络回来了,因为能够进行GPU计算,可用使用的数据集也变大 分类 分类的一些讨论可以在这个项目里看到 Machine Learning不仅是Classification!但分类是机器学习的核心。 学会

  • Awesome Deep Learning Table of Contents Books Courses Videos and Lectures Papers Tutorials Researchers Websites Datasets Conferences Frameworks Tools Miscellaneous Contributing Books Deep Learning by

  • Deep Learning Specialization Projects from the Deep Learning Specialization from deeplearning.ai offered by Coursera. Instructor: Andrew Ng Master Deep Learning and Break Into AI If you want to break

  • 這裡紀錄了我在學習深度學習時蒐集的一些線上資源。內容由淺入深,而且會不斷更新,希望能幫助你順利地開始學習:) 本文章節 遊玩空間 線上課程 實用工具 其他教材 優質文章 經典論文 其他整理 遊玩空間 這節列舉了一些透過瀏覽器就能馬上開始遊玩 / 體驗深度學習的應用。作為這些應用的使用者,你可以先高層次、直觀地了解深度學習能做些什麼。之後有興趣再進一步了解背後原理。 這小節最適合: 想要快速體會深度

  • Deep Learning (with PyTorch) This notebook repository now has a companion website, where all the course material can be found in video and textual format. ����   ����   ����   ����   ����   ����   ���