Skip to content

Batch-wise prompt tuning for TTA #13

@e0jun

Description

@e0jun

Hello author
Thank you for your excellent work.

I have a question about batch-wise prompt tuning for TTA.

For batch-wise prompt tuning for TTA, you add repeat operation to repeat the prompt batch size times as below.
But, CoOp, the prompt tuning method for CLIP, does not require repeat operation for batch training.
In my understanding, batch-wise prompt tuning for TTA also does not require repeat operation.

Could you give me an answer to this?
I appreciate any help you can provide.

TPT/clip/custom_clip.py

Lines 105 to 109 in 63ecbac

# batch-wise prompt tuning for test-time adaptation
if self.batch_size is not None:
ctx_vectors = ctx_vectors.repeat(batch_size, 1, 1) #(N, L, D)
self.ctx_init_state = ctx_vectors.detach().clone()
self.ctx = nn.Parameter(ctx_vectors) # to be optimized

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions