Allow for user-defined output layers in encoding and decoding models