From 3075ffcf540c38b7072da254247ccf2d7cf1db12 Mon Sep 17 00:00:00 2001 From: codekansas Date: Mon, 25 Apr 2016 00:46:33 -0400 Subject: [PATCH] :+1: --- insuranceqa.py | 2 +- keras_attention_model.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/insuranceqa.py b/insuranceqa.py index b940d22..9bf2ec7 100644 --- a/insuranceqa.py +++ b/insuranceqa.py @@ -184,7 +184,7 @@ test_model.load_weights(os.path.join(models_path, 'iqa_model_for_prediction.h5') # found through experimentation that ~24 epochs generalized the best print('Fitting model') -for i in range(30): +for i in range(10000): print('----- %d -----' % i) np.random.shuffle(ab_data) train_model.fit([q_data, ag_data, ab_data], targets, nb_epoch=1, batch_size=128, validation_data=[[qv_data, avg_data, avb_data], v_targets], shuffle=True) diff --git a/keras_attention_model.py b/keras_attention_model.py index 8734899..a8bd70f 100644 --- a/keras_attention_model.py +++ b/keras_attention_model.py @@ -82,7 +82,7 @@ def make_model(maxlen_question, maxlen_answer, n_words, n_lstm_dims=141, n_embed # merge together # note: `cos` refers to "cosine similarity", i.e. similar vectors should go to 1 - # for training's sake, "abs" limits range to be tween 0 and 1 (binary classification) + # for training's sake, "abs" limits range to between 0 and 1 (binary classification) good_out = merge([q_out, ag_out], name='good', mode='cos', dot_axes=1) bad_out = merge([q_out, ab_out], name='bad', mode='cos', dot_axes=1)