Array Output Configuration

Complete configuration guide for multi-dimensional array and tensor output tasks.

Overview

Array outputs handle multi-dimensional predictions including:

  • Image generation - Synthetic image creation

  • Signal reconstruction - Audio, sensor data reconstruction

  • Multi-dimensional regression - Tensor-valued predictions

  • Structured output - Grid-based predictions

Quick Example

output_info:
  output_source: "my/array/output/folder/"
  output_name: "reconstructed_signal"
  output_type: "array"
output_type_info:
  output_dimensions: [128, 128]
model_config:
  model_type: "array"
  model_init_config:
    fc_repr_dim: 512

Output Type Configuration

class eir.setup.schema_modules.output_schemas_array.ArrayOutputTypeConfig(
normalization: Literal['element', 'channel'] | None = 'channel',
adaptive_normalization_max_samples: int | None = None,
loss: Literal['mse', 'diffusion', 'categorical'] = 'mse',
diffusion_time_steps: int | None = 500,
diffusion_beta_schedule: Literal['linear', 'scaled_linear', 'squaredcos_cap_v2', 'sigmoid'] = 'linear',
)
Parameters:
  • normalization – Which type of normalization to apply to the array data. If element, will normalize each element in the array independently. If channel, will normalize each channel in the array independently. For ‘channel’, assumes PyTorch format where the channel dimension is the first dimension.

  • adaptive_normalization_max_samples – If using adaptive normalization (channel / element), how many samples to use to compute the normalization parameters. If None, will use all samples.

  • loss – Which loss to use for training the model. One of mse, diffusion or categorical. If categorical, the model will be trained to predict discrete classes for each element in the array.

  • diffusion_time_steps – Number of time steps to use for diffusion loss. Only used if loss is set to diffusion.

  • diffusion_beta_schedule

    Scheduler type to use for the diffusion process. Options are:

    • linear

    • scaled_linear

    • squaredcos_cap_v2

    • sigmoid

Output Module Configuration

class eir.models.output.array.array_output_modules.ArrayOutputModuleConfig(
model_type: Literal['lcl', 'cnn', 'cnn-passthrough'],
model_init_config: LCLOutputModelConfig | CNNUpscaleModelConfig,
pre_normalization: Literal['instancenorm', 'layernorm'] | None = None,
)
Parameters:
  • model_type – Which type of image model to use.

  • model_init_config – Configuration used to initialise model.

Output Sampling Configuration

class eir.setup.schema_modules.output_schemas_array.ArrayOutputSamplingConfig(
manual_inputs: Sequence[dict[str, str]] = (),
n_eval_inputs: int = 10,
diffusion_inference_steps: int = 500,
diffusion_sampler: Literal['ddpm', 'ddim', 'dpm_solver'] = 'ddpm',
diffusion_eta: float = 0.2,
)
Parameters:
  • manual_inputs

    Manually specified inputs to use for sequence generation. This is useful if you want to generate sequences based on a specific input. Depending on the input type, different formats are expected:

    • sequence: A string written directly in the .yaml file.

    • omics: A file path to NumPy array of shape (3, n_SNPs) on disk.

    • image: An image file path on disk.

    • tabular: A mapping of (column key: value) written directly in the .yaml file.

    • array: A file path to NumPy array on disk.

    • bytes: A file path to a file on disk.

  • n_eval_inputs – The number of inputs automatically sampled from the validation set for sequence generation.

  • diffusion_inference_steps – The number of steps for the diffusion process.

  • diffusion_sampler

    The type of scheduler to use for the diffusion process. Options are:

    • ddpm

    • ddim

    • dpm_solver

  • diffusion_eta – Parameter that controls the amount of noise added during the sampling process. Only used when diffusion_scheduler_type is "ddim".