INNER CODE UNIT · Python

row_sum

deepchem/deepchem · contrib/tensorflow_models/__init__.py:37

    row_sum = np.sum(x, axis=1)
    x /= row_sum.reshape((x.shape[0], 1))
  # (n_samples, n_tasks, n_classes)
  elif len(x.shape) == 3:
    row_max = np.max(x, axis=2)
    x -= row_max.reshape(x.shape[:2] + (1,))
    x = np.exp(x)
    row_sum = np.sum(x, axis=2)
    x /= row_sum.reshape(x.shape[:2] + (1,))
  return x


class TensorflowGraph(object):
  """Simple class that holds information needed to run Tensorflow graph."""

  def __init__(self, graph, session, name_scopes, output, labels, weights,
               loss):
    warnings.warn(

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…