From 062355ea49a1b32aeaeb2a563fe216f6c0753656 Mon Sep 17 00:00:00 2001 From: Jeremy Goodsitt Date: Wed, 5 Jun 2024 12:00:12 -0500 Subject: [PATCH] fix: comments --- dataprofiler/labelers/char_load_tf_model.py | 4 ++-- dataprofiler/labelers/character_level_cnn_model.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/dataprofiler/labelers/char_load_tf_model.py b/dataprofiler/labelers/char_load_tf_model.py index f921ac96..a4a44e03 100644 --- a/dataprofiler/labelers/char_load_tf_model.py +++ b/dataprofiler/labelers/char_load_tf_model.py @@ -253,7 +253,7 @@ def _construct_model(self) -> None: num_labels, activation="softmax", name="softmax_output" )(self._model.layers[softmax_layer_ind - 1].output) - # Output the model into a .pb file for TensorFlow + # Add argmax layer to get labels directly as an output argmax_layer = tf.keras.ops.argmax(new_softmax_layer, axis=2) argmax_outputs = [new_softmax_layer, argmax_layer] @@ -308,7 +308,7 @@ def _reconstruct_model(self) -> None: num_labels, activation="softmax", name="softmax_output" )(self._model.layers[-2].output) - # Output the model into a .pb file for TensorFlow + # Add argmax layer to get labels directly as an output argmax_layer = tf.keras.ops.argmax(final_softmax_layer, axis=2) argmax_outputs = [final_softmax_layer, argmax_layer] diff --git a/dataprofiler/labelers/character_level_cnn_model.py b/dataprofiler/labelers/character_level_cnn_model.py index 739c6c8a..01b7572f 100644 --- a/dataprofiler/labelers/character_level_cnn_model.py +++ b/dataprofiler/labelers/character_level_cnn_model.py @@ -558,7 +558,7 @@ def _construct_model(self) -> None: # Add the final Softmax layer self._model.add(tf.keras.layers.Dense(num_labels, activation="softmax")) - # Output the model into a .pb file for TensorFlow + # Add argmax layer to get labels directly as an output argmax_layer = tf.keras.ops.argmax(self._model.outputs[0], axis=2) # Create confidence layers @@ -620,7 +620,7 @@ def _reconstruct_model(self) -> None: num_labels, activation="softmax", name="dense_2" )(self._model.layers[-3].output) - # Output the model into a .pb file for TensorFlow + # Add argmax layer to get labels directly as an output argmax_layer = tf.keras.ops.argmax(final_softmax_layer, axis=2) # Create confidence layers