# Remember to inherit from the correct classclassEarlyStoppingCallback(tf.keras.callbacks.Callback):# Define the correct function signature for on_epoch_end methoddef on_epoch_end(self,epoch,logs=None):# Check if the accuracy is greater or equal to 0.98if logs['accuracy']>=0.98:# Stop training once the above condition is met
self.model.stop_training =Trueprint("\nReached 98% accuracy so cancelling training!")
السؤال
Ali Ahmed55
السلام عليكم
ده الكود
6 أجوبة على هذا السؤال
Recommended Posts
انضم إلى النقاش
يمكنك أن تنشر الآن وتسجل لاحقًا. إذا كان لديك حساب، فسجل الدخول الآن لتنشر باسم حسابك.