output_list.append(model_name + "\n")
    print(model_name)
    output[model_name][str(reliability_setting)][
        iteration - 1] = calculateExpectedAccuracy(
            model,
            no_information_flow_map,
            reliability_setting,
            output_list,
            training_labels=training_labels,
            test_data=test_data,
            test_labels=test_labels)


# runs all 3 failure configurations for all 3 models
if __name__ == "__main__":
    accuracy = accuracy("Health")
    calculateExpectedAccuracy = accuracy.calculateExpectedAccuracy
    use_GCP = False
    training_data, val_data, test_data, training_labels, val_labels, test_labels = init_data(
        use_GCP)

    ResiliNet_no_information_flow_map = make_no_information_flow_map(
        "Health", default_skip_hyperconnection_config)
    deepFogGuard_no_information_flow_map = make_no_information_flow_map(
        "Health", default_skip_hyperconnection_config)
    Vanilla_no_information_flow_map = make_no_information_flow_map("Health")

    num_iterations, num_vars, num_classes, reliability_settings, num_train_epochs, hidden_units, batch_size = init_common_experiment_params(
        training_data)

    load_for_inference = False
            input_shape=input_shape,
            alpha=alpha,
            reliability_setting=reliability_setting,
            skip_hyperconnection_config=skip_hyperconnection_configuration,
            strides=strides,
            num_gpus=num_gpus)
    get_model_weights_CNN_cifar(
        model, parallel_model, model_name, load_for_inference, model_file,
        training_data, training_labels, val_data, val_labels, train_datagen,
        batch_size, epochs, progress_verbose, checkpoint_verbose,
        train_steps_per_epoch, val_steps_per_epoch, num_gpus)
    return model


if __name__ == "__main__":
    accuracy = accuracy("CIFAR")
    calculateExpectedAccuracy = accuracy.calculateExpectedAccuracy
    training_data, test_data, training_labels, test_labels, val_data, val_labels = init_data(
    )

    num_iterations, classes, reliability_settings, train_datagen, batch_size, epochs, progress_verbose, checkpoint_verbose, use_GCP, alpha, input_shape, strides, num_gpus = init_common_experiment_params(
    )
    skip_hyperconnection_configurations = [
        # [e1,IoT]
        [0, 0],
        [1, 0],
        [0, 1],
        [1, 1],
    ]
    model_name = "ResiliNet Hyperconnection Weight Sensitivity"
    default_reliability_setting = [1.0, 1.0, 1.0]
Ejemplo n.º 3
0
            hidden_units,
            reliability_setting=reliability_setting,
            hyperconnection_weights_scheme=weight_scheme)
        model_file = "models/" + str(iteration) + "_" + str(
            reliability_setting) + "_" + str(
                weight_scheme) + 'camera_hyperconnection_ResiliNet.h5'
    get_model_weights_MLP_camera(model, model_name, load_for_inference,
                                 model_file, training_data, training_labels,
                                 val_data, val_labels, num_train_epochs,
                                 batch_size, verbose)
    return model


# runs all 3 failure configurations for all 3 models
if __name__ == "__main__":
    accuracy = accuracy("Camera")
    calculateExpectedAccuracy = accuracy.calculateExpectedAccuracy
    use_GCP = False
    training_data, val_data, test_data, training_labels, val_labels, test_labels = init_data(
        use_GCP)

    reliability_settings, input_shape, num_classes, hidden_units, batch_size, num_train_epochs, num_iterations = init_common_experiment_params(
    )
    no_information_flow_map = make_no_information_flow_map(
        "Camera", default_skip_hyperconnection_config)

    load_for_inference = False
    # file name with the experiments accuracy output
    output_name = "results/camera_hyperconnection_weight.txt"
    verbose = 2
    model_name = "ResiliNet Hyperconnection Weight"
Ejemplo n.º 4
0
                  num_test_examples):
    output_list.append(model_name + "\n")
    print(model_name)
    output[model_name][str(reliability_setting)][
        iteration - 1] = calculateExpectedAccuracy(
            model,
            no_information_flow_map,
            reliability_setting,
            output_list,
            test_generator=test_generator,
            num_test_examples=num_test_examples)


# runs all 3 failure configurations for all 3 models
if __name__ == "__main__":
    accuracy = accuracy("Imagenet")
    calculateExpectedAccuracy = accuracy.calculateExpectedAccuracy
    use_GCP = False
    num_iterations, num_train_examples, num_test_examples, reliability_settings, input_shape, num_classes, alpha, epochs, num_gpus, strides, num_workers = init_common_experiment_params(
    )
    train_generator, test_generator = init_data(use_GCP, num_gpus)

    ResiliNet_no_information_flow_map = make_no_information_flow_map(
        "CIFAR/Imagenet", default_skip_hyperconnection_config)
    deepFogGuard_no_information_flow_map = make_no_information_flow_map(
        "CIFAR/Imagenet", default_skip_hyperconnection_config)
    Vanilla_no_information_flow_map = make_no_information_flow_map(
        "CIFAR/Imagenet")

    load_for_inference = False
    continue_training = False  # loads a pre-trained model and improves it with more training