class_docstr: The implementation of the verbalizer in `WARP <https://aclanthology.org/2021.acl-long.381/>`_
  
  Args:
      tokenizer (:obj:`PreTrainedTokenizer`): The tokenizer of the current pre-trained model to point out the vocabulary.
      classes (:obj:`List[Any]`): The classes (or labels) of the current task.
      label_words (:obj:`Union[List[str], List[List[str]], Dict[List[str]]]`, optional): The label words that are projected by the labels.
      prefix (:obj:`str`, optional): The prefix string of the verbalizer (used in PLMs like RoBERTa, which is sensitive to prefix space)
      multi_token_handler (:obj:`str`, optional): The handling strategy for multiple tokens produced by the tokenizer.
      post_log_softmax (:obj:`bool`, optional): Whether to apply log softmax post processing on label_logits. Default to True.
class_docstr_tok: ["The","implementation","of","the","verbalizer","in","`","WARP","<","https",":","\/\/aclanthology.org\/2021.acl-long.381\/",">","`","_","Args",":","tokenizer","(",":","obj",":","`","PreTrainedTokenizer","`",")",":","The","tokenizer","of","the","current","pre-trained","model","to","point","out","the","vocabulary",".","classes","(",":","obj",":","`","List","[","Any","]","`",")",":","The","classes","(","or","labels",")","of","the","current","task",".","label_words","(",":","obj",":","`","Union","[","List","[","str","]",",","List","[","List","[","str","]","]",",","Dict","[","List","[","str","]","]","]","`",",","optional",")",":","The","label","words","that","are","projected","by","the","labels",".","prefix","(",":","obj",":","`","str","`",",","optional",")",":","The","prefix","string","of","the","verbalizer","(","used","in","PLMs","like","RoBERTa",",","which","is","sensitive","to","prefix","space",")","multi_token_handler","(",":","obj",":","`","str","`",",","optional",")",":","The","handling","strategy","for","multiple","tokens","produced","by","the","tokenizer",".","post_log_softmax","(",":","obj",":","`","bool","`",",","optional",")",":","Whether","to","apply","log","softmax","post","processing","on","label_logits",".","Default","to","True","."]
docstr: Include the parameters of head's layer but not the last layer
  In soft verbalizer, note that some heads may contain modules
  other than the final projection layer. The parameters of these part should be
  optimized (or freezed) together with the plm.
docstr_tok: ["Include","the","parameters","of","head","'s","layer","but","not","the","last","layer","In","soft","verbalizer",",","note","that","some","heads","may","contain","modules","other","than","the","final","projection","layer",".","The","parameters","of","these","part","should","be","optimized","(","or","freezed",")","together","with","the","plm","."]
code: def group_parameters_1(
      self,
  ):
      r"""Include the parameters of head's layer but not the last layer
      In soft verbalizer, note that some heads may contain modules
      other than the final projection layer. The parameters of these part should be
      optimized (or freezed) together with the plm.
      """
      if isinstance(self.head, torch.nn.Linear):
          return []
      else:
          return [
              p
              for n, p in self.head.named_parameters()
              if self.head_last_layer_full_name not in n
          ]
  
imports: from inspect import Parameter
  import json
  from os import stat
  from transformers.file_utils import ModelOutput
  from transformers.tokenization_utils import PreTrainedTokenizer
  from transformers.utils.dummy_pt_objects import PreTrainedModel
  from yacs.config import CfgNode
  from openprompt.data_utils import InputFeatures
  import re
  from openprompt import Verbalizer
  from typing import *
  import torch
  import torch.nn
  import torch.nn.functional
  from openprompt.utils.logging import logger
  import copy
  from transformers.modeling_outputs import CausalLMOutputWithCrossAttentions, Seq2SeqLMOutput, MaskedLMOutput
  from transformers.models.t5 import T5ForConditionalGeneration
label_desc: Use image node_id 2 for calling the SoftVerbalizer obj's underlying member method code with example usage: obj.group_parameters_1() and returns: list, unknown