fix bugs in pretrain,and fixing bugs in ann train