Skip to content

metrics

Module: metrics.py

This module implements metrics for Neural Networks

Authors
  • Lokesh Mohanty (lokeshm@iisc.ac.in)
Version Info
  • 06/01/2025: Initial version

accuracy(pred_y, y)

Compute accuracy

Parameters:

Name Type Description Default
x

input data

required
y Array

target labels

required
Source code in scirex/core/dl/nn/metrics.py
def accuracy(pred_y: jax.Array, y: jax.Array) -> float:
    """
    Compute accuracy

    Args:
        x: input data
        y: target labels
    """
    return jnp.mean(pred_y == y)