Release 2.1
This merge adds a number of features to be included in release 2.1:
New neural network architectures
- densenet:
ketos.neural_networks.densenet::DenseNetInterface
- inception:
ketos.neural_networks.inception::InceptionInterface
- resnet 1D:
ketos.neural_networks.resnet::ResNet1DInterface
- cnn 1D:
ketos.neural_networks.cnn::CNN1DInterface
Early stopping
All neural network interfaces can now use an early stopping monitor, to halt training if a condition is met.
General load model function
a load_model_file
function was added to the ketos.neural_networks
namespace, which can rebuild a model from a .kt file without the user having to know which architecture the model has.
Before, you had to know which interface to use (i.e.: which kind of network that was):
from ketos.neural_networks.resnet import ResNetInterface
from ketos.neural_networks.resnet import CNNInterface
model_1, audio_repr_1 = ResNetInterface.load_model_file("model_1.kt", "tmp_model_dir", load_audio_repr=True)
model_2, audio_repr_2 = CNNInterface.load_model_file("model_2.kt", "tmp_model_dir", load_audio_repr=True)
Now you can do:
from ketos.neural_networks import load_model_file
model_1, audio_repr_1 = load_model_file("model_1.kt", "tmp_model_dir", load_audio_repr=True)
model_2, audio_repr_2 = load_model_file("model_2.kt", "tmp_model_dir", load_audio_repr=True)
In order for this to work, all model architectures add a field 'interface' to the recipes. If a recipe does not have this field (e.g.: from a model created with an older ketos version), an exception will be raised. All models can still be loaded as before, through their interface classes.
detection module
A new module ketos.neural_networks.dev_utils.detection
was created to aid developers who want to use snapshot classifiers as detectors in longer files.
A tutorial was also added to the docs.