Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reproducing classifier accuracy on learned codes #1

Open
Pibborn opened this issue Aug 16, 2019 · 0 comments
Open

Reproducing classifier accuracy on learned codes #1

Pibborn opened this issue Aug 16, 2019 · 0 comments

Comments

@Pibborn
Copy link

Pibborn commented Aug 16, 2019

Hi,

thank you for releasing the code for your paper! It makes things a lot easier for other researchers in the same area.

I have a question about reproducing your paper's experimental results on the adult dataset. I have run the experimental_script.sh script and obtained a couple of new folders:

  • out_params containing tf checkpoints and models
  • out_evals containing a number of .z files which, to the best of my understanding, contain the learned codes and associated labels corresponding to the sensible parameter c. Each file has a name such as [...]/inv-rep/out_evals/adult/l0.0001_b0.01_d30/test/grid_navib_epoch[num_epochs]_z_and_c.z.

Now, would my script below be a reasonable way to reproduce your results as far as the "adversarial loss" (i.e. a supervised classifier's accuracy on the codes when trying to predict the sensible attribute) is concerned?

import joblib
import sklearn
from sklearn.linear_model import LogisticRegression
from sklearn.metrics import accuracy_score

z_test, s_test = joblib.load('../out_evals/adult/l0.0001_b0.01_d30/test/grid_navib_epoch500_z_and_c.z')
z_val, s_val = joblib.load('../out_evals/adult/l0.0001_b0.01_d30/val/grid_navib_epoch500_z_and_c.z')
z_train, s_train = joblib.load('../out_evals/adult/l0.0001_b0.01_d30/train/grid_navib_epoch500_z_and_c.z')

model = LogisticRegression() # or any other model for that matter
model.fit(z_train, s_train)
s_pred = model.predict(z_test)
print(accuracy_score(s_test, s_pred))

Thank you kindly!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant