pyphi.substrate_generator.mechanisms#
Library of unit mechanisms ported from Bjørn Juel’s substrate_modeler.
Each mechanism is a unit function with the signature
f(element, weights, state, **params) -> float returning the probability that
element is ON at the next step, given the substrate state at the current
step. This is the contract consumed by pyphi.substrate_generator.build_tpm()
(it is called once per from-state), so the assembled substrate TPM equals the
dynamic_tpm of the substrate_modeler library, in which the present state
equals the past state.
State-dependent mechanisms (the “endorsement” family — resonator(),
mismatch_corrector(), stabilized_sigmoid(), biased_sigmoid(),
modulated_sigmoid()) read the unit’s own current state, state[element].
They therefore require a self-loop (a nonzero weights[element, element]) so
that the dependency is represented in the connectivity matrix;
pyphi.substrate_generator.create_substrate() inserts it automatically.
resonator realizes the state-dependent coupling of the matching paper
(Mayner, Juel & Tononi), whose default weight_scale_mapping is the coupling
factor g(I_j, s_k) of that paper’s appendix.
Functions
|
Two-input AND truth table ( |
|
Sigmoid biased toward the last input unit's state: when the bias unit is OFF the activation is divided by the bias factor; when ON, the inactivation is divided by it. |
|
Single-input copy: output follows the input. |
|
Activation equal to the mean of the (binary) input states. |
|
Gabor-like detector: |
|
Activation equal to the rounded mean of the (binary) input states. |
|
Single-input corrector: when the unit and its input match, it relaxes toward 0.5 (biased by |
|
Pattern detector that responds strongly to mismatched inputs: weakly coupled to inputs matching its current state, strongly to unexpected ones. |
|
Sigmoid whose threshold and determinism are shifted by the number of active modulator inputs, scaled by the unit's own (Ising) state. |
|
Two-input OR truth table ( |
|
State-dependent endorsement: inputs that agree with the unit's own state are excitatory and amplified; disagreeing inputs are inhibitory. |
|
Logistic activation of the weighted input. |
|
Selective-OR detector: ON with probability |
|
Sigmoid whose modulators stabilize the unit's current state, more strongly the more modulators are active. |
|
Spin-weighted mean of the inputs, using the (normalized) input weights. |
|
Two-input XOR truth table ( |