Skip to content

Add a latent space diagnostic notebook #250

@aranas

Description

@aranas

Problem / Goal

To aid model development we want visual diagnostics of intermediate layer activation in the sea ice prediction pipeline.

As a first target, we want to visualize the multimodal argo-float pipeline to provide evidence for the following research question:

Does incorporating Argo float observations shift the model's internal representation in a physically meaningful way and if so, at which layer does that shift first become detectable?

Initial demonstration of this diagnostic will be a standalone diagnostic notebook on a separate branch, integration into pipeline might follow at a later stage if diagnostic proves valuable.

What does good look like?

  • A latent_space_viz feature branch on the pipeline repo that adds an optional --save-activations flag to the inference CLI, which when set triggers hook registration before the forward pass and saves captured activations to disk as xarray datasets or tensors keyed by layer name and timestep.
  • A viz/hook_manager.py module that registers forward_hooks on named encoder/processor/decoder modules at runtime, captures activations as the forward pass executes, and writes them to the configured output path.
  • A notebooks/layer_diagnostics.ipynb notebook that orchestrates the full diagnostic by invoking the pipeline inference CLI via shell cells, once with argo float data, once without, both with --save-activations set and loads the resulting activation files for visualisation.

Not in scope

  • No changes to model code, configs, or data modules
  • No production integration, CLI tooling
  • No geographic projection or statistical analysis logic

Related context

#98

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions