Replace Framework.py
Added .final_gradients attribute to the dataset class, automatically stores gradients of last traning iteration. additionally build to_np_arr function, such that saved parameter history and gradients are stored as np array, and do not block device memory