deepFogGuard_no_information_flow_map,
                          reliability_setting, output_list, training_labels,
                          test_data, test_labels)
            calc_accuracy(iteration, "Vanilla", Vanilla,
                          Vanilla_no_information_flow_map, reliability_setting,
                          output_list, training_labels, test_data, test_labels)

        # clear session so that model will recycled back into memory
        K.clear_session()
        gc.collect()
        del deepFogGuard
        del ResiliNet
        del Vanilla
# calculate average accuracies from all expected accuracies
    for reliability_setting in reliability_settings:
        ResiliNet_acc = average(output["ResiliNet"][str(reliability_setting)])
        deepFogGuard_acc = average(
            output["deepFogGuard"][str(reliability_setting)])
        Vanilla_acc = average(output["Vanilla"][str(reliability_setting)])

        output_list.append(
            str(reliability_setting) + " ResiliNet Accuracy: " +
            str(ResiliNet_acc) + '\n')
        output_list.append(
            str(reliability_setting) + " deepFogGuard Accuracy: " +
            str(deepFogGuard_acc) + '\n')
        output_list.append(
            str(reliability_setting) + " Vanilla Accuracy: " +
            str(Vanilla_acc) + '\n')

        print(str(reliability_setting), "ResiliNet Accuracy:", ResiliNet_acc)
示例#2
0
                                hyperconnection_weight,
                                no_information_flow_map,
                                reliability_setting,
                                output_list,
                                training_labels=training_labels,
                                test_data=test_data,
                                test_labels=test_labels)
                # clear session so that model will recycled back into memory
                K.clear_session()
                gc.collect()
                del hyperconnection_weight

# calculate average accuracies
    for reliability_setting in reliability_settings:
        for weight_scheme in weight_schemes:
            hyperconnection_weight_acc = average(
                output[model_name][weight_scheme][str(reliability_setting)])
            output_list.append(
                str(reliability_setting) + str(weight_scheme) + " " +
                model_name + ": " + str(hyperconnection_weight_acc) + '\n')
            print(str(reliability_setting), weight_scheme, model_name, ":",
                  hyperconnection_weight_acc)

            hyperconnection_weight_std = np.std(
                output[model_name][weight_scheme][str(reliability_setting)],
                ddof=1)
            output_list.append(
                str(reliability_setting) + str(weight_scheme) + " " +
                model_name + " std: " + str(hyperconnection_weight_std) + '\n')
            print(str(reliability_setting), weight_scheme, model_name, "std:",
                  hyperconnection_weight_std)
    write_n_upload(output_name, output_list, use_GCP)
                            model,
                            no_information_flow_map[tuple(
                                skip_hyperconnection_configuration)],
                            reliability_setting,
                            output_list,
                            training_labels=training_labels,
                            test_data=test_data,
                            test_labels=test_labels)
            # clear session so that model will recycled back into memory
            K.clear_session()
            gc.collect()
            del model

    for reliability_setting in reliability_settings:
        for skip_hyperconnection_configuration in skip_hyperconnection_configurations:
            output_list.append(str(reliability_setting) + '\n')
            acc = average(output[model_name][str(reliability_setting)][str(
                skip_hyperconnection_configuration)])
            std = np.std(output[model_name][str(reliability_setting)][str(
                skip_hyperconnection_configuration)],
                         ddof=1)
            output_list.append(
                str(reliability_setting) +
                str(skip_hyperconnection_configuration) + str(acc) + '\n')
            output_list.append(
                str(reliability_setting) +
                str(skip_hyperconnection_configuration) + str(std) + '\n')
            print(str(reliability_setting), acc)
            print(str(reliability_setting), std)
    write_n_upload(output_name, output_list, use_GCP)
    print(output)
