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 sys
  import datetime
  import dgl
  import errno
  import numpy
  import os
  import pickle
  import random
  import torch
  from dgl.data.utils import download, get_download_dir, _get_dgl_url
  import os.path
  from pprint import pprint
  from scipy import sparse
  from scipy import io
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