Verifying Fixed Randomness

To determine whether randomness is eliminated, you can perform the following verification:

  • After the same model is trained for multiple times, compare the loss of the model with itself. The loss in the first step is the same, and the loss in subsequent steps is slightly different. However, the difference is obviously smaller than that when randomness is not eliminated. For example, if the loss difference is less than 0.001, it can be considered that randomness is eliminated.
  • If the CPU is used for training or deterministic computing training is enabled on the NPU, the loss values of multiple training steps must be the same. If the loss difference is large, there may still be randomness in the network. In this case, you need to check whether the randomness is completely fixed.