add encoder and decoder, finish feature generation.