Weights & Biases Logging

gene_calling_benchmark.log_benchmark_scalars(results, step=None, method_prefix=None)[source]

Log scalar benchmark metrics to an active W&B run.

Designed for online evaluation during training: call this after each evaluation batch with a lightweight subset of metrics.

Parameters:
  • results (dict) – Aggregated result dict from benchmark_from_arrays(). Can contain any subset of metrics.

  • step (int | None) – Training step or epoch number. If None, W&B uses its internal step counter.

  • method_prefix (str | None) – Optional prefix to namespace the metrics (e.g., "val").

Returns:

The flat dict that was logged, for inspection or further use.

Return type:

dict[str, float]

gene_calling_benchmark.log_benchmark_all_scalars(results, step=None, method_prefix=None)[source]

Log every numeric scalar in the benchmark result to an active W&B run.

Unlike log_benchmark_scalars() (which logs a curated high-signal subset), this function flattens the entire result dict recursively. Suitable for final evaluation runs or post-training analysis where logging cost is not a concern.

Parameters:
  • results (dict) – Aggregated result dict from benchmark_from_arrays(). Pipeline wrapper {"aggregated": ..., "global": ...} is also accepted.

  • step (int | None) – Training step or epoch number.

  • method_prefix (str | None) – Optional prefix to namespace the metrics (e.g., "final").

Returns:

The flat dict that was logged.

Return type:

dict[str, float]

gene_calling_benchmark.log_benchmark_media(results, label_config, step=None, method_prefix=None)[source]

Log all diagnostic plots to W&B as stepwise media history.

Renders every figure produced by the benchmark plotting layer and logs them all as W&B Image panels. A focused subset of high-value figures (listed in _VIDEO_BUFFER_FIGURE_KEYS) is also buffered for later animation via log_benchmark_media_videos().

Parameters:
  • results (dict) – Aggregated benchmark result dict from benchmark_from_arrays(). A pipeline-style wrapper {"aggregated": ..., "global": ...} is also accepted.

  • label_config (LabelConfig) – Label semantics for plot labelling.

  • step (int | None) – Training step or epoch number for W&B media history.

  • method_prefix (str | None) – Optional namespace prefix such as "val".

Returns:

The logged W&B media payload (keys are W&B panel paths).

Return type:

dict[str, Any]

gene_calling_benchmark.log_benchmark_media_videos()[source]

Log the active run’s buffered media histories as W&B videos and drop them.

Only the current run’s frames are flushed, so in a sweep each run animates its own history; other runs’ buffers (if any share the process) are left untouched for those runs to flush.

Return type:

dict[str, Any]

gene_calling_benchmark.clear_benchmark_media_video_buffer()[source]

Drop all buffered media frames (every run) without logging them.

Return type:

None

gene_calling_benchmark.init_wandb_with_presets(project, run_name, config=None, **wandb_init_kwargs)[source]

Initialise a W&B run with pre-configured metric groupings.

Calls wandb.init() and then wandb.define_metric() to set up dashboard sections grouped by metric family. This ensures that every new run gets an organised dashboard out of the box.

Parameters:
  • project (str) – W&B project name.

  • run_name (str) – Display name for this run.

  • config (dict | None) – Extra configuration to attach to the W&B run (e.g., hyperparameters).

  • **wandb_init_kwargs – Additional keyword arguments forwarded to wandb.init().

Returns:

The initialised run object.

Return type:

Any