



"""simple docstring"""

# Imports
import numpy as np
class     lowerCAmelCase__						:


	'''simple docstring'''







	def __init__(      self				:       str     ,       _SCREAMING_SNAKE_CASE				:       Union[str, Any]=None     ,       _SCREAMING_SNAKE_CASE				:       Union[str, Any]=None     ,       _SCREAMING_SNAKE_CASE				:       str=None     ,       _SCREAMING_SNAKE_CASE				:       Dict=None     ,       _SCREAMING_SNAKE_CASE				:       List[Any]=None    )						->	int:





					"""simple docstring"""


					self.set_matricies(red=_SCREAMING_SNAKE_CASE     ,       green=_SCREAMING_SNAKE_CASE     ,       blue=_SCREAMING_SNAKE_CASE     ,       red_edge=_SCREAMING_SNAKE_CASE     ,       nir=_SCREAMING_SNAKE_CASE    )





	def 			_lowerCAmelCase     (      self				:       str     ,       _SCREAMING_SNAKE_CASE				:       Any=None     ,       _SCREAMING_SNAKE_CASE				:       Optional[int]=None     ,       _SCREAMING_SNAKE_CASE				:       Any=None     ,       _SCREAMING_SNAKE_CASE				:       List[str]=None     ,       _SCREAMING_SNAKE_CASE				:       List[Any]=None    )						->	List[Any]:





					"""simple docstring"""


					if red is not None:
									SCREAMING_SNAKE_CASE						:							List[str]							=     red
					if green is not None:
									SCREAMING_SNAKE_CASE						:							Tuple							=     green
					if blue is not None:
									SCREAMING_SNAKE_CASE						:							Any							=     blue
					if red_edge is not None:
									SCREAMING_SNAKE_CASE						:							Any							=     red_edge
					if nir is not None:
									SCREAMING_SNAKE_CASE						:							Tuple							=     nir
					return True





	def 			_lowerCAmelCase     (      self				:       int     ,       _SCREAMING_SNAKE_CASE				:       str=""     ,       _SCREAMING_SNAKE_CASE				:       List[Any]=None     ,       _SCREAMING_SNAKE_CASE				:       List[Any]=None     ,       _SCREAMING_SNAKE_CASE				:       Union[str, Any]=None     ,       _SCREAMING_SNAKE_CASE				:       Optional[int]=None     ,       _SCREAMING_SNAKE_CASE				:       List[Any]=None    )						->	List[Any]:





					"""simple docstring"""


					self.set_matricies(red=_SCREAMING_SNAKE_CASE     ,       green=_SCREAMING_SNAKE_CASE     ,       blue=_SCREAMING_SNAKE_CASE     ,       red_edge=_SCREAMING_SNAKE_CASE     ,       nir=_SCREAMING_SNAKE_CASE    )
					SCREAMING_SNAKE_CASE						:							Optional[Any]							=     {
					    'ARVI2': self.arvaa,
					    'CCCI': self.ccci,
					    'CVI': self.cvi,
					    'GLI': self.gli,
					    'NDVI': self.ndvi,
					    'BNDVI': self.bndvi,
					    'redEdgeNDVI': self.red_edge_ndvi,
					    'GNDVI': self.gndvi,
					    'GBNDVI': self.gbndvi,
					    'GRNDVI': self.grndvi,
					    'RBNDVI': self.rbndvi,
					    'PNDVI': self.pndvi,
					    'ATSAVI': self.atsavi,
					    'BWDRVI': self.bwdrvi,
					    'CIgreen': self.ci_green,
					    'CIrededge': self.ci_rededge,
					    'CI': self.ci,
					    'CTVI': self.ctvi,
					    'GDVI': self.gdvi,
					    'EVI': self.evi,
					    'GEMI': self.gemi,
					    'GOSAVI': self.gosavi,
					    'GSAVI': self.gsavi,
					    'Hue': self.hue,
					    'IVI': self.ivi,
					    'IPVI': self.ipvi,
					    'I': self.i,
					    'RVI': self.rvi,
					    'MRVI': self.mrvi,
					    'MSAVI': self.m_savi,
					    'NormG': self.norm_g,
					    'NormNIR': self.norm_nir,
					    'NormR': self.norm_r,
					    'NGRDI': self.ngrdi,
					    'RI': self.ri,
					    'S': self.s,
					    'IF': self._if,
					    'DVI': self.dvi,
					    'TVI': self.tvi,
					    'NDRE': self.ndre,
					}

					try:
									return funcs[index]()
					except KeyError:
									print('Index not in the list!'    )
									return False





	def 			_lowerCAmelCase     (      self				:       Optional[Any]    )						->	List[str]:





					"""simple docstring"""


					return -0.1_8 + (1.1_7 * ((self.nir - self.red) / (self.nir + self.red)))





	def 			_lowerCAmelCase     (      self				:       Dict    )						->	Dict:





					"""simple docstring"""


					return ((self.nir - self.redEdge) / (self.nir + self.redEdge)) / (
					    (self.nir - self.red) / (self.nir + self.red)
					)





	def 			_lowerCAmelCase     (      self				:       Union[str, Any]    )						->	str:





					"""simple docstring"""


					return self.nir * (self.red / (self.green**2))





	def 			_lowerCAmelCase     (      self				:       Dict    )						->	Any:





					"""simple docstring"""


					return (2 * self.green - self.red - self.blue) / (
					    2 * self.green + self.red + self.blue
					)





	def 			_lowerCAmelCase     (      self				:       Tuple    )						->	Tuple:





					"""simple docstring"""


					return (self.nir - self.red) / (self.nir + self.red)





	def 			_lowerCAmelCase     (      self				:       Tuple    )						->	Any:





					"""simple docstring"""


					return (self.nir - self.blue) / (self.nir + self.blue)





	def 			_lowerCAmelCase     (      self				:       Any    )						->	Any:





					"""simple docstring"""


					return (self.redEdge - self.red) / (self.redEdge + self.red)





	def 			_lowerCAmelCase     (      self				:       str    )						->	List[Any]:





					"""simple docstring"""


					return (self.nir - self.green) / (self.nir + self.green)





	def 			_lowerCAmelCase     (      self				:       Any    )						->	List[Any]:





					"""simple docstring"""


					return (self.nir - (self.green + self.blue)) / (
					    self.nir + (self.green + self.blue)
					)





	def 			_lowerCAmelCase     (      self				:       str    )						->	int:





					"""simple docstring"""


					return (self.nir - (self.green + self.red)) / (
					    self.nir + (self.green + self.red)
					)





	def 			_lowerCAmelCase     (      self				:       Optional[Any]    )						->	List[str]:





					"""simple docstring"""


					return (self.nir - (self.blue + self.red)) / (self.nir + (self.blue + self.red))





	def 			_lowerCAmelCase     (      self				:       Optional[Any]    )						->	List[str]:





					"""simple docstring"""


					return (self.nir - (self.green + self.red + self.blue)) / (
					    self.nir + (self.green + self.red + self.blue)
					)





	def 			_lowerCAmelCase     (      self				:       List[str]     ,       _SCREAMING_SNAKE_CASE				:       Union[str, Any]=0.0_8     ,       _SCREAMING_SNAKE_CASE				:       Optional[Any]=1.2_2     ,       _SCREAMING_SNAKE_CASE				:       Union[str, Any]=0.0_3    )						->	List[Any]:





					"""simple docstring"""


					return a * (
					    (self.nir - a * self.red - b)
					    / (a * self.nir + self.red - a * b + x * (1 + a**2))
					)





	def 			_lowerCAmelCase     (      self				:       List[Any]    )						->	str:





					"""simple docstring"""


					return (0.1 * self.nir - self.blue) / (0.1 * self.nir + self.blue)





	def 			_lowerCAmelCase     (      self				:       List[Any]    )						->	List[Any]:





					"""simple docstring"""


					return (self.nir / self.green) - 1





	def 			_lowerCAmelCase     (      self				:       Tuple    )						->	List[str]:





					"""simple docstring"""


					return (self.nir / self.redEdge) - 1





	def 			_lowerCAmelCase     (      self				:       Tuple    )						->	Optional[int]:





					"""simple docstring"""


					return (self.red - self.blue) / self.red





	def 			_lowerCAmelCase     (      self				:       Dict    )						->	List[str]:





					"""simple docstring"""


					SCREAMING_SNAKE_CASE						:							List[Any]							=     self.ndvi()
					return ((ndvi + 0.5) / (abs(ndvi + 0.5    ))) * (abs(ndvi + 0.5    ) ** (1 / 2))





	def 			_lowerCAmelCase     (      self				:       Optional[Any]    )						->	str:





					"""simple docstring"""


					return self.nir - self.green





	def 			_lowerCAmelCase     (      self				:       Any    )						->	Optional[int]:





					"""simple docstring"""


					return 2.5 * (
					    (self.nir - self.red) / (self.nir + 6 * self.red - 7.5 * self.blue + 1)
					)





	def 			_lowerCAmelCase     (      self				:       List[str]    )						->	Optional[Any]:





					"""simple docstring"""


					SCREAMING_SNAKE_CASE						:							Optional[Any]							=     (2 * (self.nir**2 - self.red**2) + 1.5 * self.nir + 0.5 * self.red) / (
					    self.nir + self.red + 0.5
					)
					return n * (1 - 0.2_5 * n) - (self.red - 0.1_2_5) / (1 - self.red)





	def 			_lowerCAmelCase     (      self				:       List[str]     ,       _SCREAMING_SNAKE_CASE				:       Optional[int]=0.1_6    )						->	Tuple:





					"""simple docstring"""


					return (self.nir - self.green) / (self.nir + self.green + y)





	def 			_lowerCAmelCase     (      self				:       str     ,       _SCREAMING_SNAKE_CASE				:       int=0.5    )						->	List[str]:





					"""simple docstring"""


					return ((self.nir - self.green) / (self.nir + self.green + n)) * (1 + n)





	def 			_lowerCAmelCase     (      self				:       Union[str, Any]    )						->	List[Any]:





					"""simple docstring"""


					return np.arctan(
					    ((2 * self.red - self.green - self.blue) / 3_0.5) * (self.green - self.blue)    )





	def 			_lowerCAmelCase     (      self				:       Dict     ,       _SCREAMING_SNAKE_CASE				:       Tuple=None     ,       _SCREAMING_SNAKE_CASE				:       str=None    )						->	Any:





					"""simple docstring"""


					return (self.nir - b) / (a * self.red)





	def 			_lowerCAmelCase     (      self				:       int    )						->	List[str]:





					"""simple docstring"""


					return (self.nir / ((self.nir + self.red) / 2)) * (self.ndvi() + 1)





	def 			_lowerCAmelCase     (      self				:       Tuple    )						->	Tuple:





					"""simple docstring"""


					return (self.red + self.green + self.blue) / 3_0.5





	def 			_lowerCAmelCase     (      self				:       Optional[int]    )						->	Optional[Any]:





					"""simple docstring"""


					return self.nir / self.red





	def 			_lowerCAmelCase     (      self				:       Union[str, Any]    )						->	Optional[Any]:





					"""simple docstring"""


					return (self.rvi() - 1) / (self.rvi() + 1)





	def 			_lowerCAmelCase     (      self				:       Any    )						->	Tuple:





					"""simple docstring"""


					return (
					    (2 * self.nir + 1)
					    - ((2 * self.nir + 1) ** 2 - 8 * (self.nir - self.red)) ** (1 / 2)
					) / 2





	def 			_lowerCAmelCase     (      self				:       Optional[int]    )						->	Optional[int]:





					"""simple docstring"""


					return self.green / (self.nir + self.red + self.green)





	def 			_lowerCAmelCase     (      self				:       Tuple    )						->	Tuple:





					"""simple docstring"""


					return self.nir / (self.nir + self.red + self.green)





	def 			_lowerCAmelCase     (      self				:       List[Any]    )						->	Dict:





					"""simple docstring"""


					return self.red / (self.nir + self.red + self.green)





	def 			_lowerCAmelCase     (      self				:       List[Any]    )						->	Dict:





					"""simple docstring"""


					return (self.green - self.red) / (self.green + self.red)





	def 			_lowerCAmelCase     (      self				:       Dict    )						->	Union[str, Any]:





					"""simple docstring"""


					return (self.red - self.green) / (self.red + self.green)





	def 			_lowerCAmelCase     (      self				:       List[Any]    )						->	Any:





					"""simple docstring"""


					SCREAMING_SNAKE_CASE						:							Any							=     np.max([np.max(self.red    ), np.max(self.green    ), np.max(self.blue    )]    )
					SCREAMING_SNAKE_CASE						:							Optional[Any]							=     np.min([np.min(self.red    ), np.min(self.green    ), np.min(self.blue    )]    )
					return (max_value - min_value) / max_value





	def 			_lowerCAmelCase     (      self				:       Optional[int]    )						->	str:





					"""simple docstring"""


					return (2 * self.red - self.green - self.blue) / (self.green - self.blue)





	def 			_lowerCAmelCase     (      self				:       Optional[int]    )						->	int:





					"""simple docstring"""


					return self.nir / self.red





	def 			_lowerCAmelCase     (      self				:       Union[str, Any]    )						->	int:





					"""simple docstring"""


					return (self.ndvi() + 0.5) ** (1 / 2)







	def 			_lowerCAmelCase     (      self				:       List[str]    )						->	str:





					"""simple docstring"""


					return (self.nir - self.redEdge) / (self.nir + self.redEdge)










