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

What is the purpose of the variable 'patience'? #12

Open
WhItEG-bit opened this issue Aug 24, 2023 · 0 comments
Open

What is the purpose of the variable 'patience'? #12

WhItEG-bit opened this issue Aug 24, 2023 · 0 comments

Comments

@WhItEG-bit
Copy link

Hello, your work is impressive and has benefited me greatly. I'm a novice in deep learning, and I have some questions about your code.
I noticed that you've set a variable called "patience" in your code, and training stops when the loss increases for 20 consecutive times(parser.add_argument('--patience', type=int, default=20)).

if loss < best:
    best = loss
    cnt_wait = 0
    torch.save(model.state_dict(), 'saved_model/best_{}_{}_{}.pkl'.format(self.args.dataset, self.args.embedder, self.args.metapaths))
else:
    cnt_wait += 1

if cnt_wait == self.args.patience:
    break

Is this strategy reasonable? I haven't come across this in your papers.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant