Skip to content

Commit

Permalink
ok
Browse files Browse the repository at this point in the history
  • Loading branch information
ngrislain committed Dec 25, 2024
1 parent f7d699a commit 18ab4cb
Show file tree
Hide file tree
Showing 5 changed files with 672 additions and 712 deletions.
8 changes: 4 additions & 4 deletions documents/figures/exp_mech.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ def top_k_u(tau: float) -> float:
ax2.plot(taus, np.exp(epsilon*top_k_u(taus)/2), color='tab:orange', linewidth=2)
ax2.set_ylabel(r'$\exp\left(\frac{\epsilon u}{2}\right)$', color='tab:orange')

fig.tight_layout() # Adjust layout to prevent overlap
plt.title(f"Utility and its exponential used in the top-k exponential mechanism (k={top_k})")
# fig.tight_layout() # Adjust layout to prevent overlap
plt.title(f"Utility and pdf used in the top-k exponential mechanism (k={top_k})")
plt.savefig('documents/figures/top-k-exp.svg')

min_score = 0.2
Expand Down Expand Up @@ -56,6 +56,6 @@ def top_p_u(tau: float) -> float:
ax2.plot(taus, np.exp(epsilon*top_p_u(taus)/2), color='tab:orange', linewidth=2)
ax2.set_ylabel(r'$\exp\left(\frac{\epsilon u}{2}\right)$', color='tab:orange')

fig.tight_layout() # Adjust layout to prevent overlap
plt.title(f"Utility and its exponential used in the top-p exponential mechanism (p={top_p})")
# fig.tight_layout() # Adjust layout to prevent overlap
plt.title(rf"Utility and pdf used in the top-p exponential mechanism (p={top_p}, $\alpha$=1)")
plt.savefig('documents/figures/top-p-exp.svg')
Loading

0 comments on commit 18ab4cb

Please sign in to comment.