class_docstr: Classification model.
  
  Subclasses must set the following attributes:
    output: logits op(s) used for computing classification loss and predicted
      class probabilities for each task.
class_docstr_tok: ["Classification","model",".","Subclasses","must","set","the","following","attributes",":","output",":","logits","op","(","s",")","used","for","computing","classification","loss","and","predicted","class","probabilities","for","each","task","."]
docstr: Calculate single-task training cost for a batch of examples.
  
  Args:
    logits: Tensor with shape batch_size x n_classes containing logits.
    labels: Tensor with shape batch_size x n_classes containing true labels
      in a one-hot encoding.
    weights: Tensor with shape batch_size containing example weights.
  
  Returns:
    A tensor with shape batch_size containing the weighted cost for each
    example.
docstr_tok: ["Calculate","single-task","training","cost","for","a","batch","of","examples",".","Args",":","logits",":","Tensor","with","shape","batch_size","x","n_classes","containing","logits",".","labels",":","Tensor","with","shape","batch_size","x","n_classes","containing","true","labels","in","a","one-hot","encoding",".","weights",":","Tensor","with","shape","batch_size","containing","example","weights",".","Returns",":","A","tensor","with","shape","batch_size","containing","the","weighted","cost","for","each","example","."]
code: def cost(self, logits, labels, weights):
      """Calculate single-task training cost for a batch of examples.
  
      Args:
        logits: Tensor with shape batch_size x n_classes containing logits.
        labels: Tensor with shape batch_size x n_classes containing true labels
          in a one-hot encoding.
        weights: Tensor with shape batch_size containing example weights.
  
      Returns:
        A tensor with shape batch_size containing the weighted cost for each
        example.
      """
      return tf.multiply(
          tf.nn.softmax_cross_entropy_with_logits(
              logits=logits, labels=labels
          ),
          weights,
      )
  
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 2 for calling the TensorflowClassifier obj's underlying member method code with example usage: obj.cost(logits, labels, weights) and returns: tf