


import functools
import operator

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


__UpperCAmelCase      			=  logging.get_logger(__name__)

__UpperCAmelCase      			=  {
    """facebook/hubert-base-ls960""": """https://huggingface.co/facebook/hubert-base-ls960/resolve/main/config.json""",
    # See all Hubert models at https://huggingface.co/models?filter=hubert
}



class 							lowercase__(						__A			):






      '''simple docstring'''







      snake_case__       =					"""hubert"""




      def __init__(		self   ,			__SCREAMING_SNAKE_CASE=32   ,			__SCREAMING_SNAKE_CASE=7_68   ,			__SCREAMING_SNAKE_CASE=12   ,			__SCREAMING_SNAKE_CASE=12   ,			__SCREAMING_SNAKE_CASE=30_72   ,			__SCREAMING_SNAKE_CASE="gelu"   ,			__SCREAMING_SNAKE_CASE=0.1   ,			__SCREAMING_SNAKE_CASE=0.1   ,			__SCREAMING_SNAKE_CASE=0.1   ,			__SCREAMING_SNAKE_CASE=True   ,			__SCREAMING_SNAKE_CASE=0.0   ,			__SCREAMING_SNAKE_CASE=0.1   ,			__SCREAMING_SNAKE_CASE=0.1   ,			__SCREAMING_SNAKE_CASE=0.02   ,			__SCREAMING_SNAKE_CASE=1E-5   ,			__SCREAMING_SNAKE_CASE="group"   ,			__SCREAMING_SNAKE_CASE="gelu"   ,			__SCREAMING_SNAKE_CASE=(5_12, 5_12, 5_12, 5_12, 5_12, 5_12, 5_12)   ,			__SCREAMING_SNAKE_CASE=(5, 2, 2, 2, 2, 2, 2)   ,			__SCREAMING_SNAKE_CASE=(10, 3, 3, 3, 3, 2, 2)   ,			__SCREAMING_SNAKE_CASE=False   ,			__SCREAMING_SNAKE_CASE=1_28   ,			__SCREAMING_SNAKE_CASE=16   ,			__SCREAMING_SNAKE_CASE=False   ,			__SCREAMING_SNAKE_CASE=True   ,			__SCREAMING_SNAKE_CASE=0.05   ,			__SCREAMING_SNAKE_CASE=10   ,			__SCREAMING_SNAKE_CASE=2   ,			__SCREAMING_SNAKE_CASE=0.0   ,			__SCREAMING_SNAKE_CASE=10   ,			__SCREAMING_SNAKE_CASE=0   ,			__SCREAMING_SNAKE_CASE="sum"   ,			__SCREAMING_SNAKE_CASE=False   ,			__SCREAMING_SNAKE_CASE=False   ,			__SCREAMING_SNAKE_CASE=2_56   ,			__SCREAMING_SNAKE_CASE=0   ,			__SCREAMING_SNAKE_CASE=1   ,			__SCREAMING_SNAKE_CASE=2   ,			**__SCREAMING_SNAKE_CASE   ,			)					->						Optional[Any]:







         """simple docstring"""







         super().__init__(**lowerCamelCase__   ,			pad_token_id=lowerCamelCase__   ,			bos_token_id=lowerCamelCase__   ,			eos_token_id=lowerCamelCase__)
         UpperCamelCase__ :			int 						=hidden_size
         UpperCamelCase__ :			int 						=feat_extract_norm
         UpperCamelCase__ :			str 						=feat_extract_activation
         UpperCamelCase__ :			Tuple 						=list(lowerCamelCase__)
         UpperCamelCase__ :			List[str] 						=list(lowerCamelCase__)
         UpperCamelCase__ :			Union[str, Any] 						=list(lowerCamelCase__)
         UpperCamelCase__ :			Optional[int] 						=conv_bias
         UpperCamelCase__ :			Tuple 						=num_conv_pos_embeddings
         UpperCamelCase__ :			Tuple 						=num_conv_pos_embedding_groups
         UpperCamelCase__ :			Optional[int] 						=len(self.conv_dim)
         UpperCamelCase__ :			List[Any] 						=num_hidden_layers
         UpperCamelCase__ :			Union[str, Any] 						=intermediate_size
         UpperCamelCase__ :			int 						=hidden_act
         UpperCamelCase__ :			Dict 						=num_attention_heads
         UpperCamelCase__ :			int 						=hidden_dropout
         UpperCamelCase__ :			List[Any] 						=attention_dropout
         UpperCamelCase__ :			str 						=activation_dropout
         UpperCamelCase__ :			List[str] 						=feat_proj_layer_norm
         UpperCamelCase__ :			List[str] 						=feat_proj_dropout
         UpperCamelCase__ :			Optional[Any] 						=final_dropout
         UpperCamelCase__ :			int 						=layerdrop
         UpperCamelCase__ :			str 						=layer_norm_eps
         UpperCamelCase__ :			Optional[int] 						=initializer_range
         UpperCamelCase__ :			Optional[int] 						=vocab_size
         UpperCamelCase__ :			List[Any] 						=do_stable_layer_norm
         UpperCamelCase__ :			List[str] 						=use_weighted_layer_sum
         UpperCamelCase__ :			Tuple 						=classifier_proj_size

         if (
             (len(self.conv_stride) != self.num_feat_extract_layers)
             or (len(self.conv_kernel) != self.num_feat_extract_layers)
             or (len(self.conv_dim) != self.num_feat_extract_layers)
         ):
            raise ValueError(
                "Configuration for convolutional layers is incorrect. It is required that `len(config.conv_dim)` =="
                " `len(config.conv_stride)` == `len(config.conv_kernel)`, but is `len(config.conv_dim) ="
                F''' {len(self.conv_dim)}`, `len(config.conv_stride) = {len(self.conv_stride)}`,'''
                F''' `len(config.conv_kernel) = {len(self.conv_kernel)}`.''')

         # fine-tuning config parameters for SpecAugment: https://arxiv.org/abs/1904.08779
         UpperCamelCase__ :			Optional[Any] 						=apply_spec_augment
         UpperCamelCase__ :			str 						=mask_time_prob
         UpperCamelCase__ :			Dict 						=mask_time_length
         UpperCamelCase__ :			Tuple 						=mask_time_min_masks
         UpperCamelCase__ :			Optional[int] 						=mask_feature_prob
         UpperCamelCase__ :			str 						=mask_feature_length
         UpperCamelCase__ :			Optional[int] 						=mask_feature_min_masks

         # ctc loss
         UpperCamelCase__ :			str 						=ctc_loss_reduction
         UpperCamelCase__ :			Optional[Any] 						=ctc_zero_infinity




      @property
      def    UpperCAmelCase							(		self)					->						Optional[Any]:







         """simple docstring"""







         return functools.reduce(operator.mul   ,			self.conv_stride   ,			1)







'''simple docstring'''
import os
def 							snake_case_    (  ):



    """simple docstring"""




    __lowercase     							=		os.path.dirname(os.path.realpath(a__     )     )
    __lowercase     							=		os.path.join(a__       ,"""triangle.txt"""     )

    with open(a__     ) as f:
        __lowercase     							=		f.readlines()

    __lowercase     							=		[[int(a__     ) for y in x.rstrip("""\r\n"""     ).split(""" """     )] for x in triangle]

    for i in range(1       ,len(a__     )     ):
        for j in range(len(a[i]     )     ):
            __lowercase     							=		a[i - 1][j] if j != len(a[i - 1]     ) else 0
            __lowercase     							=		a[i - 1][j - 1] if j > 0 else 0
            a[i][j] += max(a__       ,a__     )
    return max(a[-1]     )


if __name__ == "__main__":
  print(solution())




