Closed ghost closed 1 year ago
The issue was just the InputLayer
in the absence of which both strategies above work.
Hi, I don't think that setting trainable to True or False makes any difference for ESN, due to the hardcoded setting in esn_cell.py for state matrix (self.recurrent_kernel), input matrix (self.kernel) and bias (self.bias). See the block starting at 159:
self.recurrent_kernel = self.add_weight(
name="recurrent_kernel",
shape=[self.units, self.units],
initializer=_esn_recurrent_initializer,
trainable=False,
dtype=self.dtype,
)
self.kernel = self.add_weight(
name="kernel",
shape=[input_size, self.units],
initializer=self.kernel_initializer,
trainable=False,
dtype=self.dtype,
)
if self.use_bias:
self.bias = self.add_weight(
name="bias",
shape=[self.units],
initializer=self.bias_initializer,
trainable=False,
dtype=self.dtype,
)
System information
Describe the bug
Setting
trainable
flag toFalse
for anESN
layer (to make the reservoir of the resulting echo state network fixed) in aKeras
model does not work. In particular, runningor
throws