class_docstr: Parent class for deepchem Tensorflow models.
  
  Classifier:
    n_classes
  
  Has the following attributes:
  
    placeholder_root: String placeholder prefix, used to create
      placeholder_scope.
  
  Generic base class for defining, training, and evaluating TensorflowGraphs.
  
  Subclasses must implement the following methods:
    build
    add_output_ops
    add_training_cost 
  
  Args:
    train: If True, model is in training mode.
    logdir: Directory for output files.
class_docstr_tok: ["Parent","class","for","deepchem","Tensorflow","models",".","Classifier",":","n_classes","Has","the","following","attributes",":","placeholder_root",":","String","placeholder","prefix",",","used","to","create","placeholder_scope",".","Generic","base","class","for","defining",",","training",",","and","evaluating","TensorflowGraphs",".","Subclasses","must","implement","the","following","methods",":","build","add_output_ops","add_training_cost","Args",":","train",":","If","True",",","model","is","in","training","mode",".","logdir",":","Directory","for","output","files","."]
docstr: Constructs the computational graph.
  
  This function constructs the computational graph for the model. It relies
  subclassed methods (build/cost) to construct specific graphs.
  
  Parameters
  ----------
  n_tasks: int
    Number of tasks
  n_features: int
    Number of features.
  logdir: str
    Location to save data
  layer_sizes: list
    List of layer sizes.
  weight_init_stddevs: list
    List of standard deviations for weights (sampled from zero-mean
    gaussians). One for each layer.
  bias_init_consts: list
    List of bias initializations. One for each layer.
  penalty: float
    Amount of penalty (l2 or l1 applied)
  penalty_type: str
    Either "l2" or "l1"
  dropouts: list
    List of dropout amounts. One for each layer.
  learning_rate: float
    Learning rate for model.
  momentum: float
    Momentum. Only applied if optimizer=="momentum"
  optimizer: str
    Type of optimizer applied.
  batch_size: int
    Size of minibatches for training.
  n_classes: int
    Number of classes if this is for classification.
    TODO(rbharath): Move this argument to TensorflowClassifier
  verbose: True 
    Perform logging.
  seed: int
    If not none, is used as random seed for tensorflow. 
docstr_tok: ["Constructs","the","computational","graph",".","This","function","constructs","the","computational","graph","for","the","model",".","It","relies","subclassed","methods","(","build\/cost",")","to","construct","specific","graphs",".","Parameters","--","--","--","--","--","n_tasks",":","int","Number","of","tasks","n_features",":","int","Number","of","features",".","logdir",":","str","Location","to","save","data","layer_sizes",":","list","List","of","layer","sizes",".","weight_init_stddevs",":","list","List","of","standard","deviations","for","weights","(","sampled","from","zero-mean","gaussians",")",".","One","for","each","layer",".","bias_init_consts",":","list","List","of","bias","initializations",".","One","for","each","layer",".","penalty",":","float","Amount","of","penalty","(","l2","or","l1","applied",")","penalty_type",":","str","Either","``","l2","''","or","``","l1","''","dropouts",":","list","List","of","dropout","amounts",".","One","for","each","layer",".","learning_rate",":","float","Learning","rate","for","model",".","momentum",":","float","Momentum",".","Only","applied","if","optimizer==","''","momentum","''","optimizer",":","str","Type","of","optimizer","applied",".","batch_size",":","int","Size","of","minibatches","for","training",".","n_classes",":","int","Number","of","classes","if","this","is","for","classification",".","TODO","(","rbharath",")",":","Move","this","argument","to","TensorflowClassifier","verbose",":","True","Perform","logging",".","seed",":","int","If","not","none",",","is","used","as","random","seed","for","tensorflow","."]
code: def __init__(
      self,
      n_tasks,
      n_features,
      logdir=None,
      layer_sizes=[1000],
      weight_init_stddevs=[0.02],
      bias_init_consts=[1.0],
      penalty=0.0,
      penalty_type="l2",
      dropouts=[0.5],
      learning_rate=0.001,
      momentum=0.9,
      optimizer="adam",
      batch_size=50,
      n_classes=2,
      pad_batches=False,
      verbose=True,
      seed=None,
      **kwargs,
  ):
      """Constructs the computational graph.
  
      This function constructs the computational graph for the model. It relies
      subclassed methods (build/cost) to construct specific graphs.
  
      Parameters
      ----------
      n_tasks: int
        Number of tasks
      n_features: int
        Number of features.
      logdir: str
        Location to save data
      layer_sizes: list
        List of layer sizes.
      weight_init_stddevs: list
        List of standard deviations for weights (sampled from zero-mean
        gaussians). One for each layer.
      bias_init_consts: list
        List of bias initializations. One for each layer.
      penalty: float
        Amount of penalty (l2 or l1 applied)
      penalty_type: str
        Either "l2" or "l1"
      dropouts: list
        List of dropout amounts. One for each layer.
      learning_rate: float
        Learning rate for model.
      momentum: float
        Momentum. Only applied if optimizer=="momentum"
      optimizer: str
        Type of optimizer applied.
      batch_size: int
        Size of minibatches for training.
      n_classes: int
        Number of classes if this is for classification.
        TODO(rbharath): Move this argument to TensorflowClassifier
      verbose: True
        Perform logging.
      seed: int
        If not none, is used as random seed for tensorflow.
      """
      # Save hyperparameters
      self.n_tasks = n_tasks
      self.n_features = n_features
      self.layer_sizes = layer_sizes
      self.weight_init_stddevs = weight_init_stddevs
      self.bias_init_consts = bias_init_consts
      self.penalty = penalty
      self.penalty_type = penalty_type
      self.dropouts = dropouts
      self.learning_rate = learning_rate
      self.momentum = momentum
      self.optimizer = optimizer
      self.batch_size = batch_size
      self.n_classes = n_classes
      self.pad_batches = pad_batches
      self.verbose = verbose
      self.seed = seed
  
      if logdir is not None:
          if not os.path.exists(logdir):
              os.makedirs(logdir)
      else:
          logdir = tempfile.mkdtemp()
      self.logdir = logdir
  
      # Guard variable to make sure we don't Restore() this model
      # from a disk checkpoint more than once.
      self._restored_model = False
      # Path to save checkpoint files, which matches the
      # replicated supervisor's default path.
      self._save_path = os.path.join(logdir, "model.ckpt")
  
      self.train_graph = self.construct_graph(
          training=True, seed=self.seed
      )
      self.eval_graph = self.construct_graph(
          training=False, seed=self.seed
      )
  
imports: from __future__ import print_function
  from __future__ import division
  from __future__ import unicode_literals
  import collections
  import pickle
  import os
  import time
  import warnings
  import numpy
  import pandas
  import tensorflow
  import tempfile
  from deepchem.models import Model
  from deepchem.metrics import from_one_hot
  from deepchem.nn import model_ops
  from deepchem.models.tensorflow_models import utils
  from deepchem.trans import undo_transforms
  from deepchem.utils.save import log
  from deepchem.utils.evaluate import Evaluator
  from deepchem.data import pad_features
  from tensorflow.contrib.layers.python.layers import batch_norm
label_desc: Use image node_id 1 to create a new TensorflowGraphModel object from inherited base classes: Model with example: obj = TensorflowGraphModel(n_tasks, n_features, logdir, layer_sizes, weight_init_stddevs, bias_init_consts, penalty, penalty_type, dropouts, learning_rate, momentum, optimizer, batch_size, n_classes, pad_batches, verbose, seed)