rewrite dataset.cpp and dataset.h and changeed the related code in model.cpp