Skip to content

Commit 8da3fbb

Browse files
committed
update dropout in a separate PR
1 parent fff3d61 commit 8da3fbb

File tree

1 file changed

+8
-10
lines changed

1 file changed

+8
-10
lines changed

rasa/nlu/classifiers/diet_classifier.py

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1191,19 +1191,17 @@ def _combine_sparse_dense_features(
11911191
)
11921192
else:
11931193
_f = 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)
1194+
dense_features.append(self._tf_layers[f"sparse_to_dense.{name}"](_f))
12031195
else:
12041196
dense_features.append(f)
12051197

1206-
return tf.concat(dense_features, axis=-1) * mask
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
12071205

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

0 commit comments

Comments
 (0)