Why not use the `encode` and `decode` methods from autoencoders? It would make things more generic.