{
  "$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": "# TQDMProgressBar",
      "name": "tqdm_progress_bar",
      "path": "helia_edge.callbacks.tqdm_progress_bar",
      "submodules": [],
      "summary": "TQDMProgressBar",
      "symbols": [
        {
          "description": "TQDM Progress Bar callback.\n\nExample:\n\n```python\n\nimport time\nimport helia_edge as helia\n\n# Create a TQDM progress bar\npb_callback = helia.callbacks.TQDMProgressBar(\n    overall_bar_format=\"{l_bar}{bar} {n_fmt}/{total_fmt},  {rate_fmt}{postfix}\",\n    epoch_bar_format=\"{n_fmt}/{total_fmt}{bar} - {desc}\",\n    metrics_format=\"{name}: {value:0.4f}\",\n    update_per_second=10,\n    leave_epoch_progress=True,\n)\n\n# Simulate training\nepochs = 10\nsteps = 5\npb_callback.set_params(dict(epochs=epochs, steps=steps))\npb_callback.on_train_begin()\nloss = 1.0\naccuracy = 0.0\nfor epoch in range(epochs):\n    pb_callback.on_epoch_begin(epoch)\n    for step in range(steps):\n        loss -= epoch * step / (epochs * steps)\n        accuracy += epoch * step / (epochs * steps)\n        pb_callback.on_batch_end(step, {\"loss\": loss, \"accuracy\": accuracy})\n        time.sleep(0.1)\n    pb_callback.on_epoch_end(epoch, {\"loss\": loss, \"accuracy\": accuracy})\npb_callback.on_train_end()\n```",
          "examples": [],
          "id": "helia_edge.callbacks.tqdm_progress_bar.TQDMProgressBar",
          "kind": "class",
          "language": "python",
          "members": [
            {
              "description": "",
              "examples": [],
              "id": "helia_edge.callbacks.tqdm_progress_bar.TQDMProgressBar.metrics_separator",
              "kind": "attribute",
              "language": "python",
              "members": [],
              "name": "metrics_separator",
              "params": [],
              "raises": [],
              "returns": [],
              "signature": "metrics_separator = metrics_separator",
              "source": {
                "line": 85,
                "path": "helia_edge/callbacks/tqdm_progress_bar.py",
                "url": "https://github.com/AmbiqAI/helia-edge/blob/f341fb11f7f5d77a4974ba8273c4cd55d67c21f0/helia_edge/callbacks/tqdm_progress_bar.py#L85"
              },
              "summary": ""
            },
            {
              "description": "",
              "examples": [],
              "id": "helia_edge.callbacks.tqdm_progress_bar.TQDMProgressBar.overall_bar_format",
              "kind": "attribute",
              "language": "python",
              "members": [],
              "name": "overall_bar_format",
              "params": [],
              "raises": [],
              "returns": [],
              "signature": "overall_bar_format = overall_bar_format",
              "source": {
                "line": 86,
                "path": "helia_edge/callbacks/tqdm_progress_bar.py",
                "url": "https://github.com/AmbiqAI/helia-edge/blob/f341fb11f7f5d77a4974ba8273c4cd55d67c21f0/helia_edge/callbacks/tqdm_progress_bar.py#L86"
              },
              "summary": ""
            },
            {
              "description": "",
              "examples": [],
              "id": "helia_edge.callbacks.tqdm_progress_bar.TQDMProgressBar.epoch_bar_format",
              "kind": "attribute",
              "language": "python",
              "members": [],
              "name": "epoch_bar_format",
              "params": [],
              "raises": [],
              "returns": [],
              "signature": "epoch_bar_format = epoch_bar_format",
              "source": {
                "line": 87,
                "path": "helia_edge/callbacks/tqdm_progress_bar.py",
                "url": "https://github.com/AmbiqAI/helia-edge/blob/f341fb11f7f5d77a4974ba8273c4cd55d67c21f0/helia_edge/callbacks/tqdm_progress_bar.py#L87"
              },
              "summary": ""
            },
            {
              "description": "",
              "examples": [],
              "id": "helia_edge.callbacks.tqdm_progress_bar.TQDMProgressBar.leave_epoch_progress",
              "kind": "attribute",
              "language": "python",
              "members": [],
              "name": "leave_epoch_progress",
              "params": [],
              "raises": [],
              "returns": [],
              "signature": "leave_epoch_progress = leave_epoch_progress",
              "source": {
                "line": 88,
                "path": "helia_edge/callbacks/tqdm_progress_bar.py",
                "url": "https://github.com/AmbiqAI/helia-edge/blob/f341fb11f7f5d77a4974ba8273c4cd55d67c21f0/helia_edge/callbacks/tqdm_progress_bar.py#L88"
              },
              "summary": ""
            },
            {
              "description": "",
              "examples": [],
              "id": "helia_edge.callbacks.tqdm_progress_bar.TQDMProgressBar.leave_overall_progress",
              "kind": "attribute",
              "language": "python",
              "members": [],
              "name": "leave_overall_progress",
              "params": [],
              "raises": [],
              "returns": [],
              "signature": "leave_overall_progress = leave_overall_progress",
              "source": {
                "line": 89,
                "path": "helia_edge/callbacks/tqdm_progress_bar.py",
                "url": "https://github.com/AmbiqAI/helia-edge/blob/f341fb11f7f5d77a4974ba8273c4cd55d67c21f0/helia_edge/callbacks/tqdm_progress_bar.py#L89"
              },
              "summary": ""
            },
            {
              "description": "",
              "examples": [],
              "id": "helia_edge.callbacks.tqdm_progress_bar.TQDMProgressBar.show_epoch_progress",
              "kind": "attribute",
              "language": "python",
              "members": [],
              "name": "show_epoch_progress",
              "params": [],
              "raises": [],
              "returns": [],
              "signature": "show_epoch_progress = show_epoch_progress",
              "source": {
                "line": 90,
                "path": "helia_edge/callbacks/tqdm_progress_bar.py",
                "url": "https://github.com/AmbiqAI/helia-edge/blob/f341fb11f7f5d77a4974ba8273c4cd55d67c21f0/helia_edge/callbacks/tqdm_progress_bar.py#L90"
              },
              "summary": ""
            },
            {
              "description": "",
              "examples": [],
              "id": "helia_edge.callbacks.tqdm_progress_bar.TQDMProgressBar.show_overall_progress",
              "kind": "attribute",
              "language": "python",
              "members": [],
              "name": "show_overall_progress",
              "params": [],
              "raises": [],
              "returns": [],
              "signature": "show_overall_progress = show_overall_progress",
              "source": {
                "line": 91,
                "path": "helia_edge/callbacks/tqdm_progress_bar.py",
                "url": "https://github.com/AmbiqAI/helia-edge/blob/f341fb11f7f5d77a4974ba8273c4cd55d67c21f0/helia_edge/callbacks/tqdm_progress_bar.py#L91"
              },
              "summary": ""
            },
            {
              "description": "",
              "examples": [],
              "id": "helia_edge.callbacks.tqdm_progress_bar.TQDMProgressBar.metrics_format",
              "kind": "attribute",
              "language": "python",
              "members": [],
              "name": "metrics_format",
              "params": [],
              "raises": [],
              "returns": [],
              "signature": "metrics_format = metrics_format",
              "source": {
                "line": 92,
                "path": "helia_edge/callbacks/tqdm_progress_bar.py",
                "url": "https://github.com/AmbiqAI/helia-edge/blob/f341fb11f7f5d77a4974ba8273c4cd55d67c21f0/helia_edge/callbacks/tqdm_progress_bar.py#L92"
              },
              "summary": ""
            },
            {
              "description": "",
              "examples": [],
              "id": "helia_edge.callbacks.tqdm_progress_bar.TQDMProgressBar.update_interval",
              "kind": "attribute",
              "language": "python",
              "members": [],
              "name": "update_interval",
              "params": [],
              "raises": [],
              "returns": [],
              "signature": "update_interval = 1 / update_per_second",
              "source": {
                "line": 95,
                "path": "helia_edge/callbacks/tqdm_progress_bar.py",
                "url": "https://github.com/AmbiqAI/helia-edge/blob/f341fb11f7f5d77a4974ba8273c4cd55d67c21f0/helia_edge/callbacks/tqdm_progress_bar.py#L95"
              },
              "summary": ""
            },
            {
              "description": "",
              "examples": [],
              "id": "helia_edge.callbacks.tqdm_progress_bar.TQDMProgressBar.last_update_time",
              "kind": "attribute",
              "language": "python",
              "members": [],
              "name": "last_update_time",
              "params": [],
              "raises": [],
              "returns": [],
              "signature": "last_update_time = time.time()",
              "source": {
                "line": 97,
                "path": "helia_edge/callbacks/tqdm_progress_bar.py",
                "url": "https://github.com/AmbiqAI/helia-edge/blob/f341fb11f7f5d77a4974ba8273c4cd55d67c21f0/helia_edge/callbacks/tqdm_progress_bar.py#L97"
              },
              "summary": ""
            },
            {
              "description": "",
              "examples": [],
              "id": "helia_edge.callbacks.tqdm_progress_bar.TQDMProgressBar.overall_progress_tqdm",
              "kind": "attribute",
              "language": "python",
              "members": [],
              "name": "overall_progress_tqdm",
              "params": [],
              "raises": [],
              "returns": [],
              "signature": "overall_progress_tqdm = None",
              "source": {
                "line": 98,
                "path": "helia_edge/callbacks/tqdm_progress_bar.py",
                "url": "https://github.com/AmbiqAI/helia-edge/blob/f341fb11f7f5d77a4974ba8273c4cd55d67c21f0/helia_edge/callbacks/tqdm_progress_bar.py#L98"
              },
              "summary": ""
            },
            {
              "description": "",
              "examples": [],
              "id": "helia_edge.callbacks.tqdm_progress_bar.TQDMProgressBar.epoch_progress_tqdm",
              "kind": "attribute",
              "language": "python",
              "members": [],
              "name": "epoch_progress_tqdm",
              "params": [],
              "raises": [],
              "returns": [],
              "signature": "epoch_progress_tqdm = None",
              "source": {
                "line": 99,
                "path": "helia_edge/callbacks/tqdm_progress_bar.py",
                "url": "https://github.com/AmbiqAI/helia-edge/blob/f341fb11f7f5d77a4974ba8273c4cd55d67c21f0/helia_edge/callbacks/tqdm_progress_bar.py#L99"
              },
              "summary": ""
            },
            {
              "description": "",
              "examples": [],
              "id": "helia_edge.callbacks.tqdm_progress_bar.TQDMProgressBar.is_training",
              "kind": "attribute",
              "language": "python",
              "members": [],
              "name": "is_training",
              "params": [],
              "raises": [],
              "returns": [],
              "signature": "is_training = False",
              "source": {
                "line": 100,
                "path": "helia_edge/callbacks/tqdm_progress_bar.py",
                "url": "https://github.com/AmbiqAI/helia-edge/blob/f341fb11f7f5d77a4974ba8273c4cd55d67c21f0/helia_edge/callbacks/tqdm_progress_bar.py#L100"
              },
              "summary": ""
            },
            {
              "description": "",
              "examples": [],
              "id": "helia_edge.callbacks.tqdm_progress_bar.TQDMProgressBar.num_epochs",
              "kind": "attribute",
              "language": "python",
              "members": [],
              "name": "num_epochs",
              "params": [],
              "raises": [],
              "returns": [],
              "signature": "num_epochs = None",
              "source": {
                "line": 101,
                "path": "helia_edge/callbacks/tqdm_progress_bar.py",
                "url": "https://github.com/AmbiqAI/helia-edge/blob/f341fb11f7f5d77a4974ba8273c4cd55d67c21f0/helia_edge/callbacks/tqdm_progress_bar.py#L101"
              },
              "summary": ""
            },
            {
              "description": "",
              "examples": [],
              "id": "helia_edge.callbacks.tqdm_progress_bar.TQDMProgressBar.logs",
              "kind": "attribute",
              "language": "python",
              "members": [],
              "name": "logs",
              "params": [],
              "raises": [],
              "returns": [],
              "signature": "logs = None",
              "source": {
                "line": 102,
                "path": "helia_edge/callbacks/tqdm_progress_bar.py",
                "url": "https://github.com/AmbiqAI/helia-edge/blob/f341fb11f7f5d77a4974ba8273c4cd55d67c21f0/helia_edge/callbacks/tqdm_progress_bar.py#L102"
              },
              "summary": ""
            },
            {
              "description": "",
              "examples": [],
              "id": "helia_edge.callbacks.tqdm_progress_bar.TQDMProgressBar.on_train_begin",
              "kind": "method",
              "language": "python",
              "members": [],
              "name": "on_train_begin",
              "params": [],
              "raises": [],
              "returns": [],
              "signature": "on_train_begin(logs=None)",
              "source": {
                "line": 191,
                "path": "helia_edge/callbacks/tqdm_progress_bar.py",
                "url": "https://github.com/AmbiqAI/helia-edge/blob/f341fb11f7f5d77a4974ba8273c4cd55d67c21f0/helia_edge/callbacks/tqdm_progress_bar.py#L191"
              },
              "summary": ""
            },
            {
              "description": "",
              "examples": [],
              "id": "helia_edge.callbacks.tqdm_progress_bar.TQDMProgressBar.on_train_end",
              "kind": "method",
              "language": "python",
              "members": [],
              "name": "on_train_end",
              "params": [],
              "raises": [],
              "returns": [],
              "signature": "on_train_end(logs={})",
              "source": {
                "line": 195,
                "path": "helia_edge/callbacks/tqdm_progress_bar.py",
                "url": "https://github.com/AmbiqAI/helia-edge/blob/f341fb11f7f5d77a4974ba8273c4cd55d67c21f0/helia_edge/callbacks/tqdm_progress_bar.py#L195"
              },
              "summary": ""
            },
            {
              "description": "",
              "examples": [],
              "id": "helia_edge.callbacks.tqdm_progress_bar.TQDMProgressBar.on_test_begin",
              "kind": "method",
              "language": "python",
              "members": [],
              "name": "on_test_begin",
              "params": [],
              "raises": [],
              "returns": [],
              "signature": "on_test_begin(logs={})",
              "source": {
                "line": 199,
                "path": "helia_edge/callbacks/tqdm_progress_bar.py",
                "url": "https://github.com/AmbiqAI/helia-edge/blob/f341fb11f7f5d77a4974ba8273c4cd55d67c21f0/helia_edge/callbacks/tqdm_progress_bar.py#L199"
              },
              "summary": ""
            },
            {
              "description": "",
              "examples": [],
              "id": "helia_edge.callbacks.tqdm_progress_bar.TQDMProgressBar.on_test_end",
              "kind": "method",
              "language": "python",
              "members": [],
              "name": "on_test_end",
              "params": [],
              "raises": [],
              "returns": [],
              "signature": "on_test_end(logs={})",
              "source": {
                "line": 203,
                "path": "helia_edge/callbacks/tqdm_progress_bar.py",
                "url": "https://github.com/AmbiqAI/helia-edge/blob/f341fb11f7f5d77a4974ba8273c4cd55d67c21f0/helia_edge/callbacks/tqdm_progress_bar.py#L203"
              },
              "summary": ""
            },
            {
              "description": "",
              "examples": [],
              "id": "helia_edge.callbacks.tqdm_progress_bar.TQDMProgressBar.on_epoch_begin",
              "kind": "method",
              "language": "python",
              "members": [],
              "name": "on_epoch_begin",
              "params": [],
              "raises": [],
              "returns": [],
              "signature": "on_epoch_begin(epoch, logs={})",
              "source": {
                "line": 207,
                "path": "helia_edge/callbacks/tqdm_progress_bar.py",
                "url": "https://github.com/AmbiqAI/helia-edge/blob/f341fb11f7f5d77a4974ba8273c4cd55d67c21f0/helia_edge/callbacks/tqdm_progress_bar.py#L207"
              },
              "summary": ""
            },
            {
              "description": "",
              "examples": [],
              "id": "helia_edge.callbacks.tqdm_progress_bar.TQDMProgressBar.on_epoch_end",
              "kind": "method",
              "language": "python",
              "members": [],
              "name": "on_epoch_end",
              "params": [],
              "raises": [],
              "returns": [],
              "signature": "on_epoch_end(epoch, logs={})",
              "source": {
                "line": 210,
                "path": "helia_edge/callbacks/tqdm_progress_bar.py",
                "url": "https://github.com/AmbiqAI/helia-edge/blob/f341fb11f7f5d77a4974ba8273c4cd55d67c21f0/helia_edge/callbacks/tqdm_progress_bar.py#L210"
              },
              "summary": ""
            },
            {
              "description": "",
              "examples": [],
              "id": "helia_edge.callbacks.tqdm_progress_bar.TQDMProgressBar.on_test_batch_end",
              "kind": "method",
              "language": "python",
              "members": [],
              "name": "on_test_batch_end",
              "params": [],
              "raises": [],
              "returns": [],
              "signature": "on_test_batch_end(batch, logs={})",
              "source": {
                "line": 215,
                "path": "helia_edge/callbacks/tqdm_progress_bar.py",
                "url": "https://github.com/AmbiqAI/helia-edge/blob/f341fb11f7f5d77a4974ba8273c4cd55d67c21f0/helia_edge/callbacks/tqdm_progress_bar.py#L215"
              },
              "summary": ""
            },
            {
              "description": "",
              "examples": [],
              "id": "helia_edge.callbacks.tqdm_progress_bar.TQDMProgressBar.on_batch_end",
              "kind": "method",
              "language": "python",
              "members": [],
              "name": "on_batch_end",
              "params": [],
              "raises": [],
              "returns": [],
              "signature": "on_batch_end(batch, logs={})",
              "source": {
                "line": 219,
                "path": "helia_edge/callbacks/tqdm_progress_bar.py",
                "url": "https://github.com/AmbiqAI/helia-edge/blob/f341fb11f7f5d77a4974ba8273c4cd55d67c21f0/helia_edge/callbacks/tqdm_progress_bar.py#L219"
              },
              "summary": ""
            },
            {
              "description": "Format metrics in logs into a string.",
              "examples": [],
              "id": "helia_edge.callbacks.tqdm_progress_bar.TQDMProgressBar.format_metrics",
              "kind": "method",
              "language": "python",
              "members": [],
              "name": "format_metrics",
              "params": [
                {
                  "default": "{}",
                  "description": "dictionary of metrics and their values. Defaults to\nempty dictionary.",
                  "name": "logs",
                  "type": "dict"
                },
                {
                  "default": "1",
                  "description": "The factor we want to divide the metrics in logs\nby, useful when we are computing the logs after each batch.\nDefaults to 1.",
                  "name": "factor",
                  "type": "int"
                }
              ],
              "raises": [],
              "returns": [
                {
                  "description": "a string displaying metrics using the given",
                  "name": "metrics_string",
                  "type": "str"
                },
                {
                  "description": "formators passed in through the constructor.",
                  "type": "str"
                }
              ],
              "signature": "format_metrics(logs: dict = {}, factor=1) -> str",
              "source": {
                "line": 222,
                "path": "helia_edge/callbacks/tqdm_progress_bar.py",
                "url": "https://github.com/AmbiqAI/helia-edge/blob/f341fb11f7f5d77a4974ba8273c4cd55d67c21f0/helia_edge/callbacks/tqdm_progress_bar.py#L222"
              },
              "summary": "Format metrics in logs into a string."
            },
            {
              "description": "",
              "examples": [],
              "id": "helia_edge.callbacks.tqdm_progress_bar.TQDMProgressBar.get_config",
              "kind": "method",
              "language": "python",
              "members": [],
              "name": "get_config",
              "params": [],
              "raises": [],
              "returns": [],
              "signature": "get_config()",
              "source": {
                "line": 246,
                "path": "helia_edge/callbacks/tqdm_progress_bar.py",
                "url": "https://github.com/AmbiqAI/helia-edge/blob/f341fb11f7f5d77a4974ba8273c4cd55d67c21f0/helia_edge/callbacks/tqdm_progress_bar.py#L246"
              },
              "summary": ""
            }
          ],
          "name": "TQDMProgressBar",
          "params": [
            {
              "default": "' - '",
              "description": "Custom separator between metrics.\nDefaults to ' - '.",
              "name": "metrics_separator",
              "type": "str"
            },
            {
              "default": "'{l_bar}{bar} {n_fmt}/{total_fmt} ETA: {remaining}s,  {rate_fmt}{postfix}'",
              "description": "Custom bar format for overall\n(outer) progress bar, see https://github.com/tqdm/tqdm#parameters\nfor more detail.",
              "name": "overall_bar_format",
              "type": "str"
            },
            {
              "default": "'{n_fmt}/{total_fmt}{bar} ETA: {remaining}s - {desc}'",
              "description": "Custom bar format for epoch\n(inner) progress bar, see https://github.com/tqdm/tqdm#parameters\nfor more detail.",
              "name": "epoch_bar_format",
              "type": "str"
            },
            {
              "default": "10",
              "description": "Maximum number of updates in the epochs bar\nper second, this is to prevent small batches from slowing down\ntraining. Defaults to 10.",
              "name": "update_per_second",
              "type": "int"
            },
            {
              "default": "'{name}: {value:0.4f}'",
              "description": "Custom format for how metrics are formatted.\nSee https://github.com/tqdm/tqdm#parameters for more detail.",
              "name": "metrics_format",
              "type": "str"
            },
            {
              "default": "True",
              "description": "`True` to leave epoch progress bars.",
              "name": "leave_epoch_progress",
              "type": "bool"
            },
            {
              "default": "True",
              "description": "`True` to leave overall progress bar.",
              "name": "leave_overall_progress",
              "type": "bool"
            },
            {
              "default": "True",
              "description": "`False` to hide epoch progress bars.",
              "name": "show_epoch_progress",
              "type": "bool"
            },
            {
              "default": "True",
              "description": "`False` to hide overall progress bar.",
              "name": "show_overall_progress",
              "type": "bool"
            }
          ],
          "raises": [],
          "returns": [],
          "signature": "TQDMProgressBar(\n    metrics_separator: str = ' - ',\n    overall_bar_format: str = '{l_bar}{bar} {n_fmt}/{total_fmt} ETA: {remaining}s,  {rate_fmt}{postfix}',\n    epoch_bar_format: str = '{n_fmt}/{total_fmt}{bar} ETA: {remaining}s - {desc}',\n    metrics_format: str = '{name}: {value:0.4f}',\n    update_per_second: int = 10,\n    leave_epoch_progress: bool = True,\n    leave_overall_progress: bool = True,\n    show_epoch_progress: bool = True,\n    show_overall_progress: bool = True,\n)",
          "source": {
            "line": 15,
            "path": "helia_edge/callbacks/tqdm_progress_bar.py",
            "url": "https://github.com/AmbiqAI/helia-edge/blob/f341fb11f7f5d77a4974ba8273c4cd55d67c21f0/helia_edge/callbacks/tqdm_progress_bar.py#L15"
          },
          "summary": ""
        }
      ]
    }
  ],
  "name": "helia_edge"
}
