Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

early_stopping does not work as expected #2089

Closed
5tinzi opened this issue Oct 18, 2022 · 1 comment
Closed

early_stopping does not work as expected #2089

5tinzi opened this issue Oct 18, 2022 · 1 comment
Labels

Comments

@5tinzi
Copy link

5tinzi commented Oct 18, 2022

Package Version

Flux v0.13.6

Julia Version

julia v1.7

OS / Environment

macOS 12.1 21C52 x86_64

Describe the bug

Flux has a function for early stopping, as describes in the documents page here: Utility Functions · Flux

For example, you can use early_stopping to stop training when the model is converging or deteriorating

By default distance is `-`, which implies that the monitored metric f is expected to be decreasing and minimized. 

But actually, the early_stop function will stop the train even if the loss is keeping decreasing!

Steps to Reproduce

julia> loss = let l = 10
         () -> l -= 1
       end; # NOTICE this loss function that returns decreasing values
julia> es = Flux.early_stopping(loss, 3);
julia> for i in 1:10
         @info "Epoch $i"
         es() && break
       end
[ Info: Epoch 1
[ Info: Epoch 2
[ Info: Epoch 3

Expected Results

the training won't be stop if the loss is keeping decreasing.

Observed Results

the training step was stop even the loss is keeping decreasing.

Relevant log output

No response

@5tinzi 5tinzi added the bug label Oct 18, 2022
@5tinzi
Copy link
Author

5tinzi commented Oct 19, 2022

Close. Because this is not an bug.
a init_score needs to be specified and the default is 0, which is not always the case.
Sorry for my misunderstanding.

@5tinzi 5tinzi closed this as completed Oct 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant