mirror of
https://github.com/BlackLight/micmon.git
synced 2024-11-24 04:35:13 +01:00
More Keras back-compatibility fixes
This commit is contained in:
parent
870f7ad6b4
commit
604c315b5e
1 changed files with 6 additions and 5 deletions
|
@ -2,8 +2,8 @@ import json
|
||||||
import os
|
import os
|
||||||
import numpy as np
|
import numpy as np
|
||||||
|
|
||||||
from typing import List, Optional, Union
|
from typing import List, Optional
|
||||||
from keras import Sequential, losses, optimizers, metrics
|
from keras import Sequential
|
||||||
from keras.layers import Layer
|
from keras.layers import Layer
|
||||||
from keras.models import load_model, Model as _Model
|
from keras.models import load_model, Model as _Model
|
||||||
|
|
||||||
|
@ -17,9 +17,10 @@ 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,
|
||||||
loss: str = 'sparse_categorical_crossentropy',
|
optimizer='adam',
|
||||||
metrics: List[Union[str, metrics.Metric]] = ('accuracy',),
|
loss='sparse_categorical_crossentropy',
|
||||||
|
metrics=('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):
|
||||||
assert layers or model
|
assert layers or model
|
||||||
|
|
Loading…
Reference in a new issue