Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

关于EAResnet50中模型代码和原文提到模型是否对应的问题 #2

Open
zhaoy376 opened this issue May 24, 2022 · 2 comments

Comments

@zhaoy376
Copy link

您好:
拜读过您发表在ICML2021的文章《Evolving Attention with Residual Convolutions》后,我对所提出的EA模型非常感兴趣!我想要寻找原文中提到的EA-AA-Resnet50模型代码,寻找到./EAResnet50/official/resnet文件夹中,我发现您提供了tf和keras两种版本的Resnet模型代码,但仔细比对后似乎是Resnet原模型的代码,在./EA_DC_Transformer文件夹中我也未找到EA-AA-Resnet50模型代码。不知是我的大意疏忽,或者那就是Resnet原模型,如果是后者,可以麻烦您告诉我EA-AA-Resnet50模型代码所在的位置吗?

感谢,祝好!

@pkuyym
Copy link
Owner

pkuyym commented May 24, 2022

可以看看这里

if len(prev_atts) > 0:
att_input = prev_atts[-1]
if att_input.shape[1] == logits.shape[1] \
and att_input.shape[2] == logits.shape[2]:
assert att_input.shape[3] == logits.shape[3]
att_matrix = (1 - beta) * logits + beta * att_input
combined_matrix = att_matrix
att_matrix = tf.layers.conv2d(att_matrix, Nh, 3, padding='same',
data_format='channels_first',
kernel_initializer=kernel_initializer)
logits = tf.nn.relu(att_matrix)
logits = alpha * logits + (1 - alpha) * combined_matrix

@zhaoy376
Copy link
Author

非常感谢!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants