{
  "$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": "Portable image patch extraction and masked patch embeddings.",
      "name": "patching",
      "path": "helia_edge.layers.patching",
      "submodules": [],
      "summary": "Portable image patch extraction and masked patch embeddings.",
      "symbols": [
        {
          "description": "Extract flattened patches from images shaped (batch, height, width, ch).",
          "examples": [],
          "id": "helia_edge.layers.patching.PatchLayer2D",
          "kind": "class",
          "language": "python",
          "members": [
            {
              "description": "",
              "examples": [],
              "id": "helia_edge.layers.patching.PatchLayer2D.height",
              "kind": "attribute",
              "language": "python",
              "members": [],
              "name": "height",
              "params": [],
              "raises": [],
              "returns": [],
              "signature": "height = height",
              "source": {
                "line": 30,
                "path": "helia_edge/layers/patching.py",
                "url": "https://github.com/AmbiqAI/helia-edge/blob/f341fb11f7f5d77a4974ba8273c4cd55d67c21f0/helia_edge/layers/patching.py#L30"
              },
              "summary": ""
            },
            {
              "description": "",
              "examples": [],
              "id": "helia_edge.layers.patching.PatchLayer2D.width",
              "kind": "attribute",
              "language": "python",
              "members": [],
              "name": "width",
              "params": [],
              "raises": [],
              "returns": [],
              "signature": "width = width",
              "source": {
                "line": 31,
                "path": "helia_edge/layers/patching.py",
                "url": "https://github.com/AmbiqAI/helia-edge/blob/f341fb11f7f5d77a4974ba8273c4cd55d67c21f0/helia_edge/layers/patching.py#L31"
              },
              "summary": ""
            },
            {
              "description": "",
              "examples": [],
              "id": "helia_edge.layers.patching.PatchLayer2D.ch_size",
              "kind": "attribute",
              "language": "python",
              "members": [],
              "name": "ch_size",
              "params": [],
              "raises": [],
              "returns": [],
              "signature": "ch_size = ch",
              "source": {
                "line": 32,
                "path": "helia_edge/layers/patching.py",
                "url": "https://github.com/AmbiqAI/helia-edge/blob/f341fb11f7f5d77a4974ba8273c4cd55d67c21f0/helia_edge/layers/patching.py#L32"
              },
              "summary": ""
            },
            {
              "description": "",
              "examples": [],
              "id": "helia_edge.layers.patching.PatchLayer2D.patch_height",
              "kind": "attribute",
              "language": "python",
              "members": [],
              "name": "patch_height",
              "params": [],
              "raises": [],
              "returns": [],
              "signature": "patch_height = patch_height",
              "source": {
                "line": 33,
                "path": "helia_edge/layers/patching.py",
                "url": "https://github.com/AmbiqAI/helia-edge/blob/f341fb11f7f5d77a4974ba8273c4cd55d67c21f0/helia_edge/layers/patching.py#L33"
              },
              "summary": ""
            },
            {
              "description": "",
              "examples": [],
              "id": "helia_edge.layers.patching.PatchLayer2D.patch_width",
              "kind": "attribute",
              "language": "python",
              "members": [],
              "name": "patch_width",
              "params": [],
              "raises": [],
              "returns": [],
              "signature": "patch_width = patch_width",
              "source": {
                "line": 34,
                "path": "helia_edge/layers/patching.py",
                "url": "https://github.com/AmbiqAI/helia-edge/blob/f341fb11f7f5d77a4974ba8273c4cd55d67c21f0/helia_edge/layers/patching.py#L34"
              },
              "summary": ""
            },
            {
              "description": "",
              "examples": [],
              "id": "helia_edge.layers.patching.PatchLayer2D.resize",
              "kind": "attribute",
              "language": "python",
              "members": [],
              "name": "resize",
              "params": [],
              "raises": [],
              "returns": [],
              "signature": "resize = keras.layers.Reshape((-1, patch_height * patch_width * ch))",
              "source": {
                "line": 36,
                "path": "helia_edge/layers/patching.py",
                "url": "https://github.com/AmbiqAI/helia-edge/blob/f341fb11f7f5d77a4974ba8273c4cd55d67c21f0/helia_edge/layers/patching.py#L36"
              },
              "summary": ""
            },
            {
              "description": "",
              "examples": [],
              "id": "helia_edge.layers.patching.PatchLayer2D.call",
              "kind": "method",
              "language": "python",
              "members": [],
              "name": "call",
              "params": [],
              "raises": [],
              "returns": [],
              "signature": "call(images: Tensor) -> Tensor",
              "source": {
                "line": 38,
                "path": "helia_edge/layers/patching.py",
                "url": "https://github.com/AmbiqAI/helia-edge/blob/f341fb11f7f5d77a4974ba8273c4cd55d67c21f0/helia_edge/layers/patching.py#L38"
              },
              "summary": ""
            },
            {
              "description": "",
              "examples": [],
              "id": "helia_edge.layers.patching.PatchLayer2D.get_config",
              "kind": "method",
              "language": "python",
              "members": [],
              "name": "get_config",
              "params": [],
              "raises": [],
              "returns": [],
              "signature": "get_config() -> dict[str, Any]",
              "source": {
                "line": 49,
                "path": "helia_edge/layers/patching.py",
                "url": "https://github.com/AmbiqAI/helia-edge/blob/f341fb11f7f5d77a4974ba8273c4cd55d67c21f0/helia_edge/layers/patching.py#L49"
              },
              "summary": ""
            },
            {
              "description": "Plot one image and its reconstructed patches; return its batch index.",
              "examples": [],
              "id": "helia_edge.layers.patching.PatchLayer2D.show_patched_image",
              "kind": "method",
              "language": "python",
              "members": [],
              "name": "show_patched_image",
              "params": [],
              "raises": [],
              "returns": [],
              "signature": "show_patched_image(images: keras.KerasTensor, patches: keras.KerasTensor) -> int",
              "source": {
                "line": 59,
                "path": "helia_edge/layers/patching.py",
                "url": "https://github.com/AmbiqAI/helia-edge/blob/f341fb11f7f5d77a4974ba8273c4cd55d67c21f0/helia_edge/layers/patching.py#L59"
              },
              "summary": "Plot one image and its reconstructed patches; return its batch index."
            },
            {
              "description": "Reconstruct one image from non-overlapping patches in row-major order.",
              "examples": [],
              "id": "helia_edge.layers.patching.PatchLayer2D.reconstruct_from_patch",
              "kind": "method",
              "language": "python",
              "members": [],
              "name": "reconstruct_from_patch",
              "params": [],
              "raises": [],
              "returns": [],
              "signature": "reconstruct_from_patch(patch: keras.KerasTensor) -> keras.KerasTensor",
              "source": {
                "line": 83,
                "path": "helia_edge/layers/patching.py",
                "url": "https://github.com/AmbiqAI/helia-edge/blob/f341fb11f7f5d77a4974ba8273c4cd55d67c21f0/helia_edge/layers/patching.py#L83"
              },
              "summary": "Reconstruct one image from non-overlapping patches in row-major order."
            }
          ],
          "name": "PatchLayer2D",
          "params": [],
          "raises": [],
          "returns": [],
          "signature": "PatchLayer2D(height: int, width: int, ch: int, patch_height: int, patch_width: int, **kwargs={})",
          "source": {
            "line": 17,
            "path": "helia_edge/layers/patching.py",
            "url": "https://github.com/AmbiqAI/helia-edge/blob/f341fb11f7f5d77a4974ba8273c4cd55d67c21f0/helia_edge/layers/patching.py#L17"
          },
          "summary": ""
        },
        {
          "description": "Project patches with position embeddings and sample masks from a seeded stream.",
          "examples": [],
          "id": "helia_edge.layers.patching.MaskedPatchEncoder2D",
          "kind": "class",
          "language": "python",
          "members": [
            {
              "description": "",
              "examples": [],
              "id": "helia_edge.layers.patching.MaskedPatchEncoder2D.patch_height",
              "kind": "attribute",
              "language": "python",
              "members": [],
              "name": "patch_height",
              "params": [],
              "raises": [],
              "returns": [],
              "signature": "patch_height = patch_height",
              "source": {
                "line": 110,
                "path": "helia_edge/layers/patching.py",
                "url": "https://github.com/AmbiqAI/helia-edge/blob/f341fb11f7f5d77a4974ba8273c4cd55d67c21f0/helia_edge/layers/patching.py#L110"
              },
              "summary": ""
            },
            {
              "description": "",
              "examples": [],
              "id": "helia_edge.layers.patching.MaskedPatchEncoder2D.patch_width",
              "kind": "attribute",
              "language": "python",
              "members": [],
              "name": "patch_width",
              "params": [],
              "raises": [],
              "returns": [],
              "signature": "patch_width = patch_width",
              "source": {
                "line": 111,
                "path": "helia_edge/layers/patching.py",
                "url": "https://github.com/AmbiqAI/helia-edge/blob/f341fb11f7f5d77a4974ba8273c4cd55d67c21f0/helia_edge/layers/patching.py#L111"
              },
              "summary": ""
            },
            {
              "description": "",
              "examples": [],
              "id": "helia_edge.layers.patching.MaskedPatchEncoder2D.ch_size",
              "kind": "attribute",
              "language": "python",
              "members": [],
              "name": "ch_size",
              "params": [],
              "raises": [],
              "returns": [],
              "signature": "ch_size = ch_size",
              "source": {
                "line": 112,
                "path": "helia_edge/layers/patching.py",
                "url": "https://github.com/AmbiqAI/helia-edge/blob/f341fb11f7f5d77a4974ba8273c4cd55d67c21f0/helia_edge/layers/patching.py#L112"
              },
              "summary": ""
            },
            {
              "description": "",
              "examples": [],
              "id": "helia_edge.layers.patching.MaskedPatchEncoder2D.projection_dim",
              "kind": "attribute",
              "language": "python",
              "members": [],
              "name": "projection_dim",
              "params": [],
              "raises": [],
              "returns": [],
              "signature": "projection_dim = projection_dim",
              "source": {
                "line": 113,
                "path": "helia_edge/layers/patching.py",
                "url": "https://github.com/AmbiqAI/helia-edge/blob/f341fb11f7f5d77a4974ba8273c4cd55d67c21f0/helia_edge/layers/patching.py#L113"
              },
              "summary": ""
            },
            {
              "description": "",
              "examples": [],
              "id": "helia_edge.layers.patching.MaskedPatchEncoder2D.mask_proportion",
              "kind": "attribute",
              "language": "python",
              "members": [],
              "name": "mask_proportion",
              "params": [],
              "raises": [],
              "returns": [],
              "signature": "mask_proportion = mask_proportion",
              "source": {
                "line": 114,
                "path": "helia_edge/layers/patching.py",
                "url": "https://github.com/AmbiqAI/helia-edge/blob/f341fb11f7f5d77a4974ba8273c4cd55d67c21f0/helia_edge/layers/patching.py#L114"
              },
              "summary": ""
            },
            {
              "description": "",
              "examples": [],
              "id": "helia_edge.layers.patching.MaskedPatchEncoder2D.downstream",
              "kind": "attribute",
              "language": "python",
              "members": [],
              "name": "downstream",
              "params": [],
              "raises": [],
              "returns": [],
              "signature": "downstream = downstream",
              "source": {
                "line": 115,
                "path": "helia_edge/layers/patching.py",
                "url": "https://github.com/AmbiqAI/helia-edge/blob/f341fb11f7f5d77a4974ba8273c4cd55d67c21f0/helia_edge/layers/patching.py#L115"
              },
              "summary": ""
            },
            {
              "description": "",
              "examples": [],
              "id": "helia_edge.layers.patching.MaskedPatchEncoder2D.seed",
              "kind": "attribute",
              "language": "python",
              "members": [],
              "name": "seed",
              "params": [],
              "raises": [],
              "returns": [],
              "signature": "seed = seed",
              "source": {
                "line": 116,
                "path": "helia_edge/layers/patching.py",
                "url": "https://github.com/AmbiqAI/helia-edge/blob/f341fb11f7f5d77a4974ba8273c4cd55d67c21f0/helia_edge/layers/patching.py#L116"
              },
              "summary": ""
            },
            {
              "description": "",
              "examples": [],
              "id": "helia_edge.layers.patching.MaskedPatchEncoder2D.seed_generator",
              "kind": "attribute",
              "language": "python",
              "members": [],
              "name": "seed_generator",
              "params": [],
              "raises": [],
              "returns": [],
              "signature": "seed_generator = keras.random.SeedGenerator(seed)",
              "source": {
                "line": 117,
                "path": "helia_edge/layers/patching.py",
                "url": "https://github.com/AmbiqAI/helia-edge/blob/f341fb11f7f5d77a4974ba8273c4cd55d67c21f0/helia_edge/layers/patching.py#L117"
              },
              "summary": ""
            },
            {
              "description": "",
              "examples": [],
              "id": "helia_edge.layers.patching.MaskedPatchEncoder2D.projection",
              "kind": "attribute",
              "language": "python",
              "members": [],
              "name": "projection",
              "params": [],
              "raises": [],
              "returns": [],
              "signature": "projection = keras.layers.Dense(units=self.projection_dim)",
              "source": {
                "line": 120,
                "path": "helia_edge/layers/patching.py",
                "url": "https://github.com/AmbiqAI/helia-edge/blob/f341fb11f7f5d77a4974ba8273c4cd55d67c21f0/helia_edge/layers/patching.py#L120"
              },
              "summary": ""
            },
            {
              "description": "",
              "examples": [],
              "id": "helia_edge.layers.patching.MaskedPatchEncoder2D.position_embedding",
              "kind": "attribute",
              "language": "python",
              "members": [],
              "name": "position_embedding",
              "params": [],
              "raises": [],
              "returns": [],
              "signature": "position_embedding = None",
              "source": {
                "line": 121,
                "path": "helia_edge/layers/patching.py",
                "url": "https://github.com/AmbiqAI/helia-edge/blob/f341fb11f7f5d77a4974ba8273c4cd55d67c21f0/helia_edge/layers/patching.py#L121"
              },
              "summary": ""
            },
            {
              "description": "",
              "examples": [],
              "id": "helia_edge.layers.patching.MaskedPatchEncoder2D.build",
              "kind": "method",
              "language": "python",
              "members": [],
              "name": "build",
              "params": [],
              "raises": [],
              "returns": [],
              "signature": "build(input_shape)",
              "source": {
                "line": 123,
                "path": "helia_edge/layers/patching.py",
                "url": "https://github.com/AmbiqAI/helia-edge/blob/f341fb11f7f5d77a4974ba8273c4cd55d67c21f0/helia_edge/layers/patching.py#L123"
              },
              "summary": ""
            },
            {
              "description": "",
              "examples": [],
              "id": "helia_edge.layers.patching.MaskedPatchEncoder2D.call",
              "kind": "method",
              "language": "python",
              "members": [],
              "name": "call",
              "params": [],
              "raises": [],
              "returns": [],
              "signature": "call(patches: Tensor) -> Tensor | tuple[Tensor, Tensor, Tensor, Tensor, Tensor]",
              "source": {
                "line": 142,
                "path": "helia_edge/layers/patching.py",
                "url": "https://github.com/AmbiqAI/helia-edge/blob/f341fb11f7f5d77a4974ba8273c4cd55d67c21f0/helia_edge/layers/patching.py#L142"
              },
              "summary": ""
            },
            {
              "description": "",
              "examples": [],
              "id": "helia_edge.layers.patching.MaskedPatchEncoder2D.get_random_indices",
              "kind": "method",
              "language": "python",
              "members": [],
              "name": "get_random_indices",
              "params": [],
              "raises": [],
              "returns": [],
              "signature": "get_random_indices(batch_size: int) -> tuple[Tensor, Tensor]",
              "source": {
                "line": 180,
                "path": "helia_edge/layers/patching.py",
                "url": "https://github.com/AmbiqAI/helia-edge/blob/f341fb11f7f5d77a4974ba8273c4cd55d67c21f0/helia_edge/layers/patching.py#L180"
              },
              "summary": ""
            },
            {
              "description": "",
              "examples": [],
              "id": "helia_edge.layers.patching.MaskedPatchEncoder2D.get_config",
              "kind": "method",
              "language": "python",
              "members": [],
              "name": "get_config",
              "params": [],
              "raises": [],
              "returns": [],
              "signature": "get_config() -> dict[str, Any]",
              "source": {
                "line": 188,
                "path": "helia_edge/layers/patching.py",
                "url": "https://github.com/AmbiqAI/helia-edge/blob/f341fb11f7f5d77a4974ba8273c4cd55d67c21f0/helia_edge/layers/patching.py#L188"
              },
              "summary": ""
            },
            {
              "description": "",
              "examples": [],
              "id": "helia_edge.layers.patching.MaskedPatchEncoder2D.generate_masked_image",
              "kind": "method",
              "language": "python",
              "members": [],
              "name": "generate_masked_image",
              "params": [],
              "raises": [],
              "returns": [],
              "signature": "generate_masked_image(patches: keras.KerasTensor, unmask_indices: keras.KerasTensor)",
              "source": {
                "line": 200,
                "path": "helia_edge/layers/patching.py",
                "url": "https://github.com/AmbiqAI/helia-edge/blob/f341fb11f7f5d77a4974ba8273c4cd55d67c21f0/helia_edge/layers/patching.py#L200"
              },
              "summary": ""
            }
          ],
          "name": "MaskedPatchEncoder2D",
          "params": [],
          "raises": [],
          "returns": [],
          "signature": "MaskedPatchEncoder2D(\n    patch_height: int,\n    patch_width: int,\n    ch_size: int,\n    projection_dim: int,\n    mask_proportion: float,\n    downstream: bool = False,\n    seed: int | None = None,\n    **kwargs={},\n)",
          "source": {
            "line": 95,
            "path": "helia_edge/layers/patching.py",
            "url": "https://github.com/AmbiqAI/helia-edge/blob/f341fb11f7f5d77a4974ba8273c4cd55d67c21f0/helia_edge/layers/patching.py#L95"
          },
          "summary": ""
        }
      ]
    }
  ],
  "name": "helia_edge"
}
