Git Product home page Git Product logo

inv-rep's Introduction

Invariant Representations without Adversaries

This was a repo of demonstration code for Invariant Representations Without Adversarial Training, a paper in NIPS 2018.

Please excuse the structure and composition of this code; it's just a demo.

I have since written a tutorial in Keras, held in this other repo, and a corresponding blog post held here. In my opinion, this other repository is much cleaner.

inv-rep's People

Contributors

dcmoyer avatar

Stargazers

Keng Hou Leong (Jinghao Liang) avatar Yu Wang avatar  avatar lijx avatar HappyColor avatar Tianci Liu avatar  avatar Sophia Sun avatar 刘凯鑫 avatar Yao Qiang avatar Xinjie Zhang avatar Liu Ji avatar Peiqi (Mark) Wang avatar Tianhang Zheng avatar  avatar Dong Shuai avatar Rusty Mina avatar An Lijun avatar Umang Gupta avatar  avatar Igor Morawski avatar JWC avatar sriharsha annamaneni avatar Isay Katsman avatar Greg Ver Steeg avatar Slice avatar NIck avatar 爱可可-爱生活 avatar Prince avatar Samuel Helms avatar Congzheng Song avatar  avatar Ethan Caballero avatar

Watchers

James Cloos avatar paper2code - bot avatar

inv-rep's Issues

Reproducing classifier accuracy on learned codes

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!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.