parameters: (name, mode, hparams, vocab=None)
docstring: Constructs a Model from the given module.
  
    Args:
      name: Model name (same as the module that defines it).
      mode: Either 'train' or 'eval'.
      hparams: Hyperparameters.
      vocab: Path to vocabulary file (required for tree models).
  
    Returns:
      kind: Either 'sequence', 'tree', or 'fast'.
      model: If kind=='sequence', a Model class with conjecture embedding,
          axiom_embedding, and classifier functions.  conjecture_embedding and
          axiom_embedding both take pre-embedded sequences.  If kind=='tree', a
          function mapping a batch of ProverClauseExamples to logits, labels.
          If kind=='fast', a function mapping a jagged tensor of conjecture
          clauses and clause to logits.
  
    Raises:
      ValueError: If the model name doesn't exist.
docstring_summary: Constructs a Model from the given module.
docstring_tokens: Constructs a Model from the given module .
function: def make_model(name, mode, hparams, vocab=None):
    """Constructs a Model from the given module.
  
    Args:
      name: Model name (same as the module that defines it).
      mode: Either 'train' or 'eval'.
      hparams: Hyperparameters.
      vocab: Path to vocabulary file (required for tree models).
  
    Returns:
      kind: Either 'sequence', 'tree', or 'fast'.
      model: If kind=='sequence', a Model class with conjecture embedding,
          axiom_embedding, and classifier functions.  conjecture_embedding and
          axiom_embedding both take pre-embedded sequences.  If kind=='tree', a
          function mapping a batch of ProverClauseExamples to logits, labels.
          If kind=='fast', a function mapping a jagged tensor of conjecture
          clauses and clause to logits.
  
    Raises:
      ValueError: If the model name doesn't exist.
    """
    if name in ALL_MODELS:
      module = model_module(name)
      tf.logging.info('Creating model %s', name)
      if hasattr(module, 'Model'):
        return 'sequence', module.Model(mode=mode, hparams=hparams)
      elif hasattr(module, 'loom_model'):
        return 'tree', functools.partial(module.loom_model, vocab=vocab,
                                         hparams=hparams, mode=mode)
      elif hasattr(module, 'fast_model'):
        return 'fast', functools.partial(
            module.fast_model, vocab=vocab, hparams=hparams, mode=mode)
      else:
        raise ValueError("Can't determine kind of model '%s'" % name)
    elif name in PREMISE_MODELS:
      return 'sequence', PREMISE_MODELS[name].Model(tf.get_default_graph())
    else:
      raise ValueError("Unknown model '%s'" % name)
function_tokens: def make_model ( name , mode , hparams , vocab = None ) : if name in ALL_MODELS : module = model_module ( name ) tf . logging . info ( 'Creating model %s' , name ) if hasattr ( module , 'Model' ) : return 'sequence' , module . Model ( mode = mode , hparams = hparams ) elif hasattr ( module , 'loom_model' ) : return 'tree' , functools . partial ( module . loom_model , vocab = vocab , hparams = hparams , mode = mode ) elif hasattr ( module , 'fast_model' ) : return 'fast' , functools . partial ( module . fast_model , vocab = vocab , hparams = hparams , mode = mode ) else : raise ValueError ( "Can't determine kind of model '%s'" % name ) elif name in PREMISE_MODELS : return 'sequence' , PREMISE_MODELS [ name ] . Model ( tf . get_default_graph ( ) ) else : raise ValueError ( "Unknown model '%s'" % name )