class_docstr: The projection head used by contrast learning.
  Args:
      dim_in (int): The dimensions of input features.
      proj_dim (int, optional): The output dimensions of projection head. Default: 256.
      proj (str, optional): The type of projection head, only support 'linear' and 'convmlp'. Default: 'convmlp'.
class_docstr_tok: ["The","projection","head","used","by","contrast","learning",".","Args",":","dim_in","(","int",")",":","The","dimensions","of","input","features",".","proj_dim","(","int",",","optional",")",":","The","output","dimensions","of","projection","head",".","Default",":","256.","proj","(","str",",","optional",")",":","The","type","of","projection","head",",","only","support","'linear","'","and","'convmlp","'",".","Default",":","'convmlp","'","."]
code: def __init__(self, dim_in, proj_dim=256, proj="convmlp"):
      super(ProjectionHead, self).__init__()
      if proj == "linear":
          self.proj = nn.Conv2D(dim_in, proj_dim, kernel_size=1)
      elif proj == "convmlp":
          self.proj = nn.Sequential(
              layers.ConvBNReLU(dim_in, dim_in, kernel_size=1),
              nn.Conv2D(dim_in, proj_dim, kernel_size=1),
          )
      else:
          raise ValueError(
              "The type of project head only support 'linear' and 'convmlp', but got {}.".format(
                  proj
              )
          )
  
file_path: PaddleSeg/paddleseg/models/hrnet_contrast.py
imports: import paddle
  import paddle.nn
  import paddle.nn.functional
  from paddleseg.cvlibs import manager
  from paddleseg.models import layers
  from paddleseg.utils import utils
label_desc: Use image node_id 1 to create a new ProjectionHead object from inherited base classes: nn with example: obj = ProjectionHead(dim_in, proj_dim, proj)