WIP: X-Team TensorFlow.js Stock Prediction Example.
Presently only the Logic
example is 100% - it includes all basic logic operations implemented in client-side TensorFlow.js RNN.
Logic training with 100
epochs:
Logic training with 1200
epochs:
Setup and installation instructions:
In order to improve performance and better leverage parallel, asynchronous, processes this example was rearchitected with most of the work put into the server.
We now make heavy use of the great npm libraries:
And as a result of that, this example requires using Linux in order to achieve full functionality!
For NVM on Linux:
#!/usr/bin/env bash
echo "Updating OS"
sudo apt-get update
echo "Installing NVM"
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.4/install.sh | bash
echo "Installing Linux Dependencies"
sudo apt-get install build-essentials
For NVM on Windows Linux Subsystem:
(This approach is recommended for running the app only!)
- See this great article for more!
- Access your Linux workspace directly in your usual Windows text-editor.
E.g. - Access this repo in Windows directory: C:\Users\MY_WINDOWS_USER\AppData\Local\Packages\CanonicalGroupLimited.UbuntuonWindows_7...c\LocalState\rootfs\home\u\x_team_tensorflow_js
- If you run into an Error: EACCESS: permission denied issue during installation try:
$ sudo chown -R u:p node_modules
$ sudo chown -R u:p u/.nvm
Setup instructions:
$ npm install
$ npm run start
Views:
http://localhost:5555/logic
http://localhost:5555/cnn
http://localhost:5555/rnn
MIT Licensed!
To my knowledge this is perhaps one of the first 100% JavaScript Stock Prediction examples (either using a Recurrent Neural Net or a Convolutional Neural Net) and probably the first for TensorFlow.js:
- John Murphy's outstanding pure-node implementation.
- karthikbadam's Encog-based TimeFork.
Other great resources:
- TensorFlow's Official CNN Article!
- Firdaouss Doukkali's great introductory article!
- A great full-stack example leveraging Python, PHP, and JavaScript.
- Special thanks to Zaid Alyafeai for several crystal-clear code samples!