Skip to content

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

@WhItEG-bit

Description

@WhItEG-bit

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions