def main():
    os.environ['CUDA_VISIBLE_DEVICES'] = '-1'  # This line disables GPU

    # Quick logging setup. Proper logging (to file) is setup later for each experiment
    logging.basicConfig(format="%(asctime)s [%(levelname)s] %(message)s",
                        level=logging.INFO)

    filename = get_filename_from_args()
    experiments = utility.get_experiments(filename)

    for exp_param_set in experiments:
        logging.info(
            '--------------- Running experiment {} --------------- \n'.format(
                exp_param_set['exp_id']))

        augment_exp_params(exp_param_set)
        exp_param_set['results_dir'] = 'output'  # Set base results dir
        utility.initialize(exp_param_set)
        run_experiment(exp_param_set)

        logging.info(
            '--------------- Finished running experiment {} --------------- \n'
            .format(exp_param_set['exp_id']))

    logging.info(
        '================= Finished running all experiments ================= \n'
    )
def main():
    utility.initialize(params)

    # ---------------------------------------------------
    # Dataset preparation

    # Extract windows from time series and prepare a dataset (and save it)
    # X_all, y_all = prepare_and_save_dataset(params)

    # Convert above prepared dataset to catch_22 features (and save it)
    X_all, y_all = utility.load_prepared_dataset(params)
    convert_to_catch22_and_save_dataset(X_all, y_all,
                                        params['num_samples_in_pool'])
예제 #3
0
def main():
    sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
    con = sock.connect_ex(('127.0.0.1', 5000))

    if con is not 0:
        if FileManager().is_file_exists("./data/fontman.db"):
            threading.Thread(target=run_tasks).start()
            run_flask_app()

        else:
            initialize()
            threading.Thread(target=run_tasks).start()
            run_flask_app()
    else:
        print("Port is in use.")
예제 #4
0
def main():
    utility.initialize(params)

    # ---------------------------------------------------
    # Initial analysis (visualization)

    series_1_u = visualize_series(params['data_file'], [1], "Undamaged (s#1)")
    print(series_1_u.head())

    series_3_d = visualize_series(params['data_file'], [3], "Damaged (s#3)")

    visualize_undersampling(series_1_u, "Undamaged (s#1)")

    visualize_truncation(series_1_u, "Undamaged (s#1)")

    # cut_series = full_series.iloc[0:len(full_series) // 16]
    # plot_acf(cut_series, lags=np.arange(-500, 500))

    utility.save_all_figures(params['results_dir'])
예제 #5
0
import sys

import utility as u
from common import defaults

reload(sys)
sys.setdefaultencoding('utf-8')

sys.path.append(u.join_path(u.dir_name(__file__), '../bin'))

u.initialize(u.dir_name(__file__))

u.init_env(defaults.defaults)