Skip to content
This repository has been archived by the owner on Jul 1, 2023. It is now read-only.

Improve RNN cell abstraction. #86

Merged
merged 1 commit into from
Apr 13, 2019
Merged

Conversation

rxwei
Copy link
Contributor

@rxwei rxwei commented Apr 13, 2019

The existing RNNCell protocol and RNNInput type are not flexible in that each time step has the take both the previous output and the hidden state. This PR lifts that restriction.

  • Rename RNNInput to RNNCellInput so that it's more accurate.
  • Add a new RNNCellOutput generic structure type that stores an output and a state.
  • Add associated type State in RNNCell.
  • Make the Output type of RNNCell be RNNOutput<TimeStepOutput, State>.

Thanks @superbobry for the suggestions.

The existing `RNNCell` protocol and `RNNInput` type are not flexible in that each time step has the take both the previous output and the hidden state. This PR lifts that restriction.

* Rename `RNNInput` to `RNNCellInput` so that it's more accurate.
* Add a new `RNNCellOutput` generic structure type that stores an output and a state.
* Add associated type `State` in `RNNCell`.
* Make the `Output` type of `RNNCell` be `RNNOutput<TimeStepOutput, State>`.

Thanks @superbobry for the suggestions.
@rxwei
Copy link
Contributor Author

rxwei commented Apr 13, 2019

@superbobry @tanmayb123 @eaplatanios Please review when you get a chance.

@eaplatanios
Copy link
Contributor

Thanks Richard! This looks good to me.

@rxwei rxwei merged commit 861d1f5 into tensorflow:master Apr 13, 2019
@rxwei rxwei deleted the better-rnn-cell branch April 13, 2019 20:01
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants