Skip to content

Instantly share code, notes, and snippets.

View nachomartinr's full-sized avatar

Ignacio Martín nachomartinr

View GitHub Profile
from __future__ import print_function
import os
import numpy as np
from keras.layers import RepeatVector
from keras.layers.core import Dropout
from keras.layers.recurrent import LSTM
from keras.models import Sequential
from keras.models import load_model
@nachomartinr
nachomartinr / incremental_file_name.py
Created January 13, 2017 11:49
create incremental file name
import os
i = 0
while os.path.exists("model_%s.ckpt" % i):
i += 1
f = open("model_%s.ckpt" % i, "w")
f.close()
with open('intermediate/pre_processed_data.bin', 'wb') as f:
np.save(f, X_train)
np.save(f, y_train)
np.save(f, X_val)
np.save(f, y_val)
np.save(f, X_test)
np.save(f, y_test)