From a1c8e6bee18d05e01e604ad65e953416e137da6c Mon Sep 17 00:00:00 2001 From: Fabio Manganiello Date: Wed, 28 Oct 2020 19:40:46 +0100 Subject: [PATCH] sparse_categorical_crossentropy as a string for back-compatibility with previous Keras versions --- micmon/model/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/micmon/model/__init__.py b/micmon/model/__init__.py index 31212e4..38751cb 100644 --- a/micmon/model/__init__.py +++ b/micmon/model/__init__.py @@ -18,7 +18,7 @@ class Model: # noinspection PyShadowingNames def __init__(self, layers: Optional[List[Layer]] = None, labels: Optional[List[str]] = None, model: Optional[_Model] = None, optimizer: Union[str, optimizers.Optimizer] = 'adam', - loss: Union[str, losses.Loss] = losses.SparseCategoricalCrossentropy(from_logits=True), + loss: Union[str, Union[str, losses.Loss]] = 'sparse_categorical_crossentropy', metrics: List[Union[str, metrics.Metric]] = ('accuracy',), low_freq: int = AudioSegment.default_low_freq, high_freq: int = AudioSegment.default_high_freq):