MultiTargetFit

class nyx.infer.multitarget.MultiTargetFit[source]

Bases: Module

Joint fit over several targets with shared instruments.

Instruments of the same name across scenes are linked: their non-per-obs Parameters live once in canonical_instruments and are injected into every scene at render time, so their gradients sum over targets.

Parameters:
  • scenes (dict of str to Scene) – One pre-built Scene per target.

  • share (str or iterable of str, optional) – Scene fields to link across targets, from 'atmosphere' and 'sources'. A linked field must have the same structure and Parameter shapes in every scene.

Attributes Summary

canonical_fields

canonical_instruments

instrument_names

Names of the shared instruments.

target_names

Names of the fitted targets.

target_scenes

Methods Summary

dump_params()

Physical value of every fitted Parameter.

parameters_table()

Table of every fitted Parameter.

render()

Render all targets.

set(path, value)

Set one parameter by name; see set_params().

set_params(params)

Set parameters by the names parameters_table() prints.

Attributes Documentation

canonical_fields = <dataclasses._MISSING_TYPE object>
canonical_instruments = <dataclasses._MISSING_TYPE object>
instrument_names

Names of the shared instruments.

Return type:

tuple of str

target_names

Names of the fitted targets.

Return type:

tuple of str

target_scenes = <dataclasses._MISSING_TYPE object>

Methods Documentation

dump_params()[source]

Physical value of every fitted Parameter.

Return type:

dict of str to numpy.ndarray

parameters_table()[source]

Table of every fitted Parameter.

Return type:

ParametersTable

render()[source]

Render all targets.

Returns:

Keyed by target name, then instrument name.

Return type:

dict of str to dict of str to jax.Array

set(path, value)[source]

Set one parameter by name; see set_params().

Parameters:
  • path (str)

  • value (array-like)

Return type:

MultiTargetFit

set_params(params)[source]

Set parameters by the names parameters_table() prints.

Parameters:

params (dict of str to array-like) – Names or glob patterns, as freeze() takes. A raw value is wrapped preserving the target’s metadata.

Return type:

MultiTargetFit

__init__(scenes, share=())[source]
static __new__(cls, *args, **kwargs)