Flair: Early Stopping

Created on 4 Jul 2019  路  3Comments  路  Source: flairNLP/flair

How can I implement early stopping. I'm working on NER and after a particular epoch the loss stops to decrease there I want to apply early stop. Kindly help me out.

question

Most helpful comment

Perhaps we should add the stopping criterion as a parameter, i.e. let users specify at which point the learning rate becomes to small.

All 3 comments

Hi @Aditya715, by default flair uses an early stopping mechanism:

https://github.com/zalandoresearch/flair/blob/603970af3d393721a80426a69159ce0c61b3a468/flair/optim.py#L283

Reduce learning rate and weight decay when a metric has stopped improving.

So when a learning rate of < 0.0001 is reached, training will be stopped :)

I hope this helps!

Perhaps we should add the stopping criterion as a parameter, i.e. let users specify at which point the learning rate becomes to small.

Closed by PR #871 - thanks again @stefan-it!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

aschmu picture aschmu  路  3Comments

stefan-it picture stefan-it  路  3Comments

mittalsuraj18 picture mittalsuraj18  路  3Comments

shoarora picture shoarora  路  3Comments

happypanda5 picture happypanda5  路  3Comments