Skip to content

Instantly share code, notes, and snippets.

@coreyauger
Created May 29, 2018 18:17
Show Gist options
  • Save coreyauger/7a6cd59b5318d9c8dca85fc6d93ab74b to your computer and use it in GitHub Desktop.
Save coreyauger/7a6cd59b5318d9c8dca85fc6d93ab74b to your computer and use it in GitHub Desktop.
#################################################################################################
## TRAIN FUTURE ENCODER
#################################################################################################
x_train_future = data[hold_out:,20:2420]
print("training on: " + str(x_train_future.shape))
input_future = Input(shape=(x_train_future.shape[1],))
encoded_future = Dense(encoding_dim, activation='relu')(input_future)
decoded_future = Dense(x_train_future.shape[1], activation='linear')(encoded_future)
autoencoder_future = Model(input_future, decoded_future)
autoencoder_future.compile(optimizer='adadelta', loss='mean_squared_error', metrics=['accuracy'])
modelPath_future= savePath+"/models/autoencoder-future-"+str(encoding_dim)+".hdf5"
checkpoint_future = ModelCheckpoint(modelPath_future, monitor='acc', verbose=2, save_best_only=True, mode='max')
history_future = autoencoder_future.fit(x_train_future, x_train_future,
batch_size=batch_size,
epochs=epochs,
verbose=2,
callbacks=[checkpoint_future],
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment