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

Shape of atten.npy #111

Open
salehsereshkiucr opened this issue Aug 25, 2023 · 0 comments
Open

Shape of atten.npy #111

salehsereshkiucr opened this issue Aug 25, 2023 · 0 comments

Comments

@salehsereshkiucr
Copy link

I am trying to use the motif-finding module of DNABERT. I have a pre-trained DNABERT model, and I've managed to extract the attention from this pretrained model for the test set.

The attention variable in the model's output is a tuple with a size of 12. Each element in this tuple represents the attention of one layer. For each layer, the shape of the attention is [N, 12, max_seq_len, max_seq_len], where 'N' denotes the size of the test set, and 12 represents the number of attention heads.

I would now like to convert these output attentions into a numpy array, similar to the 'atten.npy' that is fed into the motif-finding module. Is there a module in the code that facilitates this conversion? Broadly speaking, I am interested in understanding how 'atten.npy' can be derived from the attention outputs of the DNABERT model.

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

1 participant