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

Add attention instead of TDID correlation #8

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

mike-shvets
Copy link

Core code is in attention.py.
Config is updated with ATTENTION_ENABLED, ATTENTION_COMBINATION_MODE, and ATTENTION_NORMALIZE_MODE.
TDID class is updated to optionally include attention.

Core code is in attention.py.
Config is updated with ATTENTION_ENABLED, ATTENTION_COMBINATION_MODE, and ATTENTION_NORMALIZE_MODE.
TDID class is updated to optionally include attention.
z = torch.cat([W_y, x], dim=1)
z = self.output_reduce(z)
elif self.combination_mode == "attention-only":
z = W_y
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Given that in TDID final version image features do not contribute much, I think it's good to try and train this version with "average" aggregation

# "sum", or "stack-reduce", or "attention-only"
ATTENTION_COMBINATION_MODE = "attention-only"
# "average" or "softmax"
ATTENTION_NORMALIZE_MODE = "average"
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am adding these three flags. First is optional, as main code uses getattr and defaults to False. The other two are required in case first one is True.

Let's try to train a couple settings on the empty machines. Suggested:

  1. sum + softmax
  2. sum + average
  3. attention-only + average
  4. stack-reduce + softmax
  5. stack-reduce + average

I don't believe too much in softmax version, upon our discussion

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

Successfully merging this pull request may close these issues.

1 participant