


"""simple docstring"""





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


snake_case__		:     Union[str, Any]    				=				logging.get_logger(__name__)

snake_case__		:     List[Any]    				=				{
    '''CarlCochet/trajectory-transformer-halfcheetah-medium-v2''': (
        '''https://huggingface.co/CarlCochet/trajectory-transformer-halfcheetah-medium-v2/resolve/main/config.json'''
    ),
    # See all TrajectoryTransformer models at https://huggingface.co/models?filter=trajectory_transformer
}



class 		snake_case_(       a__			):
     __UpperCamelCase  =					'''trajectory_transformer'''
     __UpperCamelCase  =					['''past_key_values''']
     __UpperCamelCase  =					{
         '''hidden_size''': '''n_embd''',
         '''num_attention_heads''': '''n_head''',
         '''num_hidden_layers''': '''n_layer''',
     }






     def __init__(	self  :					Dict					,				UpperCamelCase_  :					List[Any]=1_0_0					,				UpperCamelCase_  :					Union[str, Any]=5					,				UpperCamelCase_  :					Any=1					,				UpperCamelCase_  :					str=1					,				UpperCamelCase_  :					int=2_4_9					,				UpperCamelCase_  :					Optional[int]=6					,				UpperCamelCase_  :					Union[str, Any]=1_7					,				UpperCamelCase_  :					List[str]=2_5					,				UpperCamelCase_  :					Any=4					,				UpperCamelCase_  :					Optional[Any]=4					,				UpperCamelCase_  :					Tuple=1_2_8					,				UpperCamelCase_  :					Optional[Any]=0.1					,				UpperCamelCase_  :					Dict=0.1					,				UpperCamelCase_  :					Union[str, Any]=0.1					,				UpperCamelCase_  :					Union[str, Any]=0.0_006					,				UpperCamelCase_  :					int=5_1_2					,				UpperCamelCase_  :					List[Any]=0.02					,				UpperCamelCase_  :					Optional[Any]=1E-12					,				UpperCamelCase_  :					int=1					,				UpperCamelCase_  :					int=True					,				UpperCamelCase_  :					Any=1					,				UpperCamelCase_  :					Any=5_0_2_5_6					,				UpperCamelCase_  :					List[str]=5_0_2_5_6					,				**UpperCamelCase_  :					str					,				):
           lowerCAmelCase					:	List[str]       =   vocab_size
           lowerCAmelCase					:	Any       =   action_weight
           lowerCAmelCase					:	Optional[Any]       =   reward_weight
           lowerCAmelCase					:	Dict       =   value_weight
           lowerCAmelCase					:	int       =   max_position_embeddings
           lowerCAmelCase					:	Any       =   block_size
           lowerCAmelCase					:	List[str]       =   action_dim
           lowerCAmelCase					:	int       =   observation_dim
           lowerCAmelCase					:	Dict       =   transition_dim
           lowerCAmelCase					:	Optional[Any]       =   learning_rate
           lowerCAmelCase					:	Tuple       =   n_layer
           lowerCAmelCase					:	List[Any]       =   n_head
           lowerCAmelCase					:	Tuple       =   n_embd
           lowerCAmelCase					:	Optional[int]       =   embd_pdrop
           lowerCAmelCase					:	Union[str, Any]       =   attn_pdrop
           lowerCAmelCase					:	List[str]       =   resid_pdrop
           lowerCAmelCase					:	str       =   initializer_range
           lowerCAmelCase					:	Union[str, Any]       =   layer_norm_eps
           lowerCAmelCase					:	Union[str, Any]       =   kaiming_initializer_range
           lowerCAmelCase					:	int       =   use_cache
           super().__init__(pad_token_id=UpperCamelCase_					,				bos_token_id=UpperCamelCase_					,				eos_token_id=UpperCamelCase_					,				**UpperCamelCase_				)






"""simple docstring"""





def      _snake_case						(						_snake_case				:			float ,   _snake_case				:			list[float]			):
      if discount_rate < 0:
            raise ValueError('''Discount rate cannot be negative'''			)
      if not cash_flows:
            raise ValueError('''Cash flows list cannot be empty'''			)
      lowerCAmelCase					:	List[str]       =   sum(
          cash_flow / ((1 + discount_rate) ** i) for i, cash_flow in enumerate(_snake_case			)			)
      return round(_snake_case ,   ndigits=2			)


if __name__ == "__main__":
 import doctest

 doctest.testmod()


