我是靠谱客的博主 开心曲奇,最近开发中收集的这篇文章主要介绍IRNET 的 memory augmented pointer network,觉得挺不错的,现在分享给大家,希望可以做个参考。

概述

IRNET 的 memory augmented pointer network

选择一个列 c c c 的概率为:
p ( a i = S E L E C T C O L U M N [ c ] ∣ x , s , a < i ) = p ( M E M ∣ x , s , a < i ) p ( c ∣ x , s , a < i , M E M ) + p (   S ∣ x , s , a < i ) p ( c ∣ x , s , a < i ,   S ) p ( M E M ∣ x , s , a < i ) = sigmod ⁡ ( w m ⊤ v i ) p (   S ∣ x , s , a < i ) = 1 − p ( MEM ⁡ ∣ x , s , a < i ) p ( c ∣ x , s , a < i , M E M ) ∝ exp ⁡ ( v i ⊤ E c m ) p ( c ∣ x , s , a < i ,   S ) ∝ exp ⁡ ( v i ⊤ E c s ) begin{aligned} pleft(a_{i}=mathrm{SELECTCOLUMN}[c] mid x, s, a_{<i}right)&= pleft(mathrm{MEM} mid x, s, a_{<i}right) pleft(c mid x, s, a_{<i}, mathrm{MEM}right) \ &+pleft(mathrm{~S} mid x, s, a_{<i}right) pleft(c mid x, s, a_{<i}, mathrm{~S}right) \ pleft(mathrm{MEM} mid x, s, a_{<i}right)&=operatorname{sigmod}left(boldsymbol{w}_{m}^{top} boldsymbol{v}_{i}right) \ pleft(mathrm{~S} mid x, s, a_{<i}right)&=1-pleft(operatorname{MEM} mid x, s, a_{<i}right) \ pleft(c mid x, s, a_{<i}, mathrm{MEM}right) &propto exp left(boldsymbol{v}_{i}^{top} boldsymbol{E}_{c}^{m}right) \ pleft(c mid x, s, a_{<i}, mathrm{~S}right)& propto exp left(boldsymbol{v}_{i}^{top} boldsymbol{E}_{c}^{s}right) end{aligned} p(ai=SELECTCOLUMN[c]x,s,a<i)p(MEMx,s,a<i)p( Sx,s,a<i)p(cx,s,a<i,MEM)p(cx,s,a<i, S)=p(MEMx,s,a<i)p(cx,s,a<i,MEM)+p( Sx,s,a<i)p(cx,s,a<i, S)=sigmod(wmvi)=1p(MEMx,s,a<i)exp(viEcm)exp(viEcs)
其中,

signalmeaning
S S Sselecting from schema
M E M MEM MEMselecting from memory
H x H_x HxNL encoder takes x x x as input and encodes x x x into a sequence of hidden states H x H_x Hx
v i v_i vicontext vector that is obtained by performing an attention over H x H_x Hx
E c m {E}_{c}^{m} Ecmthe embedding of columns in memory
E c s {E}_{c}^{s} Ecsthe embedding of columns that are never selected
w m w_m wmtrainable parameter
table_appear_mask_val = torch.from_numpy(table_appear_mask)
if self.cuda:
table_appear_mask_val = table_appear_mask_val.cuda()
if self.use_column_pointer:
gate = F.sigmoid(self.prob_att(att_t))
weights = self.column_pointer_net(src_encodings=table_embedding, query_vec=att_t.unsqueeze(0),
src_token_mask=None) * table_appear_mask_val * gate + self.column_pointer_net(
src_encodings=table_embedding, query_vec=att_t.unsqueeze(0),
src_token_mask=None) * (1 - table_appear_mask_val) * (1 - gate)
else:
weights = self.column_pointer_net(src_encodings=table_embedding, query_vec=att_t.unsqueeze(0),
src_token_mask=batch.table_token_mask)
weights.data.masked_fill_(batch.table_token_mask.bool(), -float('inf'))
column_attention_weights = F.softmax(weights, dim=-1)

最后

以上就是开心曲奇为你收集整理的IRNET 的 memory augmented pointer network的全部内容,希望文章能够帮你解决IRNET 的 memory augmented pointer network所遇到的程序开发问题。

如果觉得靠谱客网站的内容还不错,欢迎将靠谱客网站推荐给程序员好友。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(65)

评论列表共有 0 条评论

立即
投稿
返回
顶部