PROMPT#

Classes#

class models.dualprompt_utils.prompt.EPrompt(length=5, embed_dim=768, embedding_key='mean', prompt_init='uniform', prompt_pool=False, prompt_key=False, pool_size=None, top_k=None, batchwise_prompt=False, prompt_key_init='uniform', num_layers=1, use_prefix_tune_for_e_prompt=False, num_heads=-1, same_key_value=False)[source]#

Bases: Module

forward(x_embed, prompt_mask=None, cls_features=None)[source]#
l2_normalize(x, dim=None, epsilon=1e-12)[source]#

Normalizes a given vector or matrix.