From 0c4523fdba427ba84d4d43890f64ecd3ce8fbfb5 Mon Sep 17 00:00:00 2001 From: Mohamed Haseeb Date: Sun, 23 Dec 2018 18:36:21 +0100 Subject: [PATCH] printouts update --- example.py | 4 ++-- shapelets_lts/classification/shapelet_models.py | 6 ++++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/example.py b/example.py index 93b41ee..282c287 100644 --- a/example.py +++ b/example.py @@ -29,7 +29,7 @@ def main(): print('\nLoading data...') x_train, y_train, x_test, y_test = _load_train_test_datasets() - # create a classifier. (200 epochs yielded a 0.99 accuracy) + # create a classifier Q = x_train.shape[1] K = int(0.15 * Q) L_min = int(0.2 * Q) @@ -37,7 +37,7 @@ def main(): K=K, R=3, L_min=L_min, - epocs=200, + epocs=30, # (200 epochs yielded a 0.99 accuracy) lamda=0.01, eta=0.01, shapelet_initialization='segments_centroids', diff --git a/shapelets_lts/classification/shapelet_models.py b/shapelets_lts/classification/shapelet_models.py index bf895ab..e160f99 100644 --- a/shapelets_lts/classification/shapelet_models.py +++ b/shapelets_lts/classification/shapelet_models.py @@ -178,8 +178,10 @@ def _train_network(self): valid_accur[0, epoc] = valid_epoc_accur # print current loss info - print("epoc=" + str(epoc) + "/" + str(self.epocs - 1) + " (iteration=" + str(iteration) + ") loss=" + str(l) - + " validation accuracy=" + str(valid_epoc_accur)) + print( + 'epoch={}/{} (iteration={}) loss={} validation accuracy={}' + ''.format(epoc + 1, self.epocs, iteration, l, valid_epoc_accur) + ) # plot if needed if self.plot_loss: self._plot_loss(loss, valid_accur, epoc)