{
  "$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": "# Random Background Noises Layer API\n\nThis module provides classes to build random background noises layers.\n\n**Classes**\n\n| Name | Description |\n| --- | --- |\n| `RandomBackgroundNoises1D` | Random background noises 1D |",
      "name": "random_background_noises",
      "path": "helia_edge.layers.preprocessing.random_background_noises",
      "submodules": [],
      "summary": "Random Background Noises Layer API",
      "symbols": [
        {
          "description": "Apply random background noises to the input.\n\nExample:\n\n```python\n    sample_rate = 100\n    duration = 2*sample_rate\n    freqs = [2, 5, 15, 20, 25]\n    noises = np.vstack([\n        np.sin(2*np.pi*f*np.arange(duration)/sample_rate)\n        for f in freqs\n    ]).T\n    lyr = RandomBackgroundNoises(noises=noises, amplitude=0.2, num_noises=2)\n    y = lyr(x, training=True)\n```\n\n\n\nBase class: [BaseAugmentation1D](/helia-edge/reference/api/helia_edge/layers/preprocessing/base_augmentation/#helia_edge.layers.preprocessing.base_augmentation.BaseAugmentation1D).\n\nInherited from [BaseAugmentation](/helia-edge/reference/api/helia_edge/layers/preprocessing/base_augmentation/#helia_edge.layers.preprocessing.base_augmentation.BaseAugmentation): [augment_masks()](/helia-edge/reference/api/helia_edge/layers/preprocessing/base_augmentation/#helia_edge.layers.preprocessing.base_augmentation.BaseAugmentation.augment_masks), [augment_samples()](/helia-edge/reference/api/helia_edge/layers/preprocessing/base_augmentation/#helia_edge.layers.preprocessing.base_augmentation.BaseAugmentation.augment_samples), [augment_targets()](/helia-edge/reference/api/helia_edge/layers/preprocessing/base_augmentation/#helia_edge.layers.preprocessing.base_augmentation.BaseAugmentation.augment_targets), [batch_augment()](/helia-edge/reference/api/helia_edge/layers/preprocessing/base_augmentation/#helia_edge.layers.preprocessing.base_augmentation.BaseAugmentation.batch_augment), [call()](/helia-edge/reference/api/helia_edge/layers/preprocessing/base_augmentation/#helia_edge.layers.preprocessing.base_augmentation.BaseAugmentation.call).",
          "examples": [],
          "id": "helia_edge.layers.preprocessing.random_background_noises.RandomBackgroundNoises1D",
          "kind": "class",
          "language": "python",
          "members": [
            {
              "description": "",
              "examples": [],
              "id": "helia_edge.layers.preprocessing.random_background_noises.RandomBackgroundNoises1D.amplitude",
              "kind": "attribute",
              "language": "python",
              "members": [],
              "name": "amplitude",
              "params": [],
              "raises": [],
              "returns": [],
              "signature": "amplitude: tuple[float, float] = parse_factor(amplitude, min_value=0, max_value=None, param_name='amplitude')",
              "source": {
                "line": 47,
                "path": "helia_edge/layers/preprocessing/random_background_noises.py",
                "url": "https://github.com/AmbiqAI/helia-edge/blob/f341fb11f7f5d77a4974ba8273c4cd55d67c21f0/helia_edge/layers/preprocessing/random_background_noises.py#L47"
              },
              "summary": ""
            },
            {
              "description": "",
              "examples": [],
              "id": "helia_edge.layers.preprocessing.random_background_noises.RandomBackgroundNoises1D.num_noises",
              "kind": "attribute",
              "language": "python",
              "members": [],
              "name": "num_noises",
              "params": [],
              "raises": [],
              "returns": [],
              "signature": "num_noises: int = num_noises",
              "source": {
                "line": 48,
                "path": "helia_edge/layers/preprocessing/random_background_noises.py",
                "url": "https://github.com/AmbiqAI/helia-edge/blob/f341fb11f7f5d77a4974ba8273c4cd55d67c21f0/helia_edge/layers/preprocessing/random_background_noises.py#L48"
              },
              "summary": ""
            },
            {
              "description": "",
              "examples": [],
              "id": "helia_edge.layers.preprocessing.random_background_noises.RandomBackgroundNoises1D.noises",
              "kind": "attribute",
              "language": "python",
              "members": [],
              "name": "noises",
              "params": [],
              "raises": [],
              "returns": [],
              "signature": "noises = self.add_weight(name='noises', shape=noises.shape, initializer=keras.initializers.Constant(noises), trainable=False)",
              "source": {
                "line": 52,
                "path": "helia_edge/layers/preprocessing/random_background_noises.py",
                "url": "https://github.com/AmbiqAI/helia-edge/blob/f341fb11f7f5d77a4974ba8273c4cd55d67c21f0/helia_edge/layers/preprocessing/random_background_noises.py#L52"
              },
              "summary": ""
            },
            {
              "description": "Generate noise tensor",
              "examples": [],
              "id": "helia_edge.layers.preprocessing.random_background_noises.RandomBackgroundNoises1D.get_random_transformations",
              "kind": "method",
              "language": "python",
              "members": [],
              "name": "get_random_transformations",
              "params": [
                {
                  "description": "Input shape.",
                  "name": "input_shape",
                  "type": "tuple[int, ...]"
                }
              ],
              "raises": [],
              "returns": [
                {
                  "description": "Dictionary containing the noise tensor.",
                  "name": "dict",
                  "type": "dict"
                }
              ],
              "signature": "get_random_transformations(input_shape: tuple[int, int, int]) -> dict",
              "source": {
                "line": 56,
                "path": "helia_edge/layers/preprocessing/random_background_noises.py",
                "url": "https://github.com/AmbiqAI/helia-edge/blob/f341fb11f7f5d77a4974ba8273c4cd55d67c21f0/helia_edge/layers/preprocessing/random_background_noises.py#L56"
              },
              "summary": "Generate noise tensor"
            },
            {
              "description": "Augment single sample with random background noises.",
              "examples": [],
              "id": "helia_edge.layers.preprocessing.random_background_noises.RandomBackgroundNoises1D.augment_sample",
              "kind": "method",
              "language": "python",
              "members": [],
              "name": "augment_sample",
              "params": [],
              "raises": [],
              "returns": [],
              "signature": "augment_sample(inputs) -> keras.KerasTensor",
              "source": {
                "line": 96,
                "path": "helia_edge/layers/preprocessing/random_background_noises.py",
                "url": "https://github.com/AmbiqAI/helia-edge/blob/f341fb11f7f5d77a4974ba8273c4cd55d67c21f0/helia_edge/layers/preprocessing/random_background_noises.py#L96"
              },
              "summary": "Augment single sample with random background noises."
            },
            {
              "description": "Serializes the configuration of the layer.",
              "examples": [],
              "id": "helia_edge.layers.preprocessing.random_background_noises.RandomBackgroundNoises1D.get_config",
              "kind": "method",
              "language": "python",
              "members": [],
              "name": "get_config",
              "params": [],
              "raises": [],
              "returns": [],
              "signature": "get_config()",
              "source": {
                "line": 121,
                "path": "helia_edge/layers/preprocessing/random_background_noises.py",
                "url": "https://github.com/AmbiqAI/helia-edge/blob/f341fb11f7f5d77a4974ba8273c4cd55d67c21f0/helia_edge/layers/preprocessing/random_background_noises.py#L121"
              },
              "summary": "Serializes the configuration of the layer."
            }
          ],
          "name": "RandomBackgroundNoises1D",
          "params": [
            {
              "description": "Background noises to apply.",
              "name": "noises",
              "type": "np.ndarray"
            },
            {
              "default": "0.1",
              "description": "Amplitude of the noise. If tuple, amplitude is randomly picked between the values.",
              "name": "amplitude",
              "type": "float | tuple[float, float]"
            }
          ],
          "raises": [],
          "returns": [],
          "signature": "RandomBackgroundNoises1D(noises, amplitude: float | tuple[float, float] = 0.1, num_noises: int = 1, **kwargs={})",
          "source": {
            "line": 19,
            "path": "helia_edge/layers/preprocessing/random_background_noises.py",
            "url": "https://github.com/AmbiqAI/helia-edge/blob/f341fb11f7f5d77a4974ba8273c4cd55d67c21f0/helia_edge/layers/preprocessing/random_background_noises.py#L19"
          },
          "summary": "Apply random background noises to the input."
        }
      ]
    }
  ],
  "name": "helia_edge"
}
