clementchadebec / benchmark_VAE

Unifying Variational Autoencoder (VAE) implementations in Pytorch (NeurIPS 2022)
Apache License 2.0
1.77k stars 161 forks source link

How do set y neq x #143

Open bentoayr opened 4 months ago

bentoayr commented 4 months ago

Hello, I am trying to build a denoising auto encoder. Is there a way to make the target data be different from the input data? In particular, I want the input data to be noisy and the target data to be clean data. In math, instead of having min_f L(x,f(x)) for some loss function I want to have min_f L(x,f(x + noise))? Cheers !

clementchadebec commented 1 month ago

Hello, sorry for the late reply. To do this you will need to amend a bit the implementation of the models themselves. The easiest way to do so is to fork this repo and installing it in editable model running

pip install -e .

Then you can amend the forward function so that the noisy data and clean data can be obtained from your datasets.

https://github.com/clementchadebec/benchmark_VAE/blob/bb785deb30ebd938a2c23620e99eb75c101fb2b6/src/pythae/models/vae/vae_model.py#L65-L87

I hope this helps,

Best,

Clément