Skip to content

Issue with implement of dualprompt #56

Closed
@AmeliaBartxn

Description

@AmeliaBartxn

Thank you for building Mammoth, which has helped me a lot. However, while using Mammoth to compare baseline methods, I accidentally discovered an error in dualprompt, specifically in lines 117-122 of ./mammoth/models/dualprompt_utils/prompt.py.

            if self.use_prefix_tune_for_e_prompt:
                batched_prompt_raw = self.prompt[:, :, idx]  # num_layers, B, top_k, length, C
                num_layers, dual, batch_size, top_k, length, num_heads, heads_embed_dim = batched_prompt_raw.shape
                batched_prompt = batched_prompt_raw.reshape(
                    num_layers, batch_size, dual, top_k * length, num_heads, heads_embed_dim
                )

While transforming the dimensions of a tensor, reshape should be used with caution, especially since the goal here is to swap two dimensions.

Furthermore, I checked the referenced code in Mammoth and found that this issue has already been raised by someone else: JH-LEE-KR/dualprompt-pytorch#8 (comment)

For the sake of reproducibility of the methods, I suggest making the necessary corrections.
Many thanks.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions