docstr: Fits model on dataset using cached supports.
  
  For each epcoh, sample n_episodes_per_epoch (support, test) pairs and does
  gradient descent.
  
  Parameters
  ----------
  dataset: dc.data.Dataset
    Dataset to fit model on.
  nb_epochs: int, optional
    number of epochs of training.
  n_episodes_per_epoch: int, optional
    Number of (support, test) pairs to sample and train on per epoch.
  n_pos: int, optional
    Number of positive examples per support.
  n_neg: int, optional
    Number of negative examples per support.
  log_every_n_samples: int, optional
    Displays info every this number of samples
docstr_tok: ["Fits","model","on","dataset","using","cached","supports",".","For","each","epcoh",",","sample","n_episodes_per_epoch","(","support",",","test",")","pairs","and","does","gradient","descent",".","Parameters","--","--","--","--","--","dataset",":","dc.data.Dataset","Dataset","to","fit","model","on",".","nb_epochs",":","int",",","optional","number","of","epochs","of","training",".","n_episodes_per_epoch",":","int",",","optional","Number","of","(","support",",","test",")","pairs","to","sample","and","train","on","per","epoch",".","n_pos",":","int",",","optional","Number","of","positive","examples","per","support",".","n_neg",":","int",",","optional","Number","of","negative","examples","per","support",".","log_every_n_samples",":","int",",","optional","Displays","info","every","this","number","of","samples"]
code: def fit(
      self,
      dataset,
      n_episodes_per_epoch=1000,
      nb_epochs=1,
      n_pos=1,
      n_neg=9,
      log_every_n_samples=10,
      **kwargs,
  ):
      """Fits model on dataset using cached supports.
  
      For each epcoh, sample n_episodes_per_epoch (support, test) pairs and does
      gradient descent.
  
      Parameters
      ----------
      dataset: dc.data.Dataset
        Dataset to fit model on.
      nb_epochs: int, optional
        number of epochs of training.
      n_episodes_per_epoch: int, optional
        Number of (support, test) pairs to sample and train on per epoch.
      n_pos: int, optional
        Number of positive examples per support.
      n_neg: int, optional
        Number of negative examples per support.
      log_every_n_samples: int, optional
        Displays info every this number of samples
      """
      time_start = time.time()
      # Perform the optimization
      n_tasks = len(dataset.get_task_names())
      n_test = self.test_batch_size
  
      feed_total, run_total = 0, 0
      for epoch in range(nb_epochs):
          # Create different support sets
          episode_generator = EpisodeGenerator(
              dataset, n_pos, n_neg, n_test, n_episodes_per_epoch
          )
          recent_losses = []
          for ind, (task, support, test) in enumerate(
              episode_generator
          ):
              if ind % log_every_n_samples == 0:
                  print(
                      "Epoch %d, Sample %d from task %s"
                      % (epoch, ind, str(task))
                  )
              # Get batch to try it out on
              feed_start = time.time()
              feed_dict = self.construct_feed_dict(test, support)
              feed_end = time.time()
              feed_total += feed_end - feed_start
              # Train on support set, batch pair
              run_start = time.time()
              _, loss = self.sess.run(
                  [self.train_op, self.loss_op], feed_dict=feed_dict
              )
              run_end = time.time()
              run_total += run_end - run_start
              if ind % log_every_n_samples == 0:
                  mean_loss = np.mean(np.array(recent_losses))
                  print("\tmean loss is %s" % str(mean_loss))
                  recent_losses = []
              else:
                  recent_losses.append(loss)
      time_end = time.time()
      print("fit took %s seconds" % str(time_end - time_start))
      print("feed_total: %s" % str(feed_total))
      print("run_total: %s" % str(run_total))
  
imports: from __future__ import print_function
  from __future__ import division
  from __future__ import unicode_literals
  import warnings
  import numpy
  import tensorflow
  import sys
  import time
  from deepchem.models import Model
  from deepchem.data import pad_batch
  from deepchem.data import NumpyDataset
  from deepchem.metrics import to_one_hot
  from deepchem.metrics import from_one_hot
  from deepchem.models.tf_new_models.graph_topology import merge_dicts
  from deepchem.nn import model_ops
  from deepchem.data import SupportGenerator
  from deepchem.data import EpisodeGenerator
  from deepchem.data import get_task_dataset
  from deepchem.data import get_single_task_test
  from deepchem.data import get_task_dataset_minus_support
  from deepchem.nn.copy import Input
label_desc: Use image node_id 5 for calling the SupportGraphClassifier obj's underlying member method code with example usage: obj.fit(dataset, n_episodes_per_epoch, nb_epochs, n_pos, n_neg, log_every_n_samples) without return types