Cao Yiwei

Results 4 issues of Cao Yiwei

当前encoder_type为first-last-avg和last-avg时候,都是通过torch.avg_pool1d(last.transpose(1, 2), kernel_size=seq_length).squeeze(-1)实现的,seq_length不是真实长度,可能被补全。是不是应该考虑通过类似于mean的形式实现,统计有效文本长度?

question

您好,分类层forward里面没有使用attention mask,会导致padding影响结果。您可以验证一下。

inner product是通过tf.reduce_sum实现的,reduce时候没有指定维度,建议默认axis=-1 当前0.3.1版本dssm模型无法构建,按如下方式修改后可以正常训练。 def inner_product(x, y, temperature=1.0, axis=-1): return Lambda(lambda x: tf.reduce_sum(tf.multiply(x[0], x[1]), axis) / temperature)([x, y])

您好,您用于生成数据集的prompt template方便开源参考吗