示例#4
0
                                no_information_flow_map,
                                reliability_setting,
                                output_list,
                                training_labels=training_labels,
                                test_data=test_data,
                                test_labels=test_labels)
                # clear session so that model will recycled back into memory
                K.clear_session()
                gc.collect()
                del model

    for reliability_setting in reliability_settings:
        for weight_scheme in weight_schemes:
            output_list.append(
                str(reliability_setting) + str(weight_scheme) + '\n')
            acc = average(
                output[model_name][weight_scheme][str(reliability_setting)])
            output_list.append(
                str(reliability_setting) + str(weight_scheme) + str(acc) +
                '\n')
            print(str(reliability_setting), weight_scheme, acc)

            std = np.std(
                output[model_name][weight_scheme][str(reliability_setting)],
                ddof=1)
            output_list.append(
                str(reliability_setting) + str(weight_scheme) + str(std) +
                '\n')
            print(str(reliability_setting), weight_scheme, std)
    write_n_upload(output_name, output_list, use_GCP)
    print(output)
                                          1] = calculateExpectedAccuracy(
                                              ResiliNet_failout_rate_fixed,
                                              no_information_flow_map,
                                              reliability_setting,
                                              output_list,
                                              training_labels=training_labels,
                                              test_data=test_data,
                                              test_labels=test_labels)
            # clear session so that model will recycled back into memory
            K.clear_session()
            gc.collect()
            del ResiliNet_failout_rate_fixed

    # calculate average accuracies for variable failout rate
    for reliability_setting in reliability_settings:
        ResiliNet_failout_rate_acc = average(
            output["Variable Failout 1x"][str(reliability_setting)])
        output_list.append(
            str(reliability_setting) + " Variable Failout 1x: " +
            str(ResiliNet_failout_rate_acc) + '\n')
        print(reliability_setting, "Variable Failout 1x:",
              ResiliNet_failout_rate_acc)

        ResiliNet_failout_rate_std = np.std(
            output["Variable Failout 1x"][str(reliability_setting)], ddof=1)
        output_list.append(
            str(reliability_setting) + " Variable Failout 1x std: " +
            str(ResiliNet_failout_rate_std) + '\n')
        print(str(reliability_setting), " Variable Failout 1x std:",
              ResiliNet_failout_rate_std)
    # calculate average accuracies for fixed failout rate
    for failout_survival_setting in failout_survival_settings:
示例#6
0
            calc_accuracy(iteration, "ResiliNet", ResiliNet,
                          ResiliNet_no_information_flow_map,
                          reliability_setting, output_list, test_generator,
                          num_test_examples)
            # calc_accuracy(iteration, "deepFogGuard", deepFogGuard, deepFogGuard_no_information_flow_map, reliability_setting, output_list,test_generator, num_test_examples)
            # calc_accuracy(iteration, "Vanilla", Vanilla, Vanilla_no_information_flow_map, reliability_setting, output_list,test_generator, num_test_examples)

        # clear session so that model will recycled back into memory
        K.clear_session()
        gc.collect()
        # del deepFogGuard
        del ResiliNet
        # del Vanilla
# calculate average accuracies from all expected accuracies
    for reliability_setting in reliability_settings:
        ResiliNet_acc = average(output["ResiliNet"][str(reliability_setting)])
        # deepFogGuard_acc = average(output["deepFogGuard"][str(reliability_setting)])
        # Vanilla_acc = average(output["Vanilla"][str(reliability_setting)])

        ResiliNet_std = np.std(output["ResiliNet"][str(reliability_setting)],
                               ddof=1)
        # deepFogGuard_std = np.std(output["deepFogGuard"][str(reliability_setting)],ddof = 1)
        # Vanilla_std = np.std(output["Vanilla"][str(reliability_setting)],ddof = 1)

        output_list.append(
            str(reliability_setting) + " ResiliNet Accuracy: " +
            str(ResiliNet_acc) + '\n')
        # output_list.append(str(reliability_setting) + " deepFogGuard Accuracy: " + str(deepFogGuard_acc) + '\n')
        # output_list.append(str(reliability_setting) + " Vanilla Accuracy: " + str(Vanilla_acc) + '\n')

        output_list.append(