Beispiel #1
0
from models.crnn import CRNNModel
from sklearn.pipeline import Pipeline

WINDOW_SIZE = 1366

dataloader = MelSpectrogramsLoader(
    data_path=prefix_path("melspec_data", common.DEFAULT_PATH),
    training_path=prefix_path("autotagging_moodtheme-train.tsv",
                              common.DEFAULT_PATH),
    test_path=prefix_path("autotagging_moodtheme-test.tsv",
                          common.DEFAULT_PATH),
    validate_path=prefix_path("autotagging_moodtheme-validation.tsv",
                              common.DEFAULT_PATH),
    window_size=WINDOW_SIZE,
    window='random',
    num_windows=5,
)

pipeline = Pipeline([
    ("model", CRNNModel(epochs=32, dataloader=dataloader, attention=True)),
])

evaluator = ModelCallbackWrapper(
    FixedSplitEvaluator(**common.fixed_split_params()),
    lambda model: common.store_prediction(model, dataloader),
)

result_handlers = [
    result_handlers.print_gridsearch_results,
]
WINDOW_SIZE = 1366

dataloader = MelSpectrogramsLoader(
    data_path=prefix_path("melspec_data", common.DEFAULT_PATH),
    training_path=prefix_path("autotagging_moodtheme-train.tsv",
                              common.DEFAULT_PATH),
    test_path=prefix_path("autotagging_moodtheme-test.tsv",
                          common.DEFAULT_PATH),
    validate_path=prefix_path("autotagging_moodtheme-validation.tsv",
                              common.DEFAULT_PATH),
    window_size=WINDOW_SIZE,
)

pipeline = Pipeline([
    ("model", CRNNModel(dataloader=dataloader)),
])

grid_params = common.grid_params()
grid_params['n_jobs'] = 1

evaluator = FixedSplitGridEvaluator(
    params={
        "model__epochs": [2, 16],
        "model__output_dropout": [None],
        "model__attention": [True],
    },
    grid_params=grid_params,
)

result_handlers = [
from models.crnn import CRNNModel
from sklearn.pipeline import Pipeline

WINDOW_SIZE = 1366

dataloader = MelSpectrogramsLoader(
    data_path=prefix_path("melspec_data", common.DEFAULT_PATH),
    training_path=prefix_path("autotagging_moodtheme-train.tsv",
                              common.DEFAULT_PATH),
    test_path=prefix_path("autotagging_moodtheme-test.tsv",
                          common.DEFAULT_PATH),
    validate_path=prefix_path("autotagging_moodtheme-validation.tsv",
                              common.DEFAULT_PATH),
    window_size=WINDOW_SIZE,
    window='random',
    num_windows=5,
)

pipeline = Pipeline([
    ("model", CRNNModel(epochs=16, dataloader=dataloader)),
])

evaluator = ModelCallbackWrapper(
    FixedSplitEvaluator(**common.fixed_split_params()),
    lambda model: common.store_prediction(model, dataloader),
)

result_handlers = [
    result_handlers.print_gridsearch_results,
]
Beispiel #4
0
from sklearn.pipeline import Pipeline

WINDOW_SIZE = 1366

dataloader = MelSpectrogramsLoader(
    data_path=prefix_path("melspec_data", common.DEFAULT_PATH),
    training_path=prefix_path("autotagging_moodtheme-train.tsv",
                              common.DEFAULT_PATH),
    test_path=prefix_path("autotagging_moodtheme-test.tsv",
                          common.DEFAULT_PATH),
    validate_path=prefix_path("autotagging_moodtheme-validation.tsv",
                              common.DEFAULT_PATH),
    window_size=WINDOW_SIZE,
)

EPOCHS = 1
FILE_PREFIX = 'crnn_' + str(EPOCHS)

pipeline = Pipeline([
    ("model", CRNNModel(epochs=EPOCHS, dataloader=dataloader)),
])

evaluator = ModelCallbackWrapper(
    FixedSplitEvaluator(**common.fixed_split_params()),
    lambda model: common.store_prediction(model, dataloader, FILE_PREFIX),
)

result_handlers = [
    result_handlers.print_gridsearch_results,
]