fix bug in DeepEncoder