Residual connection fix (and highway layer) #11
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hi again,
This PR is two-fold.
Residual connection
In my opinion, the residual connections from the CBHG have to be applied from after the pre-net and not from the inputs directly.
There are two arguments which speak for this interpretation:
Hope this convinces you, if you have any concerns please comment.
Highway-Net
The second part of this PR is directed at the code quality of the Highway-Net construction.
In particular it uses
tf.layers.dense
instead of the customdense
function and uses the number of units ofinputs
if not specified otherwise.By using
tf.layers.dense
it simplifies the code (we could replace it in the pre-net as well) in my opinion.Also, I haven't added batch normalization to the highway net construction, because I haven't seen batchnorm used much in FC layers (didn't notice much difference) and the paper only mentions batch-norm for conv-nets.
Oh and I dropped the
hp.embed_size
, so the code is more modular (and its also wrong IMO, see the first part of this PR)Cheers,
André