Delayed, noisy channels¤
feedbax.channel.ChannelState
(Module)
¤
Type of state PyTree operated on by Channel
instances.
Attributes:
Name | Type | Description |
---|---|---|
output |
PyTree[Array, T]
|
The current output of the channel. |
queue |
Tuple[Optional[PyTree[Array, T]], ...]
|
A tuple of previous inputs to the channel, with the most recent appearing last. |
noise |
PyTree[Array, T]
|
The noise added to the current output, if any. |
feedbax.channel.ChannelSpec
(Module, Generic[StateT])
¤
Specifies how to build a Channel
, with respect to the state PyTree of its owner.
Attributes:
Name | Type | Description |
---|---|---|
where |
Callable[[StateT], PyTree[Array]]
|
A function that selects the subtree of feedback states. |
delay |
int
|
The number of previous inputs to store in the queue. |
noise_std |
int
|
The standard deviation of the noise to add to the output. |
feedbax.channel.Channel
(AbstractStagedModel[ChannelState])
¤
A noisy queue.
Note
This can be used for modeling an axon, tract, wire, or other delayed and semi-reliable connection between model components.
Attributes:
Name | Type | Description |
---|---|---|
delay |
int
|
The number of previous inputs stored in the queue. May be zero. |
noise_std |
int
|
The standard deviation of the noise added to the output.
If |
input_proto |
PyTree[Array]
|
A PyTree of arrays with the same structure/shapes as the inputs to the channel will have. |
intervenors |
ModelIntervenors[ChannelState]
|
Intervenors to add to the model at construction time. |
model_spec: OrderedDict[str, ModelStage[Self, ChannelState]]
property
¤
Returns an OrderedDict
that specifies the stages of the channel model.
Always includes a queue input-output stage. Optionally includes
a stage that adds noise to the output, if noise_std
was not
None
at construction time.
__call__
(
input
: ModelInput
,
state
: StateT
,
key
: PRNGKeyArray
)
->
StateT
¤
__call__
(
input
: ModelInput
,
state
: StateT
,
key
: PRNGKeyArray
)
->
StateT
Inherited from feedbax._staged.AbstractStagedModel
state_consistency_update
(
state
: StateT
)
->
StateT
¤
state_consistency_update
(
state
: StateT
)
->
StateT
Inherited from feedbax._model.AbstractModel
init
(
*,
key
: PRNGKeyArray
)
->
ChannelState
¤
init
(
*,
key
: PRNGKeyArray
)
->
ChannelState
Returns an empty ChannelState
for the channel.
change_input
(
input_proto
: PyTree[Array]
)
->
Channel
¤
change_input
(
input_proto
: PyTree[Array]
)
->
Channel
Returns a similar Channel
with a changed input structure.