Abstract Encoder