Skip to content

Commit b759106

Browse files
authored
Merge branch 'master' into metada-on-session-start-action
2 parents ac060c9 + c3bbc31 commit b759106

File tree

1 file changed

+10
-8
lines changed

1 file changed

+10
-8
lines changed

rasa/nlu/classifiers/diet_classifier.py

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1191,17 +1191,19 @@ def _combine_sparse_dense_features(
11911191
)
11921192
else:
11931193
_f = f
1194-
dense_features.append(self._tf_layers[f"sparse_to_dense.{name}"](_f))
1194+
1195+
dense_f = self._tf_layers[f"sparse_to_dense.{name}"](_f)
1196+
1197+
if dense_dropout:
1198+
dense_f = self._tf_layers[f"dense_input_dropout.{name}"](
1199+
dense_f, self._training
1200+
)
1201+
1202+
dense_features.append(dense_f)
11951203
else:
11961204
dense_features.append(f)
11971205

1198-
outputs = tf.concat(dense_features, axis=-1) * mask
1199-
if dense_dropout:
1200-
outputs = self._tf_layers[f"dense_input_dropout.{name}"](
1201-
outputs, self._training
1202-
)
1203-
1204-
return outputs
1206+
return tf.concat(dense_features, axis=-1) * mask
12051207

12061208
def _features_as_seq_ids(
12071209
self, features: List[Union[np.ndarray, tf.Tensor, tf.SparseTensor]], name: Text

0 commit comments

Comments
 (0)