privML / privacy-evaluator

The privML Privacy Evaluator is a tool that assesses ML model's levels of privacy by running different attacks on it.
MIT License
17 stars 17 forks source link

Privacy risk score in slicing #211

Closed Erdnaf closed 3 years ago

Erdnaf commented 3 years ago

closes #199

Erdnaf commented 3 years ago

Hey i added some code to plot the data. histogram_distribution is for Ploting whihtiin the slices and histogram_slices for the summary of all slices

histogram_slices actualy does not use any variables of the object, so you can also call it independent from them. Maybe move that to a helper function and not call whition the object?

budmil commented 3 years ago

I think it would be more consistent to keep it this way. Also, logically it makes sense.

jtorhoff commented 3 years ago

I'm not sure how to implement it with the way slicing is working now through the MembershipInferenceAttackAnalysis.

Erdnaf commented 3 years ago

I imagined that when computing the slcices you call histogram_distribution on the output to get the histogram drawn for each slice. and wehnn all the slices are computed there is histogram_slices called with the avereges of each slice (has to be computed) and the slice names. If something is unclear we can also colaborate on this just message me

jtorhoff commented 3 years ago

I put some ✨ finishing touches ✨ and fixed the plots. @Erdnaf should we merge so that others don't have to wait bc of notebooks?

Erdnaf commented 3 years ago

Hey great work! I Just made some last small changes. I think the progress can be merged if one other person reviews 😁

jtorhoff commented 3 years ago

So what happened is that the code of team2 was also loaded and the line from tqdm.contrib.logging import logging_redirect_tqdm didn't work for me. But nevertheless, it doen't have anything to do with your code and it seems I am the only person who has this problem, so never mind.

I'm curious what the exact error was? Maybe you can run pip install -e . again. I think I needed it too when tqdm was added as a dependency.

I just had a problem with an import in the notebook. It seems that whenever we do something like import privacy_evaluator.[...] in the notebooks the whole codebase is loaded. It has something to do with our importing in the __init__ files. It seems that we still don't do it the right way 😢

This actually might be common and normal but I'm not sure. I think I've noticed several times myself when I import torch or tensorflow the import statement alone might take a while to execute.