-
Notifications
You must be signed in to change notification settings - Fork 74.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
The current RNN implementation executes a user defined function (the call() method of subclasses of RNNCells) inside a tf.while() loop. Weight normalisation requires a one-time normalization of the transition matrices prior to entering the while loop. The following 2 edits have been made in tensorflow/python/ops to enable this functionality: - RNNCell now has a prepare() method. It does nothing as implemented in the base class - A call to cell.prepare() has been added just before entering _dynamic_rnn_loop() Subclasses of RNNCell may implement normalization in the cell's prepare() method. One implementation with BasicLSTMCell and associated tests have been added to contrib. Note that any wrappers to be used with a weight-normalized cell need to be appropriately subclassed, as illustrated with the PrepareableMultiRNNCell example in contrib.
- Loading branch information
1 parent
a5066f6
commit e61e29e
Showing
2 changed files
with
377 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.