// Get a summary writer for the hook to write to tensorboard.
// Can set summary_writer to None if not needed.
if FLAGS.model_dir:
summary_writer = tf.summary.FileWriter(FLAGS.model_dir)
else:
summary_writer = None
mia_hook = MembershipInferenceTrainingHook(
mnist_classifier, (train_data, train_labels), (test_data, test_labels),
After Change
)
att_types, att_slices, att_metrics, att_values = get_flattened_attack_metrics(
attack_results)
print("\n".join([" %s: %.4f" % (", ".join([s, t, m]), v) for t, s, m, v in
zip(att_types, att_slices, att_metrics, att_values)]))