sage.factory.testing

Filename : testing.py Description : Short description of the file

Created on 2026-03-28 01:53:48

__author__ = Narenraju Nagarajan __copyright__ = Copyright 2026, ProjectName __license__ = MIT Licence __version__ = 0.0.1 __maintainer__ = Narenraju Nagarajan __affiliation__ = N/A __email__ = N/A __status__ = [‘inProgress’, ‘Archived’, ‘inUsage’, ‘Debugging’]

GitHub Repository: NULL

Documentation: NULL

Classes

SageUncompiledTesting

Inference runner for offline testing on a pre-recorded data segment.

Module Contents

class SageUncompiledTesting(slicer, processor, model, trigger_threshold, batch_size, num_workers)[source]

Bases: torch.nn.Module

Inference runner for offline testing on a pre-recorded data segment.

Slides a trained Sage model over a continuous data segment using a DataLoader-backed slicer, applies the same preprocessing used during training, and collects triggers above trigger_threshold. Results (triggers, full network outputs, and slice times) are saved to HDF5 at cfg.export_dir/testing_data.h5.

This is the uncompiled version — suitable for export/analysis runs where torch.compile is not required. The compiled variant lives in CompiledValidationBlock.

Parameters:
  • slicer (torch.utils.data.Dataset) – Dataset that yields (x, slice_times) pairs for each data window.

  • processor (callable) – Preprocessing callable applied to each batch before the model.

  • model (torch.nn.Module) – Trained Sage model.

  • trigger_threshold (float) – Ranking-statistic threshold; only windows above this are saved as triggers.

  • batch_size (int) – DataLoader batch size.

  • num_workers (int) – Number of DataLoader worker processes.

  • state (Initialize internal Module)

  • ScriptModule. (shared by both nn.Module and)

cfg = None[source]
slicer[source]
processor[source]
model[source]
trigger_threshold[source]
batch_size[source]
num_workers[source]
forward()[source]