class_docstr: This is the configuration class to store the configuration of a [`Kosmos2VisionModel`]. It is used to instantiate a
  KOSMOS-2 vision encoder according to the specified arguments, defining the model architecture. Instantiating a
  configuration with the defaults will yield a similar configuration to that of the vision encoder of the KOSMOS-2
  [microsoft/kosmos-2-patch14-224](https://huggingface.co/microsoft/kosmos-2-patch14-224) architecture.
  
  Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
  documentation from [`PretrainedConfig`] for more information.
  
  Args:
      hidden_size (`int`, *optional*, defaults to 1024):
          Dimensionality of the encoder layers and the pooler layer.
      intermediate_size (`int`, *optional*, defaults to 4096):
          Dimensionality of the "intermediate" (i.e., feed-forward) layer in the Transformer encoder.
      num_hidden_layers (`int`, *optional*, defaults to 24):
          Number of hidden layers in the Transformer encoder.
      num_attention_heads (`int`, *optional*, defaults to 16):
          Number of attention heads for each attention layer in the Transformer encoder.
      num_channels (`int`, *optional*, defaults to 3):
          The number of input channels.
      image_size (`int`, *optional*, defaults to 224):
          The size (resolution) of each image.
      patch_size (`int`, *optional*, defaults to 14):
          The size (resolution) of each patch.
      hidden_act (`str` or `function`, *optional*, defaults to `"quick_gelu"`):
          The non-linear activation function (function or string) in the encoder and pooler. If string, `"gelu"`,
          `"relu"`, `"selu"` and `"gelu_new"` ``"quick_gelu"` are supported.
      layer_norm_eps (`float`, *optional*, defaults to 1e-5):
          The epsilon used by the layer normalization layers.
      attention_dropout (`float`, *optional*, defaults to 0.0):
          The dropout ratio for the attention probabilities.
      initializer_range (`float`, *optional*, defaults to 0.02):
          The standard deviation of the truncated_normal_initializer for initializing all weight matrices.
      initializer_factor (`float`, *optional*, defaults to 1):
          A factor for initializing all weight matrices (should be kept to 1, used internally for initialization
          testing).
  ```
class_docstr_tok: ["This","is","the","configuration","class","to","store","the","configuration","of","a","[","`","Kosmos2VisionModel","`","]",".","It","is","used","to","instantiate","a","KOSMOS-2","vision","encoder","according","to","the","specified","arguments",",","defining","the","model","architecture",".","Instantiating","a","configuration","with","the","defaults","will","yield","a","similar","configuration","to","that","of","the","vision","encoder","of","the","KOSMOS-2","[","microsoft\/kosmos-2-patch14-224","]","(","https",":","\/\/huggingface.co\/microsoft\/kosmos-2-patch14-224",")","architecture",".","Configuration","objects","inherit","from","[","`","PretrainedConfig","`","]","and","can","be","used","to","control","the","model","outputs",".","Read","the","documentation","from","[","`","PretrainedConfig","`","]","for","more","information",".","Args",":","hidden_size","(","`","int","`",",","*","optional","*",",","defaults","to","1024",")",":","Dimensionality","of","the","encoder","layers","and","the","pooler","layer",".","intermediate_size","(","`","int","`",",","*","optional","*",",","defaults","to","4096",")",":","Dimensionality","of","the","``","intermediate","''","(","i.e.",",","feed-forward",")","layer","in","the","Transformer","encoder",".","num_hidden_layers","(","`","int","`",",","*","optional","*",",","defaults","to","24",")",":","Number","of","hidden","layers","in","the","Transformer","encoder",".","num_attention_heads","(","`","int","`",",","*","optional","*",",","defaults","to","16",")",":","Number","of","attention","heads","for","each","attention","layer","in","the","Transformer","encoder",".","num_channels","(","`","int","`",",","*","optional","*",",","defaults","to","3",")",":","The","number","of","input","channels",".","image_size","(","`","int","`",",","*","optional","*",",","defaults","to","224",")",":","The","size","(","resolution",")","of","each","image",".","patch_size","(","`","int","`",",","*","optional","*",",","defaults","to","14",")",":","The","size","(","resolution",")","of","each","patch",".","hidden_act","(","`","str","`","or","`","function","`",",","*","optional","*",",","defaults","to","`","``","quick_gelu","''","`",")",":","The","non-linear","activation","function","(","function","or","string",")","in","the","encoder","and","pooler",".","If","string",",","`","``","gelu","''","`",",","`","``","relu","''","`",",","`","``","selu","''","`","and","`","``","gelu_new","''","`","``","``","quick_gelu","''","`","are","supported",".","layer_norm_eps","(","`","float","`",",","*","optional","*",",","defaults","to","1e-5",")",":","The","epsilon","used","by","the","layer","normalization","layers",".","attention_dropout","(","`","float","`",",","*","optional","*",",","defaults","to","0.0",")",":","The","dropout","ratio","for","the","attention","probabilities",".","initializer_range","(","`","float","`",",","*","optional","*",",","defaults","to","0.02",")",":","The","standard","deviation","of","the","truncated_normal_initializer","for","initializing","all","weight","matrices",".","initializer_factor","(","`","float","`",",","*","optional","*",",","defaults","to","1",")",":","A","factor","for","initializing","all","weight","matrices","(","should","be","kept","to","1",",","used","internally","for","initialization","testing",")",".","``","`"]
code: def __init__(
      self,
      hidden_size=1024,
      intermediate_size=4096,
      num_hidden_layers=24,
      num_attention_heads=16,
      num_channels=3,
      image_size=224,
      patch_size=14,
      hidden_act="quick_gelu",
      layer_norm_eps=1e-5,
      attention_dropout=0.0,
      initializer_range=0.02,
      initializer_factor=1.0,
      **kwargs,
  ):
      super().__init__(**kwargs)
  
      self.hidden_size = hidden_size
      self.intermediate_size = intermediate_size
      self.num_hidden_layers = num_hidden_layers
      self.num_attention_heads = num_attention_heads
      self.num_channels = num_channels
      self.patch_size = patch_size
      self.image_size = image_size
      self.initializer_range = initializer_range
      self.initializer_factor = initializer_factor
      self.attention_dropout = attention_dropout
      self.layer_norm_eps = layer_norm_eps
      self.hidden_act = hidden_act
  
file_path: transformers/src/transformers/models/kosmos2/configuration_kosmos2.py
imports: import os
  from typing import Union
  from ...configuration_utils import PretrainedConfig
  from ...utils import logging
label_desc: Use image node_id 1 to create a new Kosmos2VisionConfig object from inherited base classes: PretrainedConfig with example: obj = Kosmos2VisionConfig(hidden_size, intermediate_size, num_hidden_layers, num_attention_heads, num_channels, image_size, patch_size, hidden_act, layer_norm_eps, attention_dropout, initializer_range, initializer_factor)