pyphi.substrate_generator.mechanism_combinations.composite#
- pyphi.substrate_generator.mechanism_combinations.composite(sub_specs, combination='selective', **combination_kwargs)[source]#
Build a composite unit function from sub-mechanism specs.
- Parameters:
sub_specs (Iterable[Mapping]) – An iterable of dicts, each
{"mechanism": name | callable, "inputs": tuple[int] | None, "params": dict}. Each sub-mechanism is evaluated at the full from-state and reads its owninputs.combination (str or Callable, optional) – A name in
MECHANISM_COMBINATIONSor a callable mapping a sequence of probabilities to a single probability. Defaults to"selective".**combination_kwargs – Passed to the combination strategy (e.g.
steepness/offsetforfirst_necessary).
- Returns:
Callable – A unit function
f(element, weights, state, **kwargs) -> floatwhose value is the combined probability of its sub-mechanisms.- Raises:
TypeError – If a sub-spec has a key other than
mechanism,inputsandparams, orparamsorcombination_kwargsnames an option the mechanism or combination does not take. A callable that accepts any keyword is not checked.