DMGI
DMGI copied to clipboard
What is the purpose of the variable 'patience'?
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.