AutoResearch / EEG-GAN

Other
19 stars 1 forks source link

DoubleAutoencoder not working #47

Closed chadcwilliams closed 12 months ago

chadcwilliams commented 1 year ago

The double autoencoder doesn't seem to be working.

I did a test with two electrodes running the single autoencoder with channels_out=1 (leaving timeseries at 100 datapoints) and the double autoencoder with channels_out=1 and timeseries_out=100 (so, condensing to the same degree) and get quite different results.

This is the single autoencoder: Screenshot_2023-09-08 23_04_55

This is the double autoencoder: Screenshot_2023-09-08 23_38_04

In the double autoencoder you can see that it is doing something, but the reconstructed data looks like the average of all the samples, rather than individual samples reconstructed. They were trained with the same number of epochs (200). With that said, the although timeseries_out in the double autoencoder equals the number of datapoints, this still adds labour to the autoencoder, so maybe it needs more epochs. I am running a very long (10000 epochs) training session to see if it does eventually work now.

I'll update if this does end up working.

chadcwilliams commented 1 year ago

I have confirmed it does not work. This is after 8000 epochs. Screenshot_2023-09-09 16_56_48

whyhardt commented 12 months ago

The only difference between these two was the activation function. I've added the possibility to change that with the keyword activation=.. Please try activation=sigmoid That one was used in the single-AE

whyhardt commented 12 months ago

Anyways, I wouldn't use the Double-AE for only channel-encoding but rather do full-encoding. Did you try that on this 2D-data?

PS: I've added timeseries encoding which doesn't touch the channels which should be used for 1D-timeseries (to avoid using unnecessarily the double-AE due to its number of parameters) Timeseries encoding can be activated with target=time timeseries_out=..

chadcwilliams commented 12 months ago

Yeah, I am just using the Double-AE in this way to see if it can work as the Single-AE does. I wouldn't do this in actual practice. Testing the activation now.

I will also do a similar test where I compare the Single-AE with target time and mimic only a time reduction in the Double-AE.

chadcwilliams commented 12 months ago

Daniel's last commit fixed this! Well done @whyhardt!