
"""simple docstring"""

import json
import logging
import os
import re
import sys
from dataclasses import dataclass, field
from typing import Any, Dict, List, Optional, Union

import datasets
import numpy as np
import torch
import torchaudio
from packaging import version
from torch import nn

import transformers
from transformers import (
    HfArgumentParser,
    Trainer,
    TrainingArguments,
    WavaVecaCTCTokenizer,
    WavaVecaFeatureExtractor,
    WavaVecaForCTC,
    WavaVecaProcessor,
    is_apex_available,
    set_seed,
)
from transformers.trainer_utils import get_last_checkpoint, is_main_process


if is_apex_available():
   from apex import amp


if version.parse(version.parse(torch.__version__).base_version) >= version.parse('''1.6'''):
   SCREAMING_SNAKE_CASE_            =    True
   from torch.cuda.amp import autocast

SCREAMING_SNAKE_CASE_            =    logging.getLogger(__name__)




def      lowercase__    (       lowerCAmelCase					:       Optional[Any]=None			,					lowerCAmelCase					:       Optional[Any]=None			)			->   Any:






    """simple docstring"""




    return field(default_factory=lambda: default			,					metadata=lowerCAmelCase			)
@dataclass
class   _UpperCAmelCase				:
      __SCREAMING_SNAKE_CASE :				str				   =						field(
          metadata={"help": "Path to pretrained model or model identifier from huggingface.co/models"}				)
      __SCREAMING_SNAKE_CASE :				Optional[str]				   =						field(
          default=SCREAMING_SNAKE_CASE_  ,      metadata={"help": "Where do you want to store the pretrained models downloaded from huggingface.co"}  ,      )
      __SCREAMING_SNAKE_CASE :				Optional[bool]				   =						field(
          default=SCREAMING_SNAKE_CASE_  ,      metadata={"help": "Whether to freeze the feature extractor layers of the model."}				)
      __SCREAMING_SNAKE_CASE :				Optional[float]				   =						field(
          default=0.1  ,      metadata={"help": "The dropout ratio for the attention probabilities."}				)
      __SCREAMING_SNAKE_CASE :				Optional[float]				   =						field(
          default=0.1  ,      metadata={"help": "The dropout ratio for activations inside the fully connected layer."}				)
      __SCREAMING_SNAKE_CASE :				Optional[float]				   =						field(
          default=0.1  ,      metadata={
              "help": "The dropout probabilitiy for all fully connected layers in the embeddings, encoder, and pooler."
          }  ,      )
      __SCREAMING_SNAKE_CASE :				Optional[float]				   =						field(
          default=0.1  ,      metadata={"help": "The dropout probabilitiy for all 1D convolutional layers in feature extractor."}  ,      )
      __SCREAMING_SNAKE_CASE :				Optional[float]				   =						field(
          default=0.05  ,      metadata={
              "help": (
                  "Propability of each feature vector along the time axis to be chosen as the start of the vector"
                  "span to be masked. Approximately ``mask_time_prob * sequence_length // mask_time_length`` feature"
                  "vectors will be masked along the time axis. This is only relevant if ``apply_spec_augment is True``."
              )
          }  ,      )
      __SCREAMING_SNAKE_CASE :				Optional[float]				   =						field(default=0.0  ,      metadata={"help": "The LayerDrop probability."}				)

@dataclass
class   _UpperCAmelCase				:
      __SCREAMING_SNAKE_CASE :				Optional[str]				   =						field(
          default=SCREAMING_SNAKE_CASE_  ,      metadata={"help": "The configuration name of the dataset to use (via the datasets library)."}				)
      __SCREAMING_SNAKE_CASE :				Optional[str]				   =						field(
          default="train+validation"  ,      metadata={
              "help": "The name of the training data set split to use (via the datasets library). Defaults to 'train'"
          }  ,      )
      __SCREAMING_SNAKE_CASE :				bool				   =						field(
          default=SCREAMING_SNAKE_CASE_  ,      metadata={"help": "Overwrite the cached preprocessed datasets or not."}				)
      __SCREAMING_SNAKE_CASE :				Optional[int]				   =						field(
          default=SCREAMING_SNAKE_CASE_  ,      metadata={"help": "The number of processes to use for the preprocessing."}  ,      )
      __SCREAMING_SNAKE_CASE :				Optional[int]				   =						field(
          default=SCREAMING_SNAKE_CASE_  ,      metadata={
              "help": (
                  "For debugging purposes or quicker training, truncate the number of training examples to this "
                  "value if set."
              )
          }  ,      )
      __SCREAMING_SNAKE_CASE :				Optional[int]				   =						field(
          default=SCREAMING_SNAKE_CASE_  ,      metadata={
              "help": (
                  "For debugging purposes or quicker training, truncate the number of validation examples to this "
                  "value if set."
              )
          }  ,      )
      __SCREAMING_SNAKE_CASE :				List[str]				   =						list_field(
          default=[",", "?", ".", "!", "-", ";", ":", "\"\"", "%", "'", "\"", "�"]  ,      metadata={"help": "A list of characters to remove from the transcripts."}  ,      )

