How to make our model accuracy and loss reproducible

Is there a way to make our model accuracy, loss reproducible.

The accuracy and loss across each epoch and also the final accuracy and loss of the model

Initialize the seed (torch.manual_seed()) to some constant value.

This way, any “random” weight initialization will be the same between runs (and dataset shuffling etc).

Of course, you have to take care of any other library that has any randomness inside (numpy, random etc.) and is used inside your notebook.