Code for Keras plays catch blog post
python qlearn.py- Generate figures
Code for Keras plays catch blog post
python qlearn.py| <?php | |
| protected $middlewareGroups = [ | |
| 'web' => [ | |
| \App\Http\Middleware\EncryptCookies::class, | |
| \Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse::class, | |
| \Illuminate\Session\Middleware\StartSession::class, | |
| \App\Http\Middleware\LanguageMiddleware::class, | |
| \Illuminate\View\Middleware\ShareErrorsFromSession::class, | |
| \App\Http\Middleware\VerifyCsrfToken::class, |
| # Code for Jupyter/IPython Notebook environment | |
| from keras.models import Sequential | |
| from keras.layers.core import TimeDistributedDense, Activation, Dropout | |
| from keras.layers.recurrent import GRU | |
| import numpy as np | |
| from keras.utils.layer_utils import print_layer_shapes | |
| %matplotlib inline | |
| import matplotlib.pyplot as plt |
| # Time Series Testing | |
| import keras.callbacks | |
| from keras.models import Sequential | |
| from keras.layers.core import Dense, Activation, Dense, Dropout | |
| from keras.layers.recurrent import LSTM | |
| # Call back to capture losses | |
| class LossHistory(keras.callbacks.Callback): | |
| def on_train_begin(self, logs={}): | |
| self.losses = [] |
| """ From: http://danielhnyk.cz/predicting-sequences-vectors-keras-using-rnn-lstm/ """ | |
| from keras.models import Sequential | |
| from keras.layers.core import TimeDistributedDense, Activation, Dropout | |
| from keras.layers.recurrent import GRU | |
| import numpy as np | |
| def _load_data(data, steps = 40): | |
| docX, docY = [], [] | |
| for i in range(0, data.shape[0]/steps-1): | |
| docX.append(data[i*steps:(i+1)*steps,:]) |
| git config --global alias.undo-commit 'reset --soft HEAD^' | |
| Set your email address with the following command: | |
| git config --global user.email "your_email@example.com" | |
| Global gitignore: | |
| git config --global core.excludesfile ~/.gitignore | |
| Confirm that you have set your email address correctly with the following command. |
| function transfer | |
| if test (count $argv) -eq 0 | |
| echo "No arguments specified. Usage:\necho transfer /tmp/test.md\ncat /tmp/test.md | transfer test.md" | |
| return 1 | |
| end | |
| ## get temporarily filename, output is written to this file show progress can be showed | |
| set tmpfile ( mktemp -t transferXXX ) | |
| ## upload stdin or file |
A personal diary of DataFrame munging over the years.
Convert Series datatype to numeric (will error if column has non-numeric values)
(h/t @makmanalp)
(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
The MBP is my development machine, so I needed all of my tools installed with the ability to update them with ease. In the past, I used MacPorts to take care of my MySQL, Memcached, and Ruby installions and it worked just fine. This time around however, I wanted something new and fun. Homebrew.
Homebrew is a new package manager for OS X. Unlike Fink or MacPorts, Homebrew integrates with the core operating system, reducing the number of extra libraries to install etc. Another neat feature is the ability to write software package recipes in Ruby, awesome.
Here are some raw installation instructions (clean system). I like to keep everything under user ownership to make life more enjoyable, say no to sudo.
You will need the latest version of xcode, you can get it here. After the installation is complete, you may continue.
sudo mkdir /usr/local