Skip to content

Instantly share code, notes, and snippets.

@kmcelwee
Last active January 23, 2020 20:26
Show Gist options
  • Save kmcelwee/8077dd9bbd792161977be9c796421fe5 to your computer and use it in GitHub Desktop.
Save kmcelwee/8077dd9bbd792161977be9c796421fe5 to your computer and use it in GitHub Desktop.
HOURS_AHEAD = 24
s = all_X.shape[1]
model = tf.keras.Sequential()
model.add(layers.Dense(s, activation=tf.nn.relu, input_shape=(HOURS_AHEAD, all_X.shape[1])))
model.add(layers.Dense(s, activation=tf.nn.relu))
model.add(layers.Dense(s, activation=tf.nn.relu))
model.add(layers.Dense(s, activation=tf.nn.relu))
model.add(layers.Dense(s, activation=tf.nn.relu))
model.add(layers.Flatten())
model.add(layers.Dense(all_X.shape[1]*HOURS_AHEAD//2, activation=tf.nn.relu))
model.add(layers.Dense(HOURS_AHEAD))
nadam = tf.keras.optimizers.Nadam(learning_rate=0.002, beta_1=0.9, beta_2=0.999)
model.compile(optimizer=nadam, loss='mape')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment