annahdo / counterfactuals

Apache License 2.0
12 stars 2 forks source link

Toy Example with High Dimensional Data #3

Closed leekwoon closed 8 months ago

leekwoon commented 8 months ago

Hi,

I am currently working with data that has about 1000 dimensions and I'm interested in testing your work. Is it possible to apply your approach to non-image, high-dimensional data? If so, I would like to modify your RealNVP in the toy_example.ipynb. Could you provide some guidance on how to make these modifications?

annahdo commented 8 months ago

Hi leekwoon,

yes, in general it is possible to use generative models with non-image data and hence also our approach to finding counterfactuals. I'm not sure if RealNVP is your best option here though.

My toy model setup is very simple and only has 3 dimensions. I would recommend you look into the PyTorch implementation of RealNVP and modify from there. You do need a classifier as well and then just calculate gradients of the classifier output wrt to the input of your generative model.

Best

leekwoon commented 8 months ago

Thank you for your advice. I understand that RealNVP might not be the best option for my high-dimensional, non-image data. Do you have any recommendations for a starting point or alternative approaches that might be more suitable for this case?

annahdo commented 8 months ago

RealNVP was one of the first normalizing flow approaches. Glow worked a lot better for our image data. But there also has been more development for normalizing flows. You could check this repo for some inspiration.

If you do not need your generative model to be a normalizing flow, GANs might offer better an even broader selection. If I was you I'd also check which kind of generative models were previously used on data that is similar to what you have and then maybe modify from there.

Best