def main(): X_train, X_test, Y_train, Y_test = get_dataset() from get_model import get_model, save_model model = get_model() model = train_model(model, X_train, X_test, Y_train, Y_test) save_model(model) return model
def main(): batch_size_for_capture = 300 x_train, y_train = get_dataset(batch_size_for_capture) model = create_model() model = train_model(model, x_train, y_train) save_model(model) return model
def main(): from get_dataset import get_dataset X, X_test, Y, Y_test = get_dataset() from get_model import get_model, save_model model = get_model(len(Y[0])) import numpy model = train_model(model, X, X_test, Y, Y_test) save_model(model) return model
def train(data_name, model_name): X, y = get_data.get_training_xy("./tracktrack/" + data_name + "/") model = get_model.get_model(model_name) try: model.fit(X[0::3], y[0::3], verbose=1, batch_size=64, nb_epoch=300, validation_data=(X[1::3], y[1::3])) except KeyboardInterrupt: pass get_model.save_model(model, model_name)
def main(): X, X_test, Y, Y_test = get_dataset() model = get_model() model = train_model(model, X, X_test, Y, Y_test) save_model(model) return model
def main(): x, x_test, y, y_test = get_dataset() model = get_model() model = train_model(model, x, x_test, y, y_test) save_model(model) return model
plt.xlabel('Num of Epochs') plt.ylabel('Accuracy') plt.legend(['train', 'validation'], loc='best') plt.subplot(1, 2, 2) plt.plot(np.arange(1, len(history['loss']) + 1), history['loss'], 'r') plt.plot(np.arange(1, len(history['val_loss']) + 1), history['val_loss'], 'g') plt.xticks(np.arange(0, epochs + 1, epochs / 10)) plt.title('Training Loss vs. Validation Loss') plt.xlabel('Num of Epochs') plt.ylabel('Loss') plt.legend(['train', 'validation'], loc='best') plt.show() X_train, X_test, y_train, y_test = get_dataset() model = get_model(num_classes=5) model = train_model(model, X_train, X_test, y_train, y_test, batch_size=32, num_epochs=50) save_model(model)