Skip to content
This repository has been archived by the owner on Mar 3, 2024. It is now read-only.

Commit

Permalink
Get weighted sum of trained layers
Browse files Browse the repository at this point in the history
  • Loading branch information
CyberZHG committed Oct 30, 2018
1 parent ec29261 commit de2a67a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,8 @@ bi_lm = BiLM(token_num=20000,
rnn_layer_num=3,
rnn_keep_num=4,
rnn_units=300,
rnn_type='lstm')
rnn_type='lstm',
use_normalization=True)
# ...
# Train the Bi-LM model
# ...
Expand Down
3 changes: 2 additions & 1 deletion tests/test_get_feature_layers.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,8 @@ def test_weighted_sum(self):
rnn_layer_num=6,
rnn_keep_num=7,
rnn_units=108,
rnn_type='lstm')
rnn_type='lstm',
use_normalization=True)
input_layer, output_layer = bi_lm.get_feature_layers(use_weighted_sum=True)
model = keras.models.Model(inputs=input_layer, outputs=output_layer)
model.summary()

0 comments on commit de2a67a

Please sign in to comment.