Beispiel #1
0
                    X_train,
                    Y_train,
                    batch_size=config.BATCH_SIZE,
                ),
                #seed=config.augment_flow_seed),
                epochs=config.EPOCHS,
                verbose=1,
                steps_per_epoch=int(1.2 * len(Y_train) / config.BATCH_SIZE),
                #validation_data=datagen.flow(X_test, Y_test , batch_size=config.BATCH_SIZE),
                callbacks=callbacks_list,
                class_weight=config.CLASS_WEIGHT,
                workers=config.WORKERS,
                use_multiprocessing=config.USE_MULTIPROCESS,
                max_queue_size=config.MAX_QUEUE_SIZE)
        try:
            best_model_path, best_accu = find_best_model(ff)
        except:
            best_accu = nan

        trial_count += 1
        seed_curr += 1
        K.clear_session()
        #del model
        gc.collect()

    expt_label = 'Run' + str(rr)
    # Make soundstream of all folders
    #sample_stream = make_sound_stream(file_days)

    # If the selcetion table path does not exist create it
    #    if not os.path.exists(seltab_detect_path):
Beispiel #2
0
############################################################
# (1) Training classifiers using FULL dataset
# EFFECT OF RANDOM INITIALIZATION
# create a fold in cross-validation folder to store testing/evalidation results

result_path = os.path.join(config.TRAIN_RESULT_PATH, '__full_data')

#for ff in run_folders:
#for rr in range(config.NUM_RUNS):
#for rr in range(5, config.NUM_RUNS):
for rr in range(1):
    ff = result_path + '/Run' + str(rr)
    os.makedirs(ff, exist_ok=True)
    print(ff)

    best_model_path, best_accu = find_best_model(ff)

    expt_label = 'Run' + str(rr)
    # Make soundstream of all folders
    #sample_stream = make_sound_stream(file_days)

    # If the selcetion table path does not exist create it
    #    if not os.path.exists(seltab_detect_path):
    #        os.makedirs(seltab_detect_path, exist_ok=True)
    print('Detecting:')
    full_process_interface_dsp(expt_label, day_list, best_model_path, ff,
                               day_file_map, config)

K.clear_session()
gc.collect()
#cuda.select_device(0)