image_representation¶
Image CNN input pipeline: pulses → pixels → grids / tensors.
- class graphnet.models.data_representation.images.image_representation.ImageRepresentation(*args, **kwargs)[source]¶
Bases:
DataRepresentationCompose a pixel definition with a detector grid for CNN inputs.
A
NodeDefinitionacts as pixel definition: pulsesXare aggregated into unordered pixel rowsP(the same abstraction as graph nodes, without requiring graph terminology for CNN users).A
GridDefinitiondefines detector-bound orthonormal grid shape(s) and lookup table(s); itsforward()scattersPinto image tensor(s).The
Detectoris taken fromgrid_definition.detectorso the grid matches the preprocessing geometry.Construct ImageRepresentation.
- Parameters:
pixel_definition (
NodeDefinition) – Pulse-level features → one row per pixel/DOM.grid_definition (
GridDefinition) – Pixel keys + voxel indices + scatter into images.input_feature_names (
Optional[List[str]], default:None) – Column names in raw pulse tables. If omitted, the detector’s feature list is used.dtype (
Optional[dtype], default:torch.float32) – Feature dtype (e.g.torch.float).perturbation_dict (
Optional[Dict[str,float]], default:None) – Optional feature noise (seeDataRepresentation).seed (
Union[int,Generator,None], default:None) – RNG for perturbations.add_inactive_sensors (
bool, default:False) – Pad inactive sensors when True.sensor_mask (
Optional[List[int]], default:None) – Drop these sensor IDs.string_mask (
Optional[List[int]], default:None) – Drop these string IDs.args (Any)
kwargs (Any)
- Return type:
object
Note
pixel_definitionoutput columns must match whatgrid_definitionexpects (including key fields inGridDefinition.map_pixels_by).- property shape: List[List[int]]¶
Channel-spatial layout per image tensor (see
GridDefinition).
- forward(input_features, input_feature_names, truth_dicts, custom_label_functions, loss_weight_column, loss_weight, loss_weight_default_value, data_path)[source]¶
Build a
Dataobject with image tensor(s) onx.- Return type:
Data- Parameters:
input_features (ndarray)
input_feature_names (List[str])
truth_dicts (List[Dict[str, Any]] | None)
custom_label_functions (Dict[str, Callable[[...], Any]] | None)
loss_weight_column (str | None)
loss_weight (float | None)
loss_weight_default_value (float | None)
data_path (str | None)