Ejemplo n.º 1
0
def test_deepbiome_classification_training(input_value_classification_training,
                                           output_value_classification):
    '''
    Test deepbiome by classification problem with simulated data
    '''
    log, network_info, path_info = input_value_classification_training
    real_train_evaluation, real_test_evaluation = output_value_classification

    seed_value = 123
    os.environ['PYTHONHASHSEED'] = str(seed_value)
    random.seed(seed_value)
    np.random.seed(seed_value)
    if tf.__version__.startswith('2'): tf.random.set_seed(seed_value)
    else: tf.set_random_seed(seed_value)
    test_evaluation, train_evaluation, network = deepbiome.deepbiome_train(
        log, network_info, path_info, number_of_fold=2)
    # np.save('data/classification_real_train_evaluation.npy', train_evaluation)
    # np.save('data/classification_real_test_evaluation.npy', test_evaluation)

    log.info('test')
    log.info(real_test_evaluation)
    log.info(test_evaluation)
    log.info(np.all(np.isclose(real_test_evaluation, test_evaluation)))

    log.info('training')
    log.info(real_train_evaluation)
    log.info(train_evaluation)
    log.info(np.all(np.isclose(real_train_evaluation, train_evaluation)))
Ejemplo n.º 2
0
def test_deepbiome_classification_deep_l1_training(
        input_value_classification_deep_l1_training):
    '''
    Test deepbiome by classification problem with simulated data
    '''
    log, network_info, path_info = input_value_classification_deep_l1_training

    seed_value = 123
    os.environ['PYTHONHASHSEED'] = str(seed_value)
    random.seed(seed_value)
    np.random.seed(seed_value)
    if tf.__version__.startswith('2'): tf.random.set_seed(seed_value)
    else: tf.set_random_seed(seed_value)
    test_evaluation, train_evaluation, network = deepbiome.deepbiome_train(
        log, network_info, path_info, number_of_fold=2)

    log.info('test')
    log.info(test_evaluation)

    log.info('training')
    log.info(train_evaluation)
Ejemplo n.º 3
0
    workers = int(argdict['workers'][0])
except:
    workers = 1
try:
    use_multiprocessing = argdict['use_multiprocessing'][0] == 'True'
except:
    use_multiprocessing = False

# Logger ###########################################################
logger = logging_daily.logging_daily(argdict['log_info'][0])
logger.reset_logging()
log = logger.get_logging()
log.setLevel(logging_daily.logging.INFO)

log.info('Argument input')
for argname, arg in argdict.items():
    log.info('    {}:{}'.format(argname, arg))

# Configuration ####################################################
config_data = configuration.Configurator(argdict['path_info'][0], log)
config_data.set_config_map(config_data.get_section_map())
config_data.print_config_map()

config_network = configuration.Configurator(argdict['network_info'][0], log)
config_network.set_config_map(config_network.get_section_map())
config_network.print_config_map()

path_info = config_data.get_config_map()
network_info = config_network.get_config_map()
test_evaluation, train_evaluation, network = deepbiome.deepbiome_train(
    log, network_info, path_info)  #, number_of_fold=100)