Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions src/smlp_py/train_keras.py
Original file line number Diff line number Diff line change
Expand Up @@ -370,7 +370,7 @@ def _log_model_summary(self, model, epochs, batch_size, sample_weights, callback
for k, v in self._loss_functions.items():
if str(v) in str(model.loss) or str(k) in str(model.loss):
self._keras_logger.info("Loss function: " + str(k))
if hasattr(model, 'compiled_metrics'):
if hasattr(model, 'compiled_metrics') and hasattr(model.compiled_metrics, '_metrics'):
compiled_metrics = model.compiled_metrics._metrics # Access the private _metrics attribute
self._keras_logger.info("Metrics: " + str([m.name for m in compiled_metrics]))
else:
Expand Down Expand Up @@ -900,5 +900,3 @@ def keras_main(self, resp_names:list[str], algo:str,
seed, weights_coef, model_per_response)
self._keras_logger.info('keras_main: end')
return model