Skip to content

Commit a7eb342

Browse files
committed
Merge branch 'tf2' into tf2-entmax
2 parents 5e4bd3d + 5e0eb59 commit a7eb342

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

rasa/nlu/selectors/response_selector.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -94,13 +94,13 @@ class ResponseSelector(DIETClassifier):
9494
# sizes of hidden layers before the embedding layer
9595
# for input words and responses
9696
# the number of hidden layers is thus equal to the length of this list
97-
HIDDEN_LAYERS_SIZES: {TEXT: [], LABEL: []},
97+
HIDDEN_LAYERS_SIZES: {TEXT: [256, 128], LABEL: [256, 128]},
9898
# Whether to share the hidden layer weights between input words and intent labels
9999
SHARE_HIDDEN_LAYERS: False,
100100
# number of units in transformer
101-
TRANSFORMER_SIZE: 256,
101+
TRANSFORMER_SIZE: None,
102102
# number of transformer layers
103-
NUM_TRANSFORMER_LAYERS: 2,
103+
NUM_TRANSFORMER_LAYERS: 0,
104104
# number of attention heads in transformer
105105
NUM_HEADS: 4,
106106
# max sequence length if pos_encoding='emb'
@@ -154,7 +154,7 @@ class ResponseSelector(DIETClassifier):
154154
# use a unidirectional or bidirectional encoder
155155
UNIDIRECTIONAL_ENCODER: False,
156156
# if true apply dropout to sparse tensors
157-
SPARSE_INPUT_DROPOUT: True,
157+
SPARSE_INPUT_DROPOUT: False,
158158
# visualization of accuracy
159159
# how often to calculate training accuracy
160160
EVAL_NUM_EPOCHS: 20, # small values may hurt performance

rasa/utils/tensorflow/layers.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,9 @@ def build(self, input_shape: tf.TensorShape) -> None:
7777
kernel_mask = tf.cast(
7878
tf.greater_equal(kernel_mask, self.sparsity), self.kernel.dtype
7979
)
80-
self.kernel_mask = tf.Variable(initial_value=kernel_mask, trainable=False)
80+
self.kernel_mask = tf.Variable(
81+
initial_value=kernel_mask, trainable=False, name="kernel_mask"
82+
)
8183

8284
def call(self, inputs: tf.Tensor) -> tf.Tensor:
8385
# set some weights to 0 according to precomputed mask

0 commit comments

Comments
 (0)