

'''simple docstring'''





from ...configuration_utils import PretrainedConfig
from ...utils import logging


A_	= logging.get_logger(__name__)

A_	= {
    "microsoft/trocr-base-handwritten": (
        "https://huggingface.co/microsoft/trocr-base-handwritten/resolve/main/config.json"
    ),
    # See all TrOCR models at https://huggingface.co/models?filter=trocr
}


class  UpperCAmelCase (							UpperCAmelCase__    ):

		'''simple docstring'''






		SCREAMING_SNAKE_CASE_           =					'trocr'
		SCREAMING_SNAKE_CASE_           =					['past_key_values']
		SCREAMING_SNAKE_CASE_           =					{
		    'num_attention_heads': 'decoder_attention_heads',
		    'hidden_size': 'd_model',
		    'num_hidden_layers': 'decoder_layers',
		}
		def __init__(					self   ,			SCREAMING_SNAKE_CASE_=50265   ,			SCREAMING_SNAKE_CASE_=1024   ,			SCREAMING_SNAKE_CASE_=12   ,			SCREAMING_SNAKE_CASE_=16   ,			SCREAMING_SNAKE_CASE_=4096   ,			SCREAMING_SNAKE_CASE_="gelu"   ,			SCREAMING_SNAKE_CASE_=512   ,			SCREAMING_SNAKE_CASE_=0.1   ,			SCREAMING_SNAKE_CASE_=0.0   ,			SCREAMING_SNAKE_CASE_=0.0   ,			SCREAMING_SNAKE_CASE_=2   ,			SCREAMING_SNAKE_CASE_=0.02   ,			SCREAMING_SNAKE_CASE_=0.0   ,			SCREAMING_SNAKE_CASE_=True   ,			SCREAMING_SNAKE_CASE_=False   ,			SCREAMING_SNAKE_CASE_=True   ,			SCREAMING_SNAKE_CASE_=True   ,			SCREAMING_SNAKE_CASE_=1   ,			SCREAMING_SNAKE_CASE_=0   ,			SCREAMING_SNAKE_CASE_=2   ,			**SCREAMING_SNAKE_CASE_   ,			)  ->     Union[str, Any]:






							'''simple docstring'''



							lowerCamelCase_  				=      vocab_size
							lowerCamelCase_  				=      d_model
							lowerCamelCase_  				=      decoder_layers
							lowerCamelCase_  				=      decoder_attention_heads
							lowerCamelCase_  				=      decoder_ffn_dim
							lowerCamelCase_  				=      activation_function
							lowerCamelCase_  				=      max_position_embeddings
							lowerCamelCase_  				=      dropout
							lowerCamelCase_  				=      attention_dropout
							lowerCamelCase_  				=      activation_dropout
							lowerCamelCase_  				=      init_std
							lowerCamelCase_  				=      decoder_layerdrop
							lowerCamelCase_  				=      use_cache
							lowerCamelCase_  				=      scale_embedding
							lowerCamelCase_  				=      use_learned_position_embeddings
							lowerCamelCase_  				=      layernorm_embedding

							super().__init__(
							    pad_token_id=SCREAMING_SNAKE_CASE_   ,			bos_token_id=SCREAMING_SNAKE_CASE_   ,			eos_token_id=SCREAMING_SNAKE_CASE_   ,			decoder_start_token_id=SCREAMING_SNAKE_CASE_   ,			**SCREAMING_SNAKE_CASE_   ,			)









'''simple docstring'''
import numpy as np





def 			lowerCamelCase(							SCREAMING_SNAKE_CASE_     )		->		np.array:
			return 1 / (1 + np.exp(-vector     ))





def 			lowerCamelCase(							SCREAMING_SNAKE_CASE_     )		->		np.array:
			return vector * sigmoid(1.702 * vector     )


if __name__ == "__main__":
							import doctest

							doctest.testmod()




