lmoroney / dlaicourse

Notebooks for learning deep learning
5.66k stars 5.38k forks source link

Course 1 - Part 4 - Lesson 2 - Notebook.ipynb Exercise 8 #168

Closed CupOfGeo closed 3 years ago

CupOfGeo commented 3 years ago

def on_epoch_end(self, epoch, logs={}): if(logs.get('loss')<0.4): print("\nReached 60% accuracy so cancelling training!") self.model.stop_training = True

Im new but shouldn't it be accuracy? something like this?

def on_epoch_end(self, epoch, logs={}): if(logs.get('accuracy') > 0.85): print("\nReached 85% accuracy so cancelling training!") self.model.stop_training = True

with the metrics added to the compile line model.compile(optimizer='adam',loss='sparse_categorical_crossentropy',metrics=['accuracy'])

edit lol just watched the next video shouldn't it just say print("\nReached loss < 0.4 so cancelling training!")