{
  "$schema": "https://ambiqai.github.io/helia-ui/schema/reference-model-1.json",
  "generatedFrom": {
    "sourceCommit": "f341fb11f7f5d77a4974ba8273c4cd55d67c21f0",
    "tool": "pyref",
    "version": "1.7.3"
  },
  "language": "python",
  "modules": [
    {
      "description": "# Confusion Matrix Metric API\n\n**Classes**\n\n| Name | Description |\n| --- | --- |\n| `ConfusionMatrix` | Accumulates a confusion matrix and returns row-normalized values. |",
      "name": "confusion_matrix",
      "path": "helia_edge.metrics.confusion_matrix",
      "submodules": [],
      "summary": "Confusion Matrix Metric API",
      "symbols": [
        {
          "description": "Accumulate class counts and return a row-normalized confusion matrix.\n\nRows represent true classes and columns represent predicted classes.\nRows with no observations return zeros. State accumulates across batches\nuntil reset_state() is called.",
          "examples": [],
          "id": "helia_edge.metrics.confusion_matrix.ConfusionMatrix",
          "kind": "class",
          "language": "python",
          "members": [
            {
              "description": "",
              "examples": [],
              "id": "helia_edge.metrics.confusion_matrix.ConfusionMatrix.num_classes",
              "kind": "attribute",
              "language": "python",
              "members": [],
              "name": "num_classes",
              "params": [],
              "raises": [],
              "returns": [],
              "signature": "num_classes = int(num_classes)",
              "source": {
                "line": 30,
                "path": "helia_edge/metrics/confusion_matrix.py",
                "url": "https://github.com/AmbiqAI/helia-edge/blob/f341fb11f7f5d77a4974ba8273c4cd55d67c21f0/helia_edge/metrics/confusion_matrix.py#L30"
              },
              "summary": ""
            },
            {
              "description": "",
              "examples": [],
              "id": "helia_edge.metrics.confusion_matrix.ConfusionMatrix.conf_matrix",
              "kind": "attribute",
              "language": "python",
              "members": [],
              "name": "conf_matrix",
              "params": [],
              "raises": [],
              "returns": [],
              "signature": "conf_matrix = self.add_variable(name='conf_matrix', shape=(self.num_classes, self.num_classes), initializer='zeros', dtype=self._state_dtype)",
              "source": {
                "line": 32,
                "path": "helia_edge/metrics/confusion_matrix.py",
                "url": "https://github.com/AmbiqAI/helia-edge/blob/f341fb11f7f5d77a4974ba8273c4cd55d67c21f0/helia_edge/metrics/confusion_matrix.py#L32"
              },
              "summary": ""
            },
            {
              "description": "Add a batch of labels and predictions to the accumulated counts.",
              "examples": [],
              "id": "helia_edge.metrics.confusion_matrix.ConfusionMatrix.update_state",
              "kind": "method",
              "language": "python",
              "members": [],
              "name": "update_state",
              "params": [
                {
                  "description": "Integer class labels, flattened before accumulation.",
                  "name": "y_true",
                  "type": "Tensor"
                },
                {
                  "description": "Class scores with shape (batch, ..., num_classes), reduced\nwith argmax over the last axis, or matching integer labels.",
                  "name": "y_pred",
                  "type": "Tensor"
                },
                {
                  "default": "None",
                  "description": "Optional weights, flattened to one value per label.",
                  "name": "sample_weight",
                  "type": "Tensor | None"
                }
              ],
              "raises": [
                {
                  "description": "A true or predicted label is outside the class range\nin eager execution. TensorFlow graph execution uses an assertion.",
                  "type": "ValueError"
                }
              ],
              "returns": [],
              "signature": "update_state(y_true, y_pred, sample_weight=None)",
              "source": {
                "line": 39,
                "path": "helia_edge/metrics/confusion_matrix.py",
                "url": "https://github.com/AmbiqAI/helia-edge/blob/f341fb11f7f5d77a4974ba8273c4cd55d67c21f0/helia_edge/metrics/confusion_matrix.py#L39"
              },
              "summary": "Add a batch of labels and predictions to the accumulated counts."
            },
            {
              "description": "Returns the row-normalized confusion matrix as float64.",
              "examples": [],
              "id": "helia_edge.metrics.confusion_matrix.ConfusionMatrix.result",
              "kind": "method",
              "language": "python",
              "members": [],
              "name": "result",
              "params": [],
              "raises": [],
              "returns": [],
              "signature": "result()",
              "source": {
                "line": 99,
                "path": "helia_edge/metrics/confusion_matrix.py",
                "url": "https://github.com/AmbiqAI/helia-edge/blob/f341fb11f7f5d77a4974ba8273c4cd55d67c21f0/helia_edge/metrics/confusion_matrix.py#L99"
              },
              "summary": "Returns the row-normalized confusion matrix as float64."
            },
            {
              "description": "",
              "examples": [],
              "id": "helia_edge.metrics.confusion_matrix.ConfusionMatrix.reset_state",
              "kind": "method",
              "language": "python",
              "members": [],
              "name": "reset_state",
              "params": [],
              "raises": [],
              "returns": [],
              "signature": "reset_state()",
              "source": {
                "line": 106,
                "path": "helia_edge/metrics/confusion_matrix.py",
                "url": "https://github.com/AmbiqAI/helia-edge/blob/f341fb11f7f5d77a4974ba8273c4cd55d67c21f0/helia_edge/metrics/confusion_matrix.py#L106"
              },
              "summary": ""
            },
            {
              "description": "",
              "examples": [],
              "id": "helia_edge.metrics.confusion_matrix.ConfusionMatrix.get_config",
              "kind": "method",
              "language": "python",
              "members": [],
              "name": "get_config",
              "params": [],
              "raises": [],
              "returns": [],
              "signature": "get_config()",
              "source": {
                "line": 110,
                "path": "helia_edge/metrics/confusion_matrix.py",
                "url": "https://github.com/AmbiqAI/helia-edge/blob/f341fb11f7f5d77a4974ba8273c4cd55d67c21f0/helia_edge/metrics/confusion_matrix.py#L110"
              },
              "summary": ""
            }
          ],
          "name": "ConfusionMatrix",
          "params": [
            {
              "description": "Number of classes, defining both matrix dimensions.",
              "name": "num_classes",
              "type": "int"
            },
            {
              "default": "'confusion_matrix'",
              "description": "Keras metric name.",
              "name": "name",
              "type": "str"
            },
            {
              "default": "{}",
              "description": "Additional Keras Metric arguments, including state dtype.",
              "name": "**kwargs",
              "type": "Any"
            }
          ],
          "raises": [],
          "returns": [],
          "signature": "ConfusionMatrix(num_classes: int, name='confusion_matrix', **kwargs={})",
          "source": {
            "line": 14,
            "path": "helia_edge/metrics/confusion_matrix.py",
            "url": "https://github.com/AmbiqAI/helia-edge/blob/f341fb11f7f5d77a4974ba8273c4cd55d67c21f0/helia_edge/metrics/confusion_matrix.py#L14"
          },
          "summary": "Accumulate class counts and return a row-normalized confusion matrix."
        }
      ]
    }
  ],
  "name": "helia_edge"
}
