Class/Object

org.platanios.tensorflow.api.ops.metrics

Accuracy

Related Docs: object Accuracy | package metrics

Permalink

class Accuracy extends Metric[(Output, Output), Output]

Accuracy metric.

The accuracy metric calculates how often a set of predictions matches a corresponding set of targets. The metric creates two local variables, total and count that are used to compute the frequency with which the predictions match the targets. This frequency is ultimately returned as an idempotent operation that simply divides total by count.

For estimation of the metric over a stream of data, the function creates an update operation that updates these variables and returns the accuracy. Internally, an isCorrect operation computes a tensor with elements equal to 1 where the corresponding elements of the predictions and the targets match, and 0 otherwise. update increments total with the reduced sum of the product of isCorrect and weights, and increments count with the reduced sum of weights.

If weights is None, the weights default to 1. Use weights of 0 to mask values.

Linear Supertypes
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. Accuracy
  2. Metric
  3. AnyRef
  4. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new Accuracy(nameScope: String, defaultWeights: Option[tensors.Tensor[types.FLOAT32]] = None, variablesCollections: Set[Key[variables.Variable]] = Set(METRIC_VARIABLES), valuesCollections: Set[Key[Output]] = Set(METRIC_VALUES), updatesCollections: Set[Key[Output]] = Set(METRIC_UPDATES), resetsCollections: Set[Key[Op]] = Set(METRIC_RESETS))

    Permalink

    nameScope

    Name prefix for the created ops.

    defaultWeights

    Default weights with which all computed metric values are multiplied.

    variablesCollections

    Graph collections in which to add the metric variables (for streaming metrics).

    valuesCollections

    Graph collections in which to add the metric values.

    updatesCollections

    Graph collections in which to add the metric updates.

    resetsCollections

    Graph collections in which to add the metric resets.

Value Members

  1. final def !=(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  5. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  6. def compute(values: (Output, Output), weights: Option[Output] = None, name: String = s"$name/Compute"): Output

    Permalink

    Computes the value of this metric for the provided predictions and targets, optionally weighted by weights.

    Computes the value of this metric for the provided predictions and targets, optionally weighted by weights.

    values

    Tuple containing the predictions tensor and the targets tensor.

    weights

    Optional tensor containing weights for the values.

    name

    Name prefix for the created ops.

    returns

    Created output containing the metric value.

    Definition Classes
    AccuracyMetric
  7. val defaultWeights: Option[tensors.Tensor[types.FLOAT32]]

    Permalink

    Default weights with which all computed metric values are multiplied.

    Default weights with which all computed metric values are multiplied.

    Attributes
    protected
  8. final def eq(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  9. def equals(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  10. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  11. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
  12. def getWeights(providedWeights: Option[Output]): Option[Output]

    Permalink
    Attributes
    protected
    Definition Classes
    Metric
  13. def hashCode(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  14. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  15. def name: String

    Permalink

    Name of this metric.

    Name of this metric.

    Definition Classes
    AccuracyMetric
  16. val nameScope: String

    Permalink

    Name prefix for the created ops.

  17. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  18. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  19. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  20. val resetsCollections: Set[Key[Op]]

    Permalink

    Graph collections in which to add the metric resets.

  21. def streaming(values: (Output, Output), weights: Option[Output] = None, name: String = s"$name/Streaming"): StreamingInstance[Output]

    Permalink

    Creates ops for computing the value of this metric in a streaming fashion.

    Creates ops for computing the value of this metric in a streaming fashion. This function returns an op for obtaining the value of this metric, as well as a pair of ops to update its accumulated value and reset it.

    values

    Tuple containing the predictions tensor and the targets tensor.

    weights

    Optional tensor containing weights for the predictions.

    name

    Name prefix for the created ops.

    returns

    Tuple containing: (i) an output representing the current value of the metric, (ii) an op used to update its current value and obtain the new value, and (iii) an op used to reset its value.

    Definition Classes
    AccuracyMetric
  22. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  23. def toString(): String

    Permalink
    Definition Classes
    Metric → AnyRef → Any
  24. val updatesCollections: Set[Key[Output]]

    Permalink

    Graph collections in which to add the metric updates.

  25. val valuesCollections: Set[Key[Output]]

    Permalink

    Graph collections in which to add the metric values.

  26. val variablesCollections: Set[Key[variables.Variable]]

    Permalink

    Graph collections in which to add the metric variables (for streaming metrics).

  27. final def wait(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  28. final def wait(arg0: Long, arg1: Int): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  29. final def wait(arg0: Long): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  30. def weights: Option[tensors.Tensor[types.FLOAT32]]

    Permalink

    Weights to multiply the provided values with when computing the value of this metric.

    Weights to multiply the provided values with when computing the value of this metric.

    Definition Classes
    AccuracyMetric

Inherited from Metric[(Output, Output), Output]

Inherited from AnyRef

Inherited from Any

Ungrouped