ReduceParentMerger#
- class sdm.prior.ReduceParentMerger(aggr: HP[str] | str)#
Bases:
ParentMergerApply
random_fnto each parent and reduce the outputs.- forward(parent_values: Sequence[Tensor], random_fn: RandomFunction, out_channels: int, generator: Generator | None = None) Tensor#
Compute node values from parent values with
random_fn.- Parameters:
parent_values (Sequence[Tensor]) – Parent values with shape
[R, H]for rows and channels. Parents may have different numbers of channels.random_fn (RandomFunction) – Random function applied to the parent values.
out_channels (int) – Number of output channels.
generator (Generator | None) – Pseudorandom generator.
- Returns:
Node values with shape
[R, out_channels].- Return type: