Skip to content

Instantly share code, notes, and snippets.

Created January 23, 2019 21:17
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
What would you like to do?
import numpy as np
import pandas as pd
from numpy import concatenate
from matplotlib import pyplot
from keras.models import Sequential
from keras.callbacks import Callback
from keras.layers import LSTM, Dense, Activation
import matplotlib.pyplot as plt
%matplotlib inline
N_DATA_ORIG = 3000 # length of data to generate
N_FEATURES = 5 # number of syntethic features to create
N_ROLLING = 1000 # length of window over which to smooth the random data to make it look realistic
N_TIMESTEPS = 5 # number of timesteps you want to both train on and predict out to
N_DATA = N_DATA_ORIG - N_ROLLING # length of final data after smoothing
N_TRAIN_ITERATIONS = 5 # number of times to iterate training of the model
N_EPOCHS = 5 # within each train call how many epochs to run for
BATCH_SIZE = 100 # batch size to train on
N_LAYERS = 3 # number of layers for the LSTM
N_LSTM_UNITS = 2 # number of hidden unit in each LSTM layer
BREAK_LEN = 1000 # length of the break in the data we will create
random_break_point = np.random.choice(N_DATA) # pick a random point in the data to swap in the broken data into
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment