keras.losses.Loss not available on previous versions

This commit is contained in:
Fabio Manganiello 2020-10-28 19:44:36 +01:00
parent a1c8e6bee1
commit 870f7ad6b4

View file

@ -18,7 +18,7 @@ class Model:
# noinspection PyShadowingNames # noinspection PyShadowingNames
def __init__(self, layers: Optional[List[Layer]] = None, labels: Optional[List[str]] = None, def __init__(self, layers: Optional[List[Layer]] = None, labels: Optional[List[str]] = None,
model: Optional[_Model] = None, optimizer: Union[str, optimizers.Optimizer] = 'adam', model: Optional[_Model] = None, optimizer: Union[str, optimizers.Optimizer] = 'adam',
loss: Union[str, Union[str, losses.Loss]] = 'sparse_categorical_crossentropy', loss: str = 'sparse_categorical_crossentropy',
metrics: List[Union[str, metrics.Metric]] = ('accuracy',), metrics: List[Union[str, metrics.Metric]] = ('accuracy',),
low_freq: int = AudioSegment.default_low_freq, low_freq: int = AudioSegment.default_low_freq,
high_freq: int = AudioSegment.default_high_freq): high_freq: int = AudioSegment.default_high_freq):