|
|
|
|
|
|
|
|
""" |
|
|
Script to train the DTLN model in default settings. The folders for noisy and |
|
|
clean files are expected to have the same number of files and the files to |
|
|
have the same name. The training procedure always saves the best weights of |
|
|
the model into the folder "./models_'runName'/". Also a log file of the |
|
|
training progress is written there. To change any parameters go to the |
|
|
"DTLN_model.py" file or use "modelTrainer.parameter = XY" in this file. |
|
|
It is recommended to run the training on a GPU. The setup is optimized for the |
|
|
DNS-Challenge data set. If you use a custom data set, just play around with |
|
|
the parameters. |
|
|
|
|
|
Please change the folder names before starting the training. |
|
|
|
|
|
Example call: |
|
|
$python run_training.py |
|
|
|
|
|
Author: Nils L. Westhausen (nils.westhausen@uol.de) |
|
|
Version: 13.05.2020 |
|
|
|
|
|
This code is licensed under the terms of the MIT-license. |
|
|
""" |
|
|
|
|
|
from DTLN_model import DTLN_model |
|
|
import os |
|
|
|
|
|
|
|
|
os.environ["CUDA_VISIBLE_DEVICES"]='0' |
|
|
|
|
|
os.environ['TF_DETERMINISTIC_OPS'] = '1' |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
path_to_train_mix = '/path/to/noisy/training/data/' |
|
|
|
|
|
path_to_train_speech = '/path/to/clean/training/data/' |
|
|
|
|
|
path_to_val_mix = '/path/to/noisy/validation/data/' |
|
|
|
|
|
path_to_val_speech = '/path/to/clean/validation/data/' |
|
|
|
|
|
|
|
|
runName = 'DTLN_model' |
|
|
|
|
|
modelTrainer = DTLN_model() |
|
|
|
|
|
modelTrainer.build_DTLN_model() |
|
|
|
|
|
modelTrainer.compile_model() |
|
|
|
|
|
modelTrainer.train_model(runName, path_to_train_mix, path_to_train_speech, \ |
|
|
path_to_val_mix, path_to_val_speech) |
|
|
|
|
|
|
|
|
|
|
|
|