pyod
pyod copied to clipboard
AutoEncoder does not generate a symmetric model
Hi,
I plotted the model when printing the model summary: https://github.com/yzhao062/pyod/blob/da68f50ee79bd74777d2d406cac6dcfad412e599/pyod/models/auto_encoder.py#L187
And it seems that you added an extra layer at the beginning with the same dimension as the input. I don't know why this is required because it would generate an asymmetric model. Here is the model I printed out:
The final dimension would be like 645-645-100-100-500-9-500-100-100-645
.
I think the problem might be caused by this line: https://github.com/yzhao062/pyod/blob/da68f50ee79bd74777d2d406cac6dcfad412e599/pyod/models/auto_encoder.py#L224
The performance is similar after I commented out the above line.
Please correct me if I miss something! Thanks!
Hi there,
Thanks for reporting this issue. I thought I manually added that layer for symmetry purposes but may be redundant (or even detrimental). I know autoencoders are totally fine to be asymmetric and as you said "the difference is minor". I will double check to see whether this layer should be removed.
If sure, you are also welcome to submit a PR to the dev branch for fix this. Thanks,
Yue
Thanks for the feedback, Yue! I also noticed that the reconstructed data is not similar to the original data. I'll double check this ASAP.
I noticed this as well. Would appreciate a fix!