I understand that you want to stop the training of the network.
Refer the following link which has already answered to the similar query.
In addition, you can refer to the documentation link on “trainingOptions” to stop the training of the network.
Link 2: trainingOptions