@dataclass
class   _UpperCAmelCase				:
      __SCREAMING_SNAKE_CASE :				WavaVecaProcessor
      __SCREAMING_SNAKE_CASE :				Union[bool, str]				   =						True
      __SCREAMING_SNAKE_CASE :				Optional[int]				   =						None
      __SCREAMING_SNAKE_CASE :				Optional[int]				   =						None
      __SCREAMING_SNAKE_CASE :				Optional[int]				   =						None
      __SCREAMING_SNAKE_CASE :				Optional[int]				   =						None




      def __call__(				self ,							lowercase_				)    ->       Dict[str, torch.Tensor]:
          # split inputs and labels since they have to be of different lenghts and need
          # different padding methods
          UpperCAmelCase          =       [{'input_values': feature['input_values']} for feature in features]
          UpperCAmelCase          =       [{'input_ids': feature['labels']} for feature in features]

          UpperCAmelCase          =       self.processor.pad(
              lowercase_ ,							padding=self.padding ,							max_length=self.max_length ,							pad_to_multiple_of=self.pad_to_multiple_of ,							return_tensors='pt' ,							)
          UpperCAmelCase          =       self.processor.pad(
              labels=lowercase_ ,							padding=self.padding ,							max_length=self.max_length_labels ,							pad_to_multiple_of=self.pad_to_multiple_of_labels ,							return_tensors='pt' ,							)

          # replace padding with -100 to ignore loss correctly
          UpperCAmelCase          =       labels_batch['input_ids'].masked_fill(labels_batch.attention_mask.ne(1				) ,							-1_0_0				)

          UpperCAmelCase          =       labels

          return batch

class   _UpperCAmelCase				(		SCREAMING_SNAKE_CASE_				):




      def      a_   (				self ,							lowercase_ ,							lowercase_				)    ->       torch.Tensor:
          model.train()
          UpperCAmelCase          =       self._prepare_inputs(lowercase_				)

          if self.use_amp:
              with autocast():
                  UpperCAmelCase          =       self.compute_loss(lowercase_ ,							lowercase_				)
          else:
              UpperCAmelCase          =       self.compute_loss(lowercase_ ,							lowercase_				)

          if self.args.n_gpu > 1:
              if model.module.config.ctc_loss_reduction == "mean":
                  UpperCAmelCase          =       loss.mean()
              elif model.module.config.ctc_loss_reduction == "sum":
                  UpperCAmelCase          =       loss.sum() / (inputs['labels'] >= 0).sum()
              else:
                  raise ValueError(F"{model.config.ctc_loss_reduction} is not valid. Choose one of ['mean', 'sum']"				)

          if self.args.gradient_accumulation_steps > 1:
              UpperCAmelCase          =       loss / self.args.gradient_accumulation_steps

          if self.use_amp:
              self.scaler.scale(lowercase_				).backward()
          elif self.use_apex:
              with amp.scale_loss(lowercase_ ,							self.optimizer				) as scaled_loss:
                  scaled_loss.backward()
          elif self.deepspeed:
              self.deepspeed.backward(lowercase_				)
          else:
              loss.backward()

          return loss.detach()




