fix layerwised trainer, remove a bug when loading from disk