-
Notifications
You must be signed in to change notification settings - Fork 77
add Action Dropout on minerva WN18RR #12
Description
Hi, I tried action dropout trick on original minerva code on WN18RR. However, hit@10 decreased from 0.47 to 0.37 when action dropout rate changed from 1.0 to 0.9. Is there any other auxiliary tricks for action dropout?
The following is action drop code, where self.params['flat_epsilon'] = float(np.finfo(float).eps):
pre_distribution = tf.nn.softmax(scores)
if mode == "train":
pre_distribution = pre_distribution * dropout_mask + self.params['flat_epsilon'] * (1 - dropout_mask)
dummy_scores_1 = tf.zeros_like(prelim_scores)
pre_distribution = tf.where(mask, dummy_scores_1, pre_distribution)
dist = tf.distributions.Categorical(probs=pre_distribution)
action = tf.to_int32(dist.sample())
And the dropout mask is given as follows:
rans = np.random.random(size=[self.batch_size * self.num_rollouts, self.max_num_actions])
dropout_mask = np.greater(rans, 1.0 - self.score_keepRate)
Another mask in above code is for padding other unavailable actions.
And I also calculate the final softmax loss by the original distribution as follows
loss = tf.nn.sparse_softmax_cross_entropy_with_logits(logits=scores, labels=label_action)
and when I change self.score_keepRate from 1.0 and 0.9, while training 100 batches with batch size 128, and the hits@k values on the dev set is as follows:
Score for iteration 100
Hits@1: 0.3771
Hits@3: 0.4370
Hits@5: 0.4591
Hits@10: 0.4796
Hits@20: 0.4852
MRR: 0.4113
Score for iteration 100
Hits@1: 0.3250
Hits@3: 0.3464
Hits@5: 0.3616
Hits@10: 0.3711
Hits@20: 0.3744
MRR: 0.3395
For 1000 batches training,