def      lowercase__    (       )			->   Any:






    """simple docstring"""




    UpperCAmelCase          =       HfArgumentParser((ModelArguments, DataTrainingArguments, TrainingArguments)			)
    if len(sys.argv			) == 2 and sys.argv[1].endswith('.json'			):
        # If we pass only one argument to the script and it's the path to a json file,
        # let's parse it to get our arguments.
        UpperCAmelCase      ,				UpperCAmelCase      ,				UpperCAmelCase          =       parser.parse_json_file(json_file=os.path.abspath(sys.argv[1]			)			)
    else:
        UpperCAmelCase      ,				UpperCAmelCase      ,				UpperCAmelCase          =       parser.parse_args_into_dataclasses()

    # Detecting last checkpoint.
    UpperCAmelCase          =       None
    if os.path.isdir(training_args.output_dir			) and training_args.do_train and not training_args.overwrite_output_dir:
        UpperCAmelCase          =       get_last_checkpoint(training_args.output_dir			)
        if last_checkpoint is None and len(os.listdir(training_args.output_dir			)			) > 0:
            raise ValueError(
                F"Output directory ({training_args.output_dir}) already exists and is not empty. "
                'Use --overwrite_output_dir to overcome.'			)
        elif last_checkpoint is not None:
            logger.info(
                F"Checkpoint detected, resuming training at {last_checkpoint}. To avoid this behavior, change "
                'the `--output_dir` or add `--overwrite_output_dir` to train from scratch.'			)

    # Setup logging
    logging.basicConfig(
        format='%(asctime)s - %(levelname)s - %(name)s - %(message)s'			,					datefmt='%m/%d/%Y %H:%M:%S'			,					handlers=[logging.StreamHandler(sys.stdout			)]			,					)
    logger.setLevel(logging.INFO if is_main_process(training_args.local_rank			) else logging.WARN			)

    # Log on each process the small summary:
    logger.warning(
        F"Process rank: {training_args.local_rank}, device: {training_args.device}, n_gpu: {training_args.n_gpu}"
        + F"distributed training: {bool(training_args.local_rank != -1			)}, 16-bits training: {training_args.fpaa}"			)
    # Set the verbosity to info of the Transformers logger (on main process only):
    if is_main_process(training_args.local_rank			):
        transformers.utils.logging.set_verbosity_info()
    logger.info('Training/evaluation parameters %s'			,					lowerCAmelCase			)

    # Set seed before initializing model.
    set_seed(training_args.seed			)

    # Get the datasets:
    UpperCAmelCase          =       datasets.load_dataset(
        'common_voice'			,					data_args.dataset_config_name			,					split=data_args.train_split_name			)
    UpperCAmelCase          =       datasets.load_dataset('common_voice'			,					data_args.dataset_config_name			,					split='test'			)

    # Create and save tokenizer
    UpperCAmelCase          =       F"[{''.join(data_args.chars_to_ignore			)}]"

    def remove_special_characters(lowerCAmelCase					:       str			):
        UpperCAmelCase          =       re.sub(lowerCAmelCase			,					''			,					batch['sentence']			).lower() + ' '
        return batch

    UpperCAmelCase          =       train_dataset.map(lowerCAmelCase			,					remove_columns=['sentence']			)
    UpperCAmelCase          =       eval_dataset.map(lowerCAmelCase			,					remove_columns=['sentence']			)

    def extract_all_chars(lowerCAmelCase					:       Union[str, Any]			):
        UpperCAmelCase          =       ' '.join(batch['text']			)
        UpperCAmelCase          =       list(set(lowerCAmelCase			)			)
        return {"vocab": [vocab], "all_text": [all_text]}

    UpperCAmelCase          =       train_dataset.map(
        lowerCAmelCase			,					batched=lowerCAmelCase			,					batch_size=-1			,					keep_in_memory=lowerCAmelCase			,					remove_columns=train_dataset.column_names			,					)
    UpperCAmelCase          =       train_dataset.map(
        lowerCAmelCase			,					batched=lowerCAmelCase			,					batch_size=-1			,					keep_in_memory=lowerCAmelCase			,					remove_columns=eval_dataset.column_names			,					)

    UpperCAmelCase          =       list(set(vocab_train['vocab'][0]			) | set(vocab_test['vocab'][0]			)			)
    UpperCAmelCase          =       {v: k for k, v in enumerate(lowerCAmelCase			)}
    UpperCAmelCase          =       vocab_dict[' ']
    del vocab_dict[" "]
    UpperCAmelCase          =       len(lowerCAmelCase			)
    UpperCAmelCase          =       len(lowerCAmelCase			)

    with open('vocab.json'			,					'w'			) as vocab_file:
        json.dump(lowerCAmelCase			,					lowerCAmelCase			)

    # Load pretrained model and tokenizer
    #
    # Distributed training:
    # The .from_pretrained methods guarantee that only one local process can concurrently
    # download model & vocab.
    UpperCAmelCase          =       WavaVecaCTCTokenizer(
        'vocab.json'			,					unk_token='[UNK]'			,					pad_token='[PAD]'			,					word_delimiter_token='|'			,					)
    UpperCAmelCase          =       WavaVecaFeatureExtractor(
        feature_size=1			,					sampling_rate=16_000			,					padding_value=0.0			,					do_normalize=lowerCAmelCase			,					return_attention_mask=lowerCAmelCase			)
    UpperCAmelCase          =       WavaVecaProcessor(feature_extractor=lowerCAmelCase			,					tokenizer=lowerCAmelCase			)
    UpperCAmelCase          =       WavaVecaForCTC.from_pretrained(
        model_args.model_name_or_path			,					cache_dir=model_args.cache_dir			,					activation_dropout=model_args.activation_dropout			,					attention_dropout=model_args.attention_dropout			,					hidden_dropout=model_args.hidden_dropout			,					feat_proj_dropout=model_args.feat_proj_dropout			,					mask_time_prob=model_args.mask_time_prob			,					gradient_checkpointing=training_args.gradient_checkpointing			,					layerdrop=model_args.layerdrop			,					ctc_loss_reduction='mean'			,					pad_token_id=processor.tokenizer.pad_token_id			,					vocab_size=len(processor.tokenizer			)			,					)

    if data_args.max_train_samples is not None:
        UpperCAmelCase          =       min(len(lowerCAmelCase			)			,					data_args.max_train_samples			)
        UpperCAmelCase          =       train_dataset.select(range(lowerCAmelCase			)			)

    if data_args.max_val_samples is not None:
        UpperCAmelCase          =       eval_dataset.select(range(data_args.max_val_samples			)			)

    UpperCAmelCase          =       torchaudio.transforms.Resample(48_000			,					16_000			)

    # Preprocessing the datasets.
    # We need to read the aduio files as arrays and tokenize the targets.
    def speech_file_to_array_fn(lowerCAmelCase					:       Optional[int]			):
        UpperCAmelCase      ,				UpperCAmelCase          =       torchaudio.load(batch['path']			)
        UpperCAmelCase          =       resampler(lowerCAmelCase			).squeeze().numpy()
        UpperCAmelCase          =       16_000
        UpperCAmelCase          =       batch['text']
        return batch

    UpperCAmelCase          =       train_dataset.map(
        lowerCAmelCase			,					remove_columns=train_dataset.column_names			,					num_proc=data_args.preprocessing_num_workers			,					)
    UpperCAmelCase          =       eval_dataset.map(
        lowerCAmelCase			,					remove_columns=eval_dataset.column_names			,					num_proc=data_args.preprocessing_num_workers			,					)

    def prepare_dataset(lowerCAmelCase					:       str			):
        # check that all files have the correct sampling rate
        assert (
            len(set(batch['sampling_rate']			)			) == 1
        ), F"Make sure all inputs have the same sampling rate of {processor.feature_extractor.sampling_rate}."

        UpperCAmelCase          =       processor(
            audio=batch['speech']			,					text=batch['target_text']			,					sampling_rate=batch['sampling_rate'][0]			)
        batch.update(lowerCAmelCase			)
        return batch

    UpperCAmelCase          =       train_dataset.map(
        lowerCAmelCase			,					remove_columns=train_dataset.column_names			,					batch_size=training_args.per_device_train_batch_size			,					batched=lowerCAmelCase			,					num_proc=data_args.preprocessing_num_workers			,					)
    UpperCAmelCase          =       eval_dataset.map(
        lowerCAmelCase			,					remove_columns=eval_dataset.column_names			,					batch_size=training_args.per_device_train_batch_size			,					batched=lowerCAmelCase			,					num_proc=data_args.preprocessing_num_workers			,					)

    # Metric
    UpperCAmelCase          =       datasets.load_metric('wer'			)

    def compute_metrics(lowerCAmelCase					:       List[Any]			):
        UpperCAmelCase          =       pred.predictions
        UpperCAmelCase          =       np.argmax(lowerCAmelCase			,					axis=-1			)

        UpperCAmelCase          =       processor.tokenizer.pad_token_id

        UpperCAmelCase          =       processor.batch_decode(lowerCAmelCase			)
        # we do not want to group tokens when computing the metrics
        UpperCAmelCase          =       processor.batch_decode(pred.label_ids			,					group_tokens=lowerCAmelCase			)

        UpperCAmelCase          =       wer_metric.compute(predictions=lowerCAmelCase			,					references=lowerCAmelCase			)

        return {"wer": wer}

    if model_args.freeze_feature_extractor:
        model.freeze_feature_extractor()

    # Data collator
    UpperCAmelCase          =       DataCollatorCTCWithPadding(processor=lowerCAmelCase			,					padding=lowerCAmelCase			)

    # Initialize our Trainer
    UpperCAmelCase          =       CTCTrainer(
        model=lowerCAmelCase			,					data_collator=lowerCAmelCase			,					args=lowerCAmelCase			,					compute_metrics=lowerCAmelCase			,					train_dataset=train_dataset if training_args.do_train else None			,					eval_dataset=eval_dataset if training_args.do_eval else None			,					tokenizer=processor.feature_extractor			,					)

    # Training
    if training_args.do_train:
        if last_checkpoint is not None:
            UpperCAmelCase          =       last_checkpoint
        elif os.path.isdir(model_args.model_name_or_path			):
            UpperCAmelCase          =       model_args.model_name_or_path
        else:
            UpperCAmelCase          =       None

        # Save the feature_extractor and the tokenizer
        if is_main_process(training_args.local_rank			):
            processor.save_pretrained(training_args.output_dir			)

        UpperCAmelCase          =       trainer.train(resume_from_checkpoint=lowerCAmelCase			)
        trainer.save_model()

        UpperCAmelCase          =       train_result.metrics
        UpperCAmelCase          =       (
            data_args.max_train_samples if data_args.max_train_samples is not None else len(lowerCAmelCase			)
        )
        UpperCAmelCase          =       min(lowerCAmelCase			,					len(lowerCAmelCase			)			)

        trainer.log_metrics('train'			,					lowerCAmelCase			)
        trainer.save_metrics('train'			,					lowerCAmelCase			)
        trainer.save_state()

    # Evaluation
    UpperCAmelCase          =       {}
    if training_args.do_eval:
        logger.info('*** Evaluate ***'			)
        UpperCAmelCase          =       trainer.evaluate()
        UpperCAmelCase          =       data_args.max_val_samples if data_args.max_val_samples is not None else len(lowerCAmelCase			)
        UpperCAmelCase          =       min(lowerCAmelCase			,					len(lowerCAmelCase			)			)

        trainer.log_metrics('eval'			,					lowerCAmelCase			)
        trainer.save_metrics('eval'			,					lowerCAmelCase			)

    return results


