Ejemplo n.º 1
0
    metrics_names = [
        m.__name__ if not isinstance(m, str) else m for m in metrics
    ]
    return None, \
           dict(zip(metrics_names, test_scores)), \
           None


if __name__ == '__main__':
    grid_search = False
    if grid_search:
        run_grid_search(experimentclass=DTSExperiment,
                        parameters=yaml.load(
                            open(os.path.join(config['config'],
                                              'static.yaml'))),
                        db_name=config['db'],
                        ex_name='static+grid_search',
                        f_main=main,
                        f_config=ex_config,
                        f_metrics=log_metrics,
                        cmd_args=vars(args),
                        observer_type='mongodb')
    else:
        run_single_experiment(experimentclass=DTSExperiment,
                              db_name=config['db'],
                              ex_name='static',
                              f_main=main,
                              f_config=ex_config,
                              f_metrics=log_metrics,
                              cmd_args=vars(args),
                              observer_type='mongodb')
Ejemplo n.º 2
0
                                    fn_plot=fn_plot)
    else:
        test_scores = ffnn.evaluate([X_test, y_test],
                                    fn_inverse=fn_inverse_test,
                                    fn_plot=fn_plot)

    metrics_names = [
        m.__name__ if not isinstance(m, str) else m for m in model.metrics
    ]
    return dict(zip(metrics_names, val_scores)), \
           dict(zip(metrics_names, test_scores)), \
           model_filepath


if __name__ == '__main__':
    if args.grid_search:
        run_grid_search(experimentclass=DTSExperiment,
                        db_name=config['db'],
                        ex_name='ffnn_grid_search',
                        f_main=main,
                        f_metrics=log_metrics,
                        f_config=args.add_config,
                        observer_type=args.observer)
    else:
        run_single_experiment(experimentclass=DTSExperiment,
                              db_name=config['db'],
                              ex_name='ffnn',
                              f_main=main,
                              f_config=args.add_config,
                              f_metrics=log_metrics,
                              observer_type=args.observer)