HNSSpoke
Bases: tf.keras.layers.Layer
A spoke in the hub-and-spokes model with time-averaging output.
This layer is a thin wrapper around MultiInputTimeAveraging, The differences are:
- Catering for
Noneinput by explicitly definingunits. - For clarity, in
call(), separating the original list of inputs into the clamped input:inputsand last states:last_states.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
tau |
float
|
Time-averaging parameter, from 0 to 1. |
required |
units |
int
|
Number of units in the layer. Explicitly set the input dimension to cater for |
required |
activation |
str
|
Activation function to use. |
'sigmoid'
|
use_bias |
bool
|
Whether the layer uses a bias vector. |
True
|
kwargs |
dict
|
Additional keyword arguments passed to MultiInputTimeAveraging. |
{}
|
Forward pass:
Warning
"" is element-wise multiplication.
- : activation at time .
- : time constant, smaller means slower temporal dynamics.
- : activation function (provided by this layer if
activationis used). - : input at time coming from input .
- : last state from at time .
- : number of cross-tick state layers.
- : bias vector, provided by this layer if
use_biasisTrue(Default). - : time-averaging state at time , stored in
self.time_averaging.states.
call(inputs=None, last_states=None)
Forward pass.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
inputs |
tf.Tensor
|
clamped inputs to spoke. |
None
|
last_states |
List[tf.Tensor]
|
list of states from last ticks projection: . |
None
|
reset_states()
Reset time-averaging states.