'''simple docstring'''




import functools
import operator

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


__lowercase          =  logging.get_logger(__name__)

__lowercase          =  {
    'microsoft/unispeech-large-1500h-cv': (
        'https://huggingface.co/microsoft/unispeech-large-1500h-cv/resolve/main/config.json'
    ),
    # See all UniSpeech models at https://huggingface.co/models?filter=unispeech
}






class 				a__(					lowerCAmelCase__	):


			'''simple docstring'''






			UpperCAmelCase_			:     Optional[Any]      =       '''unispeech'''



			def __init__(   self       ,    __lowerCAmelCase=32       ,    __lowerCAmelCase=768       ,    __lowerCAmelCase=12       ,    __lowerCAmelCase=12       ,    __lowerCAmelCase=3072       ,    __lowerCAmelCase="gelu"       ,    __lowerCAmelCase=0.1       ,    __lowerCAmelCase=0.1       ,    __lowerCAmelCase=0.1       ,    __lowerCAmelCase=0.0       ,    __lowerCAmelCase=0.0       ,    __lowerCAmelCase=0.1       ,    __lowerCAmelCase=0.1       ,    __lowerCAmelCase=0.02       ,    __lowerCAmelCase=1E-5       ,    __lowerCAmelCase="group"       ,    __lowerCAmelCase="gelu"       ,    __lowerCAmelCase=(512, 512, 512, 512, 512, 512, 512)       ,    __lowerCAmelCase=(5, 2, 2, 2, 2, 2, 2)       ,    __lowerCAmelCase=(10, 3, 3, 3, 3, 2, 2)       ,    __lowerCAmelCase=False       ,    __lowerCAmelCase=128       ,    __lowerCAmelCase=16       ,    __lowerCAmelCase=False       ,    __lowerCAmelCase=True       ,    __lowerCAmelCase=0.05       ,    __lowerCAmelCase=10       ,    __lowerCAmelCase=2       ,    __lowerCAmelCase=0.0       ,    __lowerCAmelCase=10       ,    __lowerCAmelCase=0       ,    __lowerCAmelCase=320       ,    __lowerCAmelCase=2       ,    __lowerCAmelCase=0.1       ,    __lowerCAmelCase=100       ,    __lowerCAmelCase=256       ,    __lowerCAmelCase=256       ,    __lowerCAmelCase=0.1       ,    __lowerCAmelCase="mean"       ,    __lowerCAmelCase=False       ,    __lowerCAmelCase=False       ,    __lowerCAmelCase=256       ,    __lowerCAmelCase=80       ,    __lowerCAmelCase=0       ,    __lowerCAmelCase=1       ,    __lowerCAmelCase=2       ,    __lowerCAmelCase=0.5       ,    **__lowerCAmelCase       ,    ):




					"""simple docstring"""


					super().__init__(**__lowerCAmelCase       ,    pad_token_id=__lowerCAmelCase       ,    bos_token_id=__lowerCAmelCase       ,    eos_token_id=__lowerCAmelCase)
					lowerCAmelCase   					=  hidden_size
					lowerCAmelCase   					=  feat_extract_norm
					lowerCAmelCase   					=  feat_extract_activation
					lowerCAmelCase   					=  list(__lowerCAmelCase)
					lowerCAmelCase   					=  list(__lowerCAmelCase)
					lowerCAmelCase   					=  list(__lowerCAmelCase)
					lowerCAmelCase   					=  conv_bias
					lowerCAmelCase   					=  num_conv_pos_embeddings
					lowerCAmelCase   					=  num_conv_pos_embedding_groups
					lowerCAmelCase   					=  len(self.conv_dim)
					lowerCAmelCase   					=  num_hidden_layers
					lowerCAmelCase   					=  intermediate_size
					lowerCAmelCase   					=  hidden_act
					lowerCAmelCase   					=  num_attention_heads
					lowerCAmelCase   					=  hidden_dropout
					lowerCAmelCase   					=  attention_dropout
					lowerCAmelCase   					=  activation_dropout
					lowerCAmelCase   					=  feat_proj_dropout
					lowerCAmelCase   					=  final_dropout
					lowerCAmelCase   					=  layerdrop
					lowerCAmelCase   					=  layer_norm_eps
					lowerCAmelCase   					=  initializer_range
					lowerCAmelCase   					=  num_ctc_classes
					lowerCAmelCase   					=  vocab_size
					lowerCAmelCase   					=  do_stable_layer_norm
					lowerCAmelCase   					=  use_weighted_layer_sum
					lowerCAmelCase   					=  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
					lowerCAmelCase   					=  apply_spec_augment
					lowerCAmelCase   					=  mask_time_prob
					lowerCAmelCase   					=  mask_time_length
					lowerCAmelCase   					=  mask_time_min_masks
					lowerCAmelCase   					=  mask_feature_prob
					lowerCAmelCase   					=  mask_feature_length
					lowerCAmelCase   					=  mask_feature_min_masks

					# parameters for pretraining with codevector quantized representations
					lowerCAmelCase   					=  num_codevectors_per_group
					lowerCAmelCase   					=  num_codevector_groups
					lowerCAmelCase   					=  contrastive_logits_temperature
					lowerCAmelCase   					=  feat_quantizer_dropout
					lowerCAmelCase   					=  num_negatives
					lowerCAmelCase   					=  codevector_dim
					lowerCAmelCase   					=  proj_codevector_dim
					lowerCAmelCase   					=  diversity_loss_weight

					# ctc loss
					lowerCAmelCase   					=  ctc_loss_reduction
					lowerCAmelCase   					=  ctc_zero_infinity

					# pretraining loss
					lowerCAmelCase   					=  replace_prob







			@property
			def 							a_       (   self):




					"""simple docstring"""


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








"""simple docstring"""






from collections.abc import Callable
def      lowerCamelCase       (     _UpperCamelCase		:      Callable[[float], float]       ,			_UpperCamelCase		:      float       ,			_UpperCamelCase		:      float							)		->       float:

							'''simple docstring'''



							__UpperCAmelCase   :						float      							=					a
							__UpperCAmelCase   :						float      							=					b
							if function(_UpperCamelCase							) == 0:  # one of the a or b is a root for the function
														return a
							elif function(_UpperCamelCase							) == 0:
														return b
							elif (
							    function(_UpperCamelCase							) * function(_UpperCamelCase							) > 0
							):  # if none of these are root and they are both positive or negative,
														# then this algorithm can't find the root
														raise ValueError("""could not find root in given interval."""							)
							else:
														__UpperCAmelCase   :						float      							=					start + (end - start) / 2.0
														while abs(start - mid							) > 1_0**-7:  # until precisely equals to 10^-7
																					if function(_UpperCamelCase							) == 0:
																												return mid
																					elif function(_UpperCamelCase							) * function(_UpperCamelCase							) < 0:
																												__UpperCAmelCase   :						Union[str, Any]      							=					mid
																					else:
																												__UpperCAmelCase   :						List[Any]      							=					mid
																					__UpperCAmelCase   :						Optional[Any]      							=					start + (end - start) / 2.0
														return mid
def      lowerCamelCase       (     _UpperCamelCase		:      float							)		->       float:

							'''simple docstring'''



							return x**3 - 2 * x - 5


if __name__ == "__main__":
							print(bisection(f, 1, 1000))

							import doctest

							doctest.testmod()