if __name__ == "__main__":
   main()





"""simple docstring"""

import functools
import operator

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


SCREAMING_SNAKE_CASE_            =    logging.get_logger(__name__)

SCREAMING_SNAKE_CASE_            =    {
    '''asapp/sew-d-tiny-100k''': '''https://huggingface.co/asapp/sew-d-tiny-100k/resolve/main/config.json''',
    # See all SEW-D models at https://huggingface.co/models?filter=sew-d
}
class   _UpperCAmelCase				(		SCREAMING_SNAKE_CASE_				):
      __SCREAMING_SNAKE_CASE :				List[str]				   =						"sew-d"




      def __init__(				self ,							lowercase_=3_2 ,							lowercase_=7_6_8 ,							lowercase_=1_2 ,							lowercase_=1_2 ,							lowercase_=3_0_7_2 ,							lowercase_=2 ,							lowercase_=5_1_2 ,							lowercase_=2_5_6 ,							lowercase_=True ,							lowercase_=True ,							lowercase_=("p2c", "c2p") ,							lowercase_="layer_norm" ,							lowercase_="gelu_python" ,							lowercase_=0.1 ,							lowercase_=0.1 ,							lowercase_=0.1 ,							lowercase_=0.0 ,							lowercase_=0.1 ,							lowercase_=0.0_2 ,							lowercase_=1E-7 ,							lowercase_=1E-5 ,							lowercase_="group" ,							lowercase_="gelu" ,							lowercase_=(6_4, 1_2_8, 1_2_8, 1_2_8, 1_2_8, 2_5_6, 2_5_6, 2_5_6, 2_5_6, 5_1_2, 5_1_2, 5_1_2, 5_1_2) ,							lowercase_=(5, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1) ,							lowercase_=(1_0, 3, 1, 3, 1, 3, 1, 3, 1, 2, 1, 2, 1) ,							lowercase_=False ,							lowercase_=1_2_8 ,							lowercase_=1_6 ,							lowercase_=True ,							lowercase_=0.0_5 ,							lowercase_=1_0 ,							lowercase_=2 ,							lowercase_=0.0 ,							lowercase_=1_0 ,							lowercase_=0 ,							lowercase_="mean" ,							lowercase_=False ,							lowercase_=False ,							lowercase_=2_5_6 ,							lowercase_=0 ,							lowercase_=1 ,							lowercase_=2 ,							**lowercase_ ,							)    ->       Dict:
          super().__init__(**lowercase_ ,							pad_token_id=lowercase_ ,							bos_token_id=lowercase_ ,							eos_token_id=lowercase_				)
          UpperCAmelCase          =       hidden_size
          UpperCAmelCase          =       feat_extract_norm
          UpperCAmelCase          =       feat_extract_activation
          UpperCAmelCase          =       list(lowercase_				)
          UpperCAmelCase          =       list(lowercase_				)
          UpperCAmelCase          =       list(lowercase_				)
          UpperCAmelCase          =       conv_bias
          UpperCAmelCase          =       num_conv_pos_embeddings
          UpperCAmelCase          =       num_conv_pos_embedding_groups
          UpperCAmelCase          =       len(self.conv_dim				)
          UpperCAmelCase          =       num_hidden_layers
          UpperCAmelCase          =       intermediate_size
          UpperCAmelCase          =       squeeze_factor
          UpperCAmelCase          =       max_position_embeddings
          UpperCAmelCase          =       position_buckets
          UpperCAmelCase          =       share_att_key
          UpperCAmelCase          =       relative_attention
          UpperCAmelCase          =       norm_rel_ebd
          UpperCAmelCase          =       list(lowercase_				)
          UpperCAmelCase          =       hidden_act
          UpperCAmelCase          =       num_attention_heads
          UpperCAmelCase          =       hidden_dropout
          UpperCAmelCase          =       attention_dropout
          UpperCAmelCase          =       activation_dropout
          UpperCAmelCase          =       feat_proj_dropout
          UpperCAmelCase          =       final_dropout
          UpperCAmelCase          =       layer_norm_eps
          UpperCAmelCase          =       feature_layer_norm_eps
          UpperCAmelCase          =       initializer_range
          UpperCAmelCase          =       vocab_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)`,'
                  F"but is `len(config.conv_dim) = {len(self.conv_dim				)}`, `len(config.conv_stride)"
                  F"= {len(self.conv_stride				)}`, `len(config.conv_kernel) = {len(self.conv_kernel				)}`."				)

          # fine-tuning config parameters for SpecAugment: https://arxiv.org/abs/1904.08779
          UpperCAmelCase          =       apply_spec_augment
          UpperCAmelCase          =       mask_time_prob
          UpperCAmelCase          =       mask_time_length
          UpperCAmelCase          =       mask_time_min_masks
          UpperCAmelCase          =       mask_feature_prob
          UpperCAmelCase          =       mask_feature_length
          UpperCAmelCase          =       mask_feature_min_masks

          # ctc loss
          UpperCAmelCase          =       ctc_loss_reduction
          UpperCAmelCase          =       ctc_zero_infinity

          # sequence classification
          UpperCAmelCase          =       use_weighted_layer_sum
          UpperCAmelCase          =       classifier_proj_size




      @property
      def      a_   (				self				)    ->       Tuple:
          return functools.reduce(operator.mul ,							self.conv_stride ,							1				)