"""simple docstring"""

from collections import OrderedDict
from typing import Mapping

from ...configuration_utils import PretrainedConfig
from ...onnx import OnnxConfig
from ...utils import logging


A_						:    Any				=      logging.get_logger(__name__)

A_						:    Optional[int]				=      {
    'facebook/xmod-base': 'https://huggingface.co/facebook/xmod-base/resolve/main/config.json',
    'facebook/xmod-large-prenorm': 'https://huggingface.co/facebook/xmod-large-prenorm/resolve/main/config.json',
    'facebook/xmod-base-13-125k': 'https://huggingface.co/facebook/xmod-base-13-125k/resolve/main/config.json',
    'facebook/xmod-base-30-125k': 'https://huggingface.co/facebook/xmod-base-30-125k/resolve/main/config.json',
    'facebook/xmod-base-30-195k': 'https://huggingface.co/facebook/xmod-base-30-195k/resolve/main/config.json',
    'facebook/xmod-base-60-125k': 'https://huggingface.co/facebook/xmod-base-60-125k/resolve/main/config.json',
    'facebook/xmod-base-60-265k': 'https://huggingface.co/facebook/xmod-base-60-265k/resolve/main/config.json',
    'facebook/xmod-base-75-125k': 'https://huggingface.co/facebook/xmod-base-75-125k/resolve/main/config.json',
    'facebook/xmod-base-75-269k': 'https://huggingface.co/facebook/xmod-base-75-269k/resolve/main/config.json',
}
class     lowerCAmelCase__						(	_lowerCamelCase ):


	'''simple docstring'''







	_SCREAMING_SNAKE_CASE	:		int  						= '''xmod'''





	def __init__(      self				:       Union[str, Any]     ,       _SCREAMING_SNAKE_CASE				:       Tuple=30_522     ,       _SCREAMING_SNAKE_CASE				:       Tuple=768     ,       _SCREAMING_SNAKE_CASE				:       Optional[int]=12     ,       _SCREAMING_SNAKE_CASE				:       List[str]=12     ,       _SCREAMING_SNAKE_CASE				:       Optional[Any]=3_072     ,       _SCREAMING_SNAKE_CASE				:       Any="gelu"     ,       _SCREAMING_SNAKE_CASE				:       List[Any]=0.1     ,       _SCREAMING_SNAKE_CASE				:       Dict=0.1     ,       _SCREAMING_SNAKE_CASE				:       str=512     ,       _SCREAMING_SNAKE_CASE				:       Tuple=2     ,       _SCREAMING_SNAKE_CASE				:       Union[str, Any]=0.0_2     ,       _SCREAMING_SNAKE_CASE				:       Union[str, Any]=1E-1_2     ,       _SCREAMING_SNAKE_CASE				:       List[str]=1     ,       _SCREAMING_SNAKE_CASE				:       Optional[Any]=0     ,       _SCREAMING_SNAKE_CASE				:       Optional[Any]=2     ,       _SCREAMING_SNAKE_CASE				:       Union[str, Any]="absolute"     ,       _SCREAMING_SNAKE_CASE				:       Union[str, Any]=True     ,       _SCREAMING_SNAKE_CASE				:       Optional[Any]=None     ,       _SCREAMING_SNAKE_CASE				:       str=False     ,       _SCREAMING_SNAKE_CASE				:       Dict=2     ,       _SCREAMING_SNAKE_CASE				:       str=False     ,       _SCREAMING_SNAKE_CASE				:       int=True     ,       _SCREAMING_SNAKE_CASE				:       Union[str, Any]=True     ,       _SCREAMING_SNAKE_CASE				:       Tuple=("en_XX",)     ,       _SCREAMING_SNAKE_CASE				:       Optional[int]=None     ,       **_SCREAMING_SNAKE_CASE				:       List[Any]     ,       )						->	List[str]:





					"""simple docstring"""


					super().__init__(pad_token_id=_SCREAMING_SNAKE_CASE     ,       bos_token_id=_SCREAMING_SNAKE_CASE     ,       eos_token_id=_SCREAMING_SNAKE_CASE     ,       **_SCREAMING_SNAKE_CASE    )

					SCREAMING_SNAKE_CASE						:							Any							=     vocab_size
					SCREAMING_SNAKE_CASE						:							Any							=     hidden_size
					SCREAMING_SNAKE_CASE						:							Optional[Any]							=     num_hidden_layers
					SCREAMING_SNAKE_CASE						:							str							=     num_attention_heads
					SCREAMING_SNAKE_CASE						:							List[Any]							=     hidden_act
					SCREAMING_SNAKE_CASE						:							Any							=     intermediate_size
					SCREAMING_SNAKE_CASE						:							Any							=     hidden_dropout_prob
					SCREAMING_SNAKE_CASE						:							str							=     attention_probs_dropout_prob
					SCREAMING_SNAKE_CASE						:							Union[str, Any]							=     max_position_embeddings
					SCREAMING_SNAKE_CASE						:							str							=     type_vocab_size
					SCREAMING_SNAKE_CASE						:							List[str]							=     initializer_range
					SCREAMING_SNAKE_CASE						:							Optional[int]							=     layer_norm_eps
					SCREAMING_SNAKE_CASE						:							Tuple							=     position_embedding_type
					SCREAMING_SNAKE_CASE						:							int							=     use_cache
					SCREAMING_SNAKE_CASE						:							Optional[int]							=     classifier_dropout
					SCREAMING_SNAKE_CASE						:							List[Any]							=     pre_norm
					SCREAMING_SNAKE_CASE						:							int							=     adapter_reduction_factor
					SCREAMING_SNAKE_CASE						:							List[Any]							=     adapter_layer_norm
					SCREAMING_SNAKE_CASE						:							Any							=     adapter_reuse_layer_norm
					SCREAMING_SNAKE_CASE						:							Any							=     ln_before_adapter
					SCREAMING_SNAKE_CASE						:							Tuple							=     list(_SCREAMING_SNAKE_CASE    )
					SCREAMING_SNAKE_CASE						:							List[Any]							=     default_language




class     lowerCAmelCase__						(	_lowerCamelCase ):


	'''simple docstring'''







	@property
	def 			_lowerCAmelCase     (      self				:       Union[str, Any]    )						->	Mapping[str, Mapping[int, str]]:





					"""simple docstring"""


					if self.task == "multiple-choice":
									SCREAMING_SNAKE_CASE						:							Optional[int]							=     {0: 'batch', 1: 'choice', 2: 'sequence'}
					else:
									SCREAMING_SNAKE_CASE						:							List[str]							=     {0: 'batch', 1: 'sequence'}
					return OrderedDict(
					    [
					        ('input_ids', dynamic_axis),
					        ('attention_mask', dynamic_axis),
					    ]    )





