mia_on_model_distillation/one_run_audit/plot.py

21 lines
615 B
Python

import numpy as np
import matplotlib.pyplot as plt
from tqdm import tqdm
from equations import get_eps_audit
delta = 1e-5
p_value = 0.05
x_values = np.floor((1.5)**np.arange(30)).astype(int)
x_values = np.concatenate([x_values[x_values < 60000], [60000]])
y_values = [get_eps_audit(x, x, x, delta, p_value) for x in tqdm(x_values)]
plt.xscale('log')
plt.plot(x_values, y_values, marker='o')
plt.xlabel("Number of samples guessed correctly")
plt.ylabel("ε value audited")
plt.title("Maximum possible ε from audit")
# 5. Save the plot as a PNG
plt.savefig("/dev/shm/my_plot.png", dpi=300, bbox_inches='tight')