neurovlm.core.runtime.NeuroVLMRuntime

neurovlm.core.runtime.NeuroVLMRuntime#

class neurovlm.core.runtime.NeuroVLMRuntime(*, spec, model, device, source, checkpoint=None, autoencoder=None, brain_projection=None, text_projection=None, text_encoder=None)[source]#

A resolved model pipeline with consistent tensor-level methods.

Use load_pipeline() instead of constructing this class directly. Methods that do not apply to the selected task raise a precise error.

Parameters:
  • spec (ModelSpec)

  • model (nn.Module)

  • device (torch.device)

  • source (str)

  • checkpoint (Path | None)

  • autoencoder (nn.Module | None)

  • brain_projection (nn.Module | None)

  • text_projection (nn.Module | None)

  • text_encoder (TextEncoder | None)

__init__(*, spec, model, device, source, checkpoint=None, autoencoder=None, brain_projection=None, text_projection=None, text_encoder=None)[source]#
Parameters:
  • spec (ModelSpec)

  • model (Module)

  • device (device)

  • source (str)

  • checkpoint (Path | None)

  • autoencoder (Module | None)

  • brain_projection (Module | None)

  • text_projection (Module | None)

  • text_encoder (Callable[[Any], Tensor] | None)

Return type:

None

Methods

__init__(*, spec, model, device, source[, ...])

decode(latent)

encode(brain)

encode_brain(brain)

encode_text(text_or_embedding)

generate(text_or_embedding)

reconstruct(brain)

retrieve(brain, text_or_embedding)

Return the full brain-by-text cosine-similarity matrix.

similarity(brain, text_or_embedding)

Return the full brain-by-text cosine-similarity matrix.