update weights by a file