


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


def     a   (    __a     )						->			np.array:



					'''simple docstring'''






					return 1 / (1 + np.exp(-vector     ))


def     a   (    __a     )						->			np.array:



					'''simple docstring'''






					return vector * sigmoid(1.7_0_2 * vector     )


if __name__ == "__main__":
		import doctest

		doctest.testmod()



'''simple docstring'''
from ...configuration_utils import PretrainedConfig
from ...utils import logging


__snake_case							   =  logging.get_logger(__name__)

__snake_case							   =  {
    '''transfo-xl-wt103''': '''https://huggingface.co/transfo-xl-wt103/resolve/main/config.json''',
}
class      lowercase			(							A__      ):

		"""simple docstring"""

		_a									=       'transfo-xl'
		_a									=       ['mems']
		_a									=       {
		    'n_token': 'vocab_size',
		    'hidden_size': 'd_model',
		    'num_attention_heads': 'n_head',
		    'num_hidden_layers': 'n_layer',
		}




		def __init__(	self					,     UpperCamelCase_=267735					,     UpperCamelCase_=[20000, 40000, 200000]					,     UpperCamelCase_=1024					,     UpperCamelCase_=1024					,     UpperCamelCase_=16					,     UpperCamelCase_=64					,     UpperCamelCase_=4096					,     UpperCamelCase_=4					,     UpperCamelCase_=False					,     UpperCamelCase_=18					,     UpperCamelCase_=1600					,     UpperCamelCase_=1000					,     UpperCamelCase_=True					,     UpperCamelCase_=True					,     UpperCamelCase_=0					,     UpperCamelCase_=-1					,     UpperCamelCase_=True					,     UpperCamelCase_=0.1					,     UpperCamelCase_=0.0					,     UpperCamelCase_=True					,     UpperCamelCase_="normal"					,     UpperCamelCase_=0.01					,     UpperCamelCase_=0.01					,     UpperCamelCase_=0.02					,     UpperCamelCase_=1e-5					,     UpperCamelCase_=0					,     **UpperCamelCase_					,     ):

							'''simple docstring'''


							UpperCamelCase__     :Dict							      =				vocab_size
							UpperCamelCase__     :Optional[int]							      =				[]
							self.cutoffs.extend(UpperCamelCase_							)
							if proj_share_all_but_first:
												UpperCamelCase__     :Any							      =				[False] + [True] * len(self.cutoffs							)
							else:
												UpperCamelCase__     :Dict							      =				[False] + [False] * len(self.cutoffs							)
							UpperCamelCase__     :Union[str, Any]							      =				d_model
							UpperCamelCase__     :List[Any]							      =				d_embed
							UpperCamelCase__     :Any							      =				d_head
							UpperCamelCase__     :Tuple							      =				d_inner
							UpperCamelCase__     :int							      =				div_val
							UpperCamelCase__     :int							      =				pre_lnorm
							UpperCamelCase__     :Any							      =				n_layer
							UpperCamelCase__     :int							      =				n_head
							UpperCamelCase__     :Tuple							      =				mem_len
							UpperCamelCase__     :List[str]							      =				same_length
							UpperCamelCase__     :Any							      =				attn_type
							UpperCamelCase__     :List[str]							      =				clamp_len
							UpperCamelCase__     :Union[str, Any]							      =				sample_softmax
							UpperCamelCase__     :List[Any]							      =				adaptive
							UpperCamelCase__     :List[Any]							      =				dropout
							UpperCamelCase__     :Optional[Any]							      =				dropatt
							UpperCamelCase__     :str							      =				untie_r
							UpperCamelCase__     :List[Any]							      =				init
							UpperCamelCase__     :Optional[Any]							      =				init_range
							UpperCamelCase__     :int							      =				proj_init_std
							UpperCamelCase__     :List[str]							      =				init_std
							UpperCamelCase__     :Optional[int]							      =				layer_norm_epsilon
							super().__init__(eos_token_id=UpperCamelCase_					,     **UpperCamelCase_							)




		@property
		def 					lowerCAmelCase__       (	self							):

							'''simple docstring'''


							logger.info(F'''The model {self.model_type} is one of the few models that has no sequence length limit.'''							)
							return -1




		@max_position_embeddings.setter
		def 					lowerCAmelCase__       (	self					,     UpperCamelCase_							):

							'''simple docstring'''


							raise NotImplementedError(
							    F'''The model {self.model_type} is one of the few models that has no sequence length limit.'''							)