From b607030c177c9b83411f2ab9d0cfa06f0309f910 Mon Sep 17 00:00:00 2001
From: Nikolai Hartmann <Nikolai.Hartmann@physik.uni-muenchen.de>
Date: Mon, 6 Aug 2018 17:10:36 +0200
Subject: [PATCH] renaming tfhelpers to utils

---
 plotting.py              | 7 +++----
 scripts/plot_NN_2D.py    | 2 +-
 tfhelpers.py => utils.py | 2 +-
 3 files changed, 5 insertions(+), 6 deletions(-)
 rename tfhelpers.py => utils.py (98%)

diff --git a/plotting.py b/plotting.py
index 01061b2..86e476e 100644
--- a/plotting.py
+++ b/plotting.py
@@ -10,7 +10,7 @@ from mpl_toolkits.axes_grid1 import ImageGrid, make_axes_locatable
 import numpy as np
 
 from .keras_visualize_activations.read_activations import get_activations
-from .tfhelpers import get_grad_function, max_activation_wrt_input, create_random_event
+from .utils import get_grad_function, max_activation_wrt_input, create_random_event
 
 import logging
 logger = logging.getLogger(__name__)
@@ -328,10 +328,9 @@ if __name__ == "__main__":
 
     import logging
     logging.basicConfig()
-    logging.getLogger("tfhelpers").setLevel(logging.DEBUG)
-    logging.getLogger(__name__).setLevel(logging.DEBUG)
+    logging.getLogger().setLevel(logging.DEBUG)
 
-    from .tfhelpers import get_single_neuron_function, get_max_activation_events
+    from .utils import get_single_neuron_function, get_max_activation_events
 
     import meme
     # meme.setOptions(overrideCache="/scratch-local/nhartmann/meme_cache")
diff --git a/scripts/plot_NN_2D.py b/scripts/plot_NN_2D.py
index 59819d1..ab310d8 100755
--- a/scripts/plot_NN_2D.py
+++ b/scripts/plot_NN_2D.py
@@ -15,7 +15,7 @@ from KerasROOTClassification.plotting import (
     plot_hist_2D_events,
     plot_cond_avg_actmax_2D
 )
-from KerasROOTClassification.tfhelpers import get_single_neuron_function, get_max_activation_events
+from KerasROOTClassification.utils import get_single_neuron_function, get_max_activation_events
 
 parser = argparse.ArgumentParser(description='Create various 2D plots for a single neuron')
 parser.add_argument("project_dir")
diff --git a/tfhelpers.py b/utils.py
similarity index 98%
rename from tfhelpers.py
rename to utils.py
index 8f3c7b4..4c6fe8a 100644
--- a/tfhelpers.py
+++ b/utils.py
@@ -8,7 +8,7 @@ import keras.backend as K
 
 from meme import cache
 
-logger = logging.getLogger("tfhelpers")
+logger = logging.getLogger(__name__)
 logger.addHandler(logging.NullHandler())
 
 def get_single_neuron_function(model, layer, neuron, scaler=None):
-- 
GitLab