Add prefix argument to save weights streaming to disk for off-line loss calculation