From b174a866fcda0d7e5108389e763c7d1df5d0e9d2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vicente=20Adolfo=20Bolea=20S=C3=A1nchez?= Date: Mon, 18 Jun 2018 23:44:10 +0900 Subject: [PATCH] ready to submit --- README.md | 6 +++++- driver.py | 17 ++++++++++++----- model_depth.py | 5 ++--- model_location.py | 2 +- model_magnitude.py | 2 +- model_time.py | 2 +- 6 files changed, 22 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index 50bfe80..6a7f739 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,7 @@ Based on the following independent variable: 2. Ten different detecting stations's P-wave arrival time. ## REQUIREMENTS - 1. Having a dedicated NVIDIA GPU + 1. Having a dedicated NVIDIA GPU + CUDA 8.0 ## INSTALLING @@ -22,6 +22,10 @@ Based on the following independent variable: $ pipenv run python ./driver.py +Our models start converging at a number of epochs = 2000. Thus to Change the number of epochs: + + $ EPOCHS=3000 pipenv run python ./driver.py + ## AUTHORS Hero | email diff --git a/driver.py b/driver.py index 8b10926..2fc2a8d 100644 --- a/driver.py +++ b/driver.py @@ -17,13 +17,14 @@ ["model_location", "./dataset/NN_test_Y_eqLoc.mat", "data_eqLoc"] ] -BATCH_SIZE = 50 +BATCH_SIZE = 100 EPOCHS = 2000 if 'EPOCHS' in environ: EPOCHS = int(environ['EPOCHS']) +scores = { } for setup in tests: train_x, train_y, test_x, test_y = prepare_features(setup[1], setup[2]) model_factory = model_create(setup[0],53) @@ -38,8 +39,14 @@ verbose=1, validation_split=0.2) - score = model.evaluate(test_x, test_y, verbose=0) - print('Test loss:', score[0]) - print('Test mse:', score[1]) + scores[setup[2]] = model.evaluate(test_x, test_y, verbose=0) + #print('Test loss:', score[0]) + #print('Test mse:', score[1]) -embed() + +for name,score in scores.iteritems(): + print "TEST NAME: ", name + print "Total MSE: ", score[1] + + +#embed() diff --git a/model_depth.py b/model_depth.py index 11b9223..0b20728 100644 --- a/model_depth.py +++ b/model_depth.py @@ -7,8 +7,7 @@ class ModelDepth(ModelFactory): def create(self): model = Sequential() model.add(Dense(53, init='normal', input_shape=(self.dim,), activation='relu')) - model.add(Dense(8, activation='relu')) - model.add(Dense(5, activation='relu')) - model.add(Dense(1, init='normal')) #, activation='elu')) + model.add(Dense(20, activation='relu')) + model.add(Dense(1, init='normal')) self.model = model return model diff --git a/model_location.py b/model_location.py index a1dba59..8f91a94 100644 --- a/model_location.py +++ b/model_location.py @@ -8,7 +8,7 @@ def create(self): model = Sequential() model.add(Dense(53, init='normal', input_shape=(self.dim,), activation='relu')) model.add(Dense(10, activation='relu')) - model.add(Dense(2, init='normal')) #, activation='elu')) + model.add(Dense(2, init='normal')) self.model = model return model diff --git a/model_magnitude.py b/model_magnitude.py index 4a3a0ef..0a0071e 100644 --- a/model_magnitude.py +++ b/model_magnitude.py @@ -8,6 +8,6 @@ def create(self): model = Sequential() model.add(Dense(53, init='normal', input_shape=(self.dim,), activation='relu')) model.add(Dense(10, activation='relu')) - model.add(Dense(1, init='normal')) #, activation='elu')) + model.add(Dense(1, init='normal')) self.model = model return model diff --git a/model_time.py b/model_time.py index 1764b60..52cd2c2 100644 --- a/model_time.py +++ b/model_time.py @@ -8,6 +8,6 @@ def create(self): model = Sequential() model.add(Dense(53, init='normal', input_shape=(self.dim,), activation='relu')) model.add(Dense(10, activation='relu')) - model.add(Dense(1, init='normal')) #, activation='elu')) + model.add(Dense(1, init='normal')) self.model = model return model