class_docstr: Implements the Model-Agnostic Meta-Learning algorithm for low data learning.
  
  The algorithm is described in Finn et al., "Model-Agnostic Meta-Learning for Fast
  Adaptation of Deep Networks" (https://arxiv.org/abs/1703.03400).  It is used for
  training models that can perform a variety of tasks, depending on what data they
  are trained on.  It assumes you have training data for many tasks, but only a small
  amount for each one.  It performs "meta-learning" by looping over tasks and trying
  to minimize the loss on each one *after* one or a few steps of gradient descent.
  That is, it does not try to create a model that can directly solve the tasks, but
  rather tries to create a model that is very easy to train.
  
  To use this class, create a subclass of MetaLearner that encapsulates the model
  and data for your learning problem.  Pass it to a MAML object and call fit().
  You can then use train_on_current_task() to fine tune the model for a particular
  task.
class_docstr_tok: ["Implements","the","Model-Agnostic","Meta-Learning","algorithm","for","low","data","learning",".","The","algorithm","is","described","in","Finn","et","al.",",","``","Model-Agnostic","Meta-Learning","for","Fast","Adaptation","of","Deep","Networks","''","(","https",":","\/\/arxiv.org\/abs\/1703.03400",")",".","It","is","used","for","training","models","that","can","perform","a","variety","of","tasks",",","depending","on","what","data","they","are","trained","on",".","It","assumes","you","have","training","data","for","many","tasks",",","but","only","a","small","amount","for","each","one",".","It","performs","``","meta-learning","''","by","looping","over","tasks","and","trying","to","minimize","the","loss","on","each","one","*","after","*","one","or","a","few","steps","of","gradient","descent",".","That","is",",","it","does","not","try","to","create","a","model","that","can","directly","solve","the","tasks",",","but","rather","tries","to","create","a","model","that","is","very","easy","to","train",".","To","use","this","class",",","create","a","subclass","of","MetaLearner","that","encapsulates","the","model","and","data","for","your","learning","problem",".","Pass","it","to","a","MAML","object","and","call","fit","(",")",".","You","can","then","use","train_on_current_task","(",")","to","fine","tune","the","model","for","a","particular","task","."]
docstr: Compute the model's outputs for a batch of inputs.
  
  Parameters
  ----------
  inputs: list of arrays
      the inputs to the model
  
  Returns
  -------
  (loss, outputs) where loss is the value of the model's loss function, and
  outputs is a list of the model's outputs
docstr_tok: ["Compute","the","model","'s","outputs","for","a","batch","of","inputs",".","Parameters","--","--","--","--","--","inputs",":","list","of","arrays","the","inputs","to","the","model","Returns","--","--","--","-","(","loss",",","outputs",")","where","loss","is","the","value","of","the","model","'s","loss","function",",","and","outputs","is","a","list","of","the","model","'s","outputs"]
code: def predict_on_batch(self, inputs):
      """Compute the model's outputs for a batch of inputs.
  
      Parameters
      ----------
      inputs: list of arrays
          the inputs to the model
  
      Returns
      -------
      (loss, outputs) where loss is the value of the model's loss function, and
      outputs is a list of the model's outputs
      """
      return self.learner.compute_model(
          inputs, self.learner.variables, False
      )
  
file_path: deepchem/deepchem/metalearning/maml.py
imports: import os
  import shutil
  import tempfile
  import time
  import tensorflow
  from deepchem.models.optimizers import Adam, GradientDescent
label_desc: Use image node_id 7 for calling the MAML obj's underlying member method code with example usage: obj.predict_on_batch(inputs) and returns: self