Esempio n. 1
0
        #### norm the data ####
        data_utils.norm_data(test_x, inp_scaler)
        
        #### compute predictions ####
        keras_models.predict(test_x, out_scaler, gen_test_file_list, cfg.sequential_training)


if __name__ == "__main__":
    
    if len(sys.argv) != 2:
        logger.critical('usage: python run_keras_with_merlin_io.py [config file name]')
        sys.exit(1)

    # create a configuration instance
    # and get a short name for this instance
    cfg = configuration.configuration()
    
    config_file = sys.argv[1]

    config_file = os.path.abspath(config_file)
    cfg.configure(config_file)
    
    print("--- Job started ---")
    start_time = time.time()
    
    # main function
    main(cfg)

    (m, s) = divmod(int(time.time() - start_time), 60) 
    print("--- Job completion time: %d min. %d sec ---" % (m, s)) 
        if self.TRAINMODEL:
            self.train_keras_model()

        if self.TESTMODEL:
            self.test_keras_model()

if __name__ == "__main__":

    if len(sys.argv) != 2:
        print('usage: python run_keras_with_merlin_io.py [config file name]')
        sys.exit(1)

    # create a configuration instance
    # and get a short name for this instance
    cfg = configuration.configuration()

    config_file = sys.argv[1]

    config_file = os.path.abspath(config_file)
    cfg.configure(config_file)

    print("--- Job started ---")
    start_time = time.time()

    # main function
    keras_instance = KerasClass(cfg)
    keras_instance.main_function()

    (m, s) = divmod(int(time.time() - start_time), 60)
    print(("--- Job completion time: %d min. %d sec ---" % (m, s)))