{
  "$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": "# Streaming Layers API\n\nRecurrent cells for streaming models whose state is an explicit model input and output. One model call\nprocesses one step: the caller feeds each ``state_out_k`` output back as the ``state_in_k`` input of the next\ncall, and feeds zeros at the start of an independent sequence.\n\n**Classes**\n\n| Name | Description |\n| --- | --- |\n| `StreamingLSTMCell` | One LSTM step with explicit hidden and cell state |\n\n**Functions**\n\n| Name | Description |\n| --- | --- |\n| `state_input` | Model input for state pair ``k`` |\n| `state_output` | Model output for state pair ``k`` |",
      "name": "streaming",
      "path": "helia_edge.layers.streaming",
      "submodules": [],
      "summary": "Streaming Layers API",
      "symbols": [
        {
          "description": "One LSTM step: ``[x, h, c] -> [h', c']``.\n\nThe weights have the layout of ``keras.layers.LSTMCell``: ``kernel`` (features, 4 * units),\n``recurrent_kernel`` (units, 4 * units) and ``bias`` (4 * units), with gates in the order input,\nforget, cell, output. Weights of a ``keras.layers.LSTM`` or ``LSTMCell`` load unchanged.\n\nc' = f * c + i * tanh(z_c) and h' = o * tanh(c'), where z = x W + h R + b and i, f, o are the sigmoid\nof their slices of z.",
          "examples": [],
          "id": "helia_edge.layers.streaming.StreamingLSTMCell",
          "kind": "class",
          "language": "python",
          "members": [
            {
              "description": "",
              "examples": [],
              "id": "helia_edge.layers.streaming.StreamingLSTMCell.units",
              "kind": "attribute",
              "language": "python",
              "members": [],
              "name": "units",
              "params": [],
              "raises": [],
              "returns": [],
              "signature": "units = units",
              "source": {
                "line": 42,
                "path": "helia_edge/layers/streaming.py",
                "url": "https://github.com/AmbiqAI/helia-edge/blob/f341fb11f7f5d77a4974ba8273c4cd55d67c21f0/helia_edge/layers/streaming.py#L42"
              },
              "summary": ""
            },
            {
              "description": "",
              "examples": [],
              "id": "helia_edge.layers.streaming.StreamingLSTMCell.use_bias",
              "kind": "attribute",
              "language": "python",
              "members": [],
              "name": "use_bias",
              "params": [],
              "raises": [],
              "returns": [],
              "signature": "use_bias = use_bias",
              "source": {
                "line": 43,
                "path": "helia_edge/layers/streaming.py",
                "url": "https://github.com/AmbiqAI/helia-edge/blob/f341fb11f7f5d77a4974ba8273c4cd55d67c21f0/helia_edge/layers/streaming.py#L43"
              },
              "summary": ""
            },
            {
              "description": "",
              "examples": [],
              "id": "helia_edge.layers.streaming.StreamingLSTMCell.unit_forget_bias",
              "kind": "attribute",
              "language": "python",
              "members": [],
              "name": "unit_forget_bias",
              "params": [],
              "raises": [],
              "returns": [],
              "signature": "unit_forget_bias = unit_forget_bias",
              "source": {
                "line": 44,
                "path": "helia_edge/layers/streaming.py",
                "url": "https://github.com/AmbiqAI/helia-edge/blob/f341fb11f7f5d77a4974ba8273c4cd55d67c21f0/helia_edge/layers/streaming.py#L44"
              },
              "summary": ""
            },
            {
              "description": "",
              "examples": [],
              "id": "helia_edge.layers.streaming.StreamingLSTMCell.build",
              "kind": "method",
              "language": "python",
              "members": [],
              "name": "build",
              "params": [],
              "raises": [],
              "returns": [],
              "signature": "build(input_shape)",
              "source": {
                "line": 46,
                "path": "helia_edge/layers/streaming.py",
                "url": "https://github.com/AmbiqAI/helia-edge/blob/f341fb11f7f5d77a4974ba8273c4cd55d67c21f0/helia_edge/layers/streaming.py#L46"
              },
              "summary": ""
            },
            {
              "description": "",
              "examples": [],
              "id": "helia_edge.layers.streaming.StreamingLSTMCell.call",
              "kind": "method",
              "language": "python",
              "members": [],
              "name": "call",
              "params": [],
              "raises": [],
              "returns": [],
              "signature": "call(inputs)",
              "source": {
                "line": 66,
                "path": "helia_edge/layers/streaming.py",
                "url": "https://github.com/AmbiqAI/helia-edge/blob/f341fb11f7f5d77a4974ba8273c4cd55d67c21f0/helia_edge/layers/streaming.py#L66"
              },
              "summary": ""
            },
            {
              "description": "",
              "examples": [],
              "id": "helia_edge.layers.streaming.StreamingLSTMCell.compute_output_shape",
              "kind": "method",
              "language": "python",
              "members": [],
              "name": "compute_output_shape",
              "params": [],
              "raises": [],
              "returns": [],
              "signature": "compute_output_shape(input_shape)",
              "source": {
                "line": 79,
                "path": "helia_edge/layers/streaming.py",
                "url": "https://github.com/AmbiqAI/helia-edge/blob/f341fb11f7f5d77a4974ba8273c4cd55d67c21f0/helia_edge/layers/streaming.py#L79"
              },
              "summary": ""
            },
            {
              "description": "",
              "examples": [],
              "id": "helia_edge.layers.streaming.StreamingLSTMCell.get_config",
              "kind": "method",
              "language": "python",
              "members": [],
              "name": "get_config",
              "params": [],
              "raises": [],
              "returns": [],
              "signature": "get_config()",
              "source": {
                "line": 83,
                "path": "helia_edge/layers/streaming.py",
                "url": "https://github.com/AmbiqAI/helia-edge/blob/f341fb11f7f5d77a4974ba8273c4cd55d67c21f0/helia_edge/layers/streaming.py#L83"
              },
              "summary": ""
            }
          ],
          "name": "StreamingLSTMCell",
          "params": [
            {
              "description": "Size of the hidden and cell state.",
              "name": "units",
              "type": "int"
            },
            {
              "default": "True",
              "description": "Add ``bias`` to the gates.",
              "name": "use_bias",
              "type": "bool"
            },
            {
              "default": "True",
              "description": "Initialize the forget gate's bias to one and the others to zero, as\n``keras.layers.LSTMCell`` does.",
              "name": "unit_forget_bias",
              "type": "bool"
            }
          ],
          "raises": [],
          "returns": [],
          "signature": "StreamingLSTMCell(units: int, use_bias: bool = True, unit_forget_bias: bool = True, **kwargs={})",
          "source": {
            "line": 22,
            "path": "helia_edge/layers/streaming.py",
            "url": "https://github.com/AmbiqAI/helia-edge/blob/f341fb11f7f5d77a4974ba8273c4cd55d67c21f0/helia_edge/layers/streaming.py#L22"
          },
          "summary": "One LSTM step: [x, h, c] -> [h', c']."
        },
        {
          "description": "Model input ``state_in_k`` for state pair ``k``.",
          "examples": [],
          "id": "helia_edge.layers.streaming.state_input",
          "kind": "function",
          "language": "python",
          "members": [],
          "name": "state_input",
          "params": [
            {
              "description": "State pair index; ``state_out_k`` is the matching output.",
              "name": "k",
              "type": "int"
            },
            {
              "description": "State shape without the batch dimension.",
              "name": "shape",
              "type": "tuple[int, ...]"
            },
            {
              "default": "None",
              "description": "Fixed batch size, or None.",
              "name": "batch_size",
              "type": "int | None"
            }
          ],
          "raises": [],
          "returns": [
            {
              "description": "keras.KerasTensor: The input tensor.",
              "type": "keras.KerasTensor"
            }
          ],
          "signature": "state_input(k: int, shape: tuple[int, ...], batch_size: int | None = None) -> keras.KerasTensor",
          "source": {
            "line": 92,
            "path": "helia_edge/layers/streaming.py",
            "url": "https://github.com/AmbiqAI/helia-edge/blob/f341fb11f7f5d77a4974ba8273c4cd55d67c21f0/helia_edge/layers/streaming.py#L92"
          },
          "summary": "Model input stateink for state pair k."
        },
        {
          "description": "Name ``x`` as the model output ``state_out_k`` of state pair ``k``.",
          "examples": [],
          "id": "helia_edge.layers.streaming.state_output",
          "kind": "function",
          "language": "python",
          "members": [],
          "name": "state_output",
          "params": [
            {
              "description": "State pair index; ``state_in_k`` is the matching input.",
              "name": "k",
              "type": "int"
            },
            {
              "description": "The next state.",
              "name": "x",
              "type": "keras.KerasTensor"
            }
          ],
          "raises": [],
          "returns": [
            {
              "description": "keras.KerasTensor: ``x`` through an identity layer named ``state_out_k``.",
              "type": "keras.KerasTensor"
            }
          ],
          "signature": "state_output(k: int, x: keras.KerasTensor) -> keras.KerasTensor",
          "source": {
            "line": 106,
            "path": "helia_edge/layers/streaming.py",
            "url": "https://github.com/AmbiqAI/helia-edge/blob/f341fb11f7f5d77a4974ba8273c4cd55d67c21f0/helia_edge/layers/streaming.py#L106"
          },
          "summary": "Name x as the model output stateoutk of state pair k."
        }
      ]
    }
  ],
  "name": "helia_edge"
}
