docstr: Saves model when validation loss decreases.
docstr_tok: ["Saves","model","when","validation","loss","decreases","."]
code: def save_checkpoint(self, model):
      """Saves model when validation loss decreases."""
      torch.save(model.state_dict(), self.filename)
  
imports: import datetime
  import errno
  import os
  import pickle
  import random
  from pprint import pprint
  import dgl
  import numpy
  import torch
  from dgl.data.utils import _get_dgl_url, download, get_download_dir
  from scipy import io, sparse
label_desc: Use image node_id 3 for calling the EarlyStopping obj's underlying member method code with example usage: obj.save_checkpoint(model) without return types