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

EvaluativeListener onEpochStart/onEpochEnd not called #4798

Closed
emmx opened this issue Mar 13, 2018 · 2 comments

Comments

@emmx
Copy link

commented Mar 13, 2018

EvaluativeListener onEpochStart/onEpochEnd is not called when using earlyStoppingTrainer.fit(), only when calling network.fit(datasetIterator) directly.

Tested on v0.9.1

This is what I did temporarily:

EarlyStoppingTrainer trainer = new EarlyStoppingTrainer(esConfig, network, train);
trainer.setListener(new EarlyStoppingListener<MultiLayerNetwork>() {

    @Override
    public void onStart(EarlyStoppingConfiguration<MultiLayerNetwork> esConfig, MultiLayerNetwork net) {
        for (IterationListener listener : net.getListeners()) {
            if (listener instanceof TrainingListener) {
                ((TrainingListener) listener).onEpochStart(net);
            }
        }
    }

    @Override
    public void onEpoch(int epochNum, double score, EarlyStoppingConfiguration<MultiLayerNetwork> esConfig, MultiLayerNetwork net) {
        for (IterationListener listener : net.getListeners()) {
            if (listener instanceof TrainingListener) {
                ((TrainingListener) listener).onEpochEnd(net);
            }
        }
    }

    @Override
    public void onCompletion(EarlyStoppingResult<MultiLayerNetwork> esResult) {

    }

});

trainer.fit();

@AlexDBlack AlexDBlack self-assigned this Mar 16, 2018

AlexDBlack added a commit that referenced this issue Mar 16, 2018
AlexDBlack added a commit that referenced this issue Mar 16, 2018
Merge pull request #4807 from deeplearning4j/ab_4798_earlystop_listeners
#4798 Fix training listener epoch method calling for early stopping
@AlexDBlack

This comment has been minimized.

Copy link
Contributor

commented Mar 16, 2018

Thanks for the issue - fixed and tested here: #4807

@lock

This comment has been minimized.

Copy link

commented Sep 23, 2018

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked and limited conversation to collaborators Sep 23, 2018

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
2 participants
You can’t perform that action at this time.