Skip to content

Make redundant features argument optional for recurrent cells  #3717

Open
@carlosgmartin

Description

@carlosgmartin

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:

  1. Edit ConvLSTMCell to infer features in its __call__ method from its carry input.

  2. Set features=None by default in each cell's constructor.

  3. 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Priority: P2 - no scheduleBest effort response and resolution. We have no plan to work on this at the moment.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions