class_docstr: Token embeddings are weighted mean of their different hidden layer representations
class_docstr_tok: ["Token","embeddings","are","weighted","mean","of","their","different","hidden","layer","representations"]
code: def __init__(
      self,
      word_embedding_dimension,
      num_hidden_layers: int = 12,
      layer_start: int = 4,
      layer_weights=None,
  ):
      super(WeightedLayerPooling, self).__init__()
      self.config_keys = [
          "word_embedding_dimension",
          "layer_start",
          "num_hidden_layers",
      ]
      self.word_embedding_dimension = word_embedding_dimension
      self.layer_start = layer_start
      self.num_hidden_layers = num_hidden_layers
      self.layer_weights = (
          layer_weights
          if layer_weights is not None
          else nn.Parameter(
              torch.tensor(
                  [1] * (num_hidden_layers + 1 - layer_start),
                  dtype=torch.float,
              )
          )
      )
  
file_path: sentence-transformers/sentence_transformers/models/WeightedLayerPooling.py
imports: import torch
  from torch import Tensor
  from torch import nn
  from typing import Dict
  import os
  import json
label_desc: Use image node_id 1 to create a new WeightedLayerPooling object from inherited base classes: nn with example: obj = WeightedLayerPooling(word_embedding_dimension, num_hidden_layers, layer_start, layer_weights)