Description
For recurrent cells such as the following:
the features
argument of the constructor is redundant: It can be inferred from the carry
input to its __call__
method. (The only cell that currently uses self.features
in its __call__
method is ConvLSTMCell
, which ought to be modified to infer it from its carry
input.)
For each cell, the only place where self.features
is needed is in the initialize_carry
method. But in many models, the initial carry comes from "upstream" in the model, so this method is never used.
Proposal:
-
Edit
ConvLSTMCell
to inferfeatures
in its__call__
method from itscarry
input. -
Set
features=None
by default in each cell's constructor. -
Add the following line to each
initialize_carry
method:
assert self.features is not None, "features cannot be None when calling initialize_carry"
I can submit a PR for this, if desired.
An alternative would be to pass features
directly to the initialize_carry
method.