pasteur.graph.loss.LinearObservation#

class pasteur.graph.loss.LinearObservation(source: tuple[AttrMeta, ...], mapping: ndarray | None, obs: ndarray, confidence: float)[source]#

Observations against which the loss is computed.

Mapping can be any differentiable function, but in this case we limit it to a matrix multiplication or none.

All cliques that superset completely the source clique will be adjusted to it, and matrix multiplied to mapping to produce the expected obs’. Then, the selected loss function will be applied to them.

confidence is a normalized value that signifies how trustworthy this observation is from [0, 1] and is used to scale the loss produced by the observation. It should be drawn from the expected SNR of the observation, given the expected sampling noise and the noise added by differential privacy.

The mapping size is very large (O(N^2) of the clique), so it should be avoided if possible. If set to None, a matrix multiplication is not performed.

Attributes

confidence

Alias for field number 3

mapping

Alias for field number 1

obs

Alias for field number 2

source

Alias for field number 0

Methods

count(value, /)

Return number of occurrences of value.

index(value[, start, stop])

Return first index of value.

confidence: float#

Alias for field number 3

count(value, /)#

Return number of occurrences of value.

index(value, start=0, stop=9223372036854775807, /)#

Return first index of value.

Raises ValueError if the value is not present.

mapping: ndarray | None#

Alias for field number 1

obs: ndarray#

Alias for field number 2

source: tuple[AttrMeta, ...]#

Alias for field number 0