Skip to content

Commit

Permalink
Merge pull request #5626 from RasaHQ/bug-activation
Browse files Browse the repository at this point in the history
Move activation to transformer block
  • Loading branch information
tabergma authored Apr 15, 2020
2 parents 356ce59 + 37bdde7 commit dc58581
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions changelog/5626.msic.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Apply ``tfa.activations.gelu(x)`` only if min 1 transformer block is used in ``DIETClassifier``.
5 changes: 4 additions & 1 deletion rasa/nlu/classifiers/diet_classifier.py
Original file line number Diff line number Diff line change
Expand Up @@ -1249,7 +1249,10 @@ def _create_sequence(
outputs = self._tf_layers[f"{name}_transformer"](
inputs, 1 - mask, self._training
)
outputs = tfa.activations.gelu(outputs)

if self.config[NUM_TRANSFORMER_LAYERS] > 0:
# apply activation
outputs = tfa.activations.gelu(outputs)

return outputs, inputs, seq_ids, lm_mask_bool

Expand Down

0 comments on commit dc58581

Please sign in to comment.