





"""simple docstring"""




import argparse
import collections

import numpy as np
import torch
from flax import traverse_util
from tax import checkpoints

from transformers import MTaConfig, UMTaEncoderModel, UMTaForConditionalGeneration
from transformers.utils import logging


logging.set_verbosity_info()



def A_     (		A__		,				A__		,				A__    )  ->		int:
       return params[F'{prefix}/{prefix}/relpos_bias/rel_embedding'][:, i, :]



def A_     (		A__		,				A__		,				A__		,				A__="attention"    )  ->		Union[str, Any]:
       a__						:     Any			=    np.ascontiguousarray(params[F'{prefix}/{prefix}/{layer_name}/key/kernel'][:, i, :, :]    )
       a__						:     Any			=    k_tmp.reshape(k_tmp.shape[0]		,				k_tmp.shape[1] * k_tmp.shape[2]    )
       a__						:     int			=    np.ascontiguousarray(params[F'{prefix}/{prefix}/{layer_name}/out/kernel'][:, i, :, :]    )
       a__						:     Optional[int]			=    o_tmp.reshape(o_tmp.shape[0] * o_tmp.shape[1]		,				o_tmp.shape[2]    )
       a__						:     Any			=    np.ascontiguousarray(params[F'{prefix}/{prefix}/{layer_name}/query/kernel'][:, i, :, :]    )
       a__						:     Tuple			=    q_tmp.reshape(q_tmp.shape[0]		,				q_tmp.shape[1] * q_tmp.shape[2]    )
       a__						:     Union[str, Any]			=    np.ascontiguousarray(params[F'{prefix}/{prefix}/{layer_name}/value/kernel'][:, i, :, :]    )
       a__						:     Tuple			=    v_tmp.reshape(v_tmp.shape[0]		,				v_tmp.shape[1] * v_tmp.shape[2]    )
       return k, o, q, v



def A_     (		A__		,				A__		,				A__		,				A__=False    )  ->		Optional[Any]:
       if split_mlp_wi:
              a__						:     Union[str, Any]			=    params[F'{prefix}/{prefix}/mlp/wi_0/kernel'][:, i, :]
              a__						:     Dict			=    params[F'{prefix}/{prefix}/mlp/wi_1/kernel'][:, i, :]
              a__						:     List[str]			=    (wi_a, wi_a)
       else:
              a__						:     str			=    params[F'{prefix}/{prefix}/mlp/wi/kernel'][:, i, :]

       a__						:     List[Any]			=    params[F'{prefix}/{prefix}/mlp/wo/kernel'][:, i, :]
       return wi, wo



def A_     (		A__		,				A__		,				A__		,				A__    )  ->		List[str]:
       return params[F'{prefix}/{prefix}/{layer_name}/scale'][:, i]



def A_     (		A__		,				*, A__		,				A__		,				A__ = False    )  ->		List[str]:
       a__						:     Dict			=    traverse_util.flatten_dict(variables['target']    )
       a__						:     str			=    {'/'.join(A__    ): v for k, v in old.items()}

       # v1.1 models have a gated GeLU with wi_0 and wi_1 instead of wi
       a__						:     List[Any]			=    'encoder/encoder/mlp/wi_0/kernel' in old
       print('Split MLP:'		,				A__    )

       a__						:     Any			=    collections.OrderedDict()

       # Shared embeddings.
       a__						:     Union[str, Any]			=    old['token_embedder/embedding']

       # Encoder.
       for i in range(A__    ):
              # Block i, layer 0 (Self Attention).
              a__						:     List[str]			=    tax_layer_norm_lookup(A__		,				A__		,				'encoder'		,				'pre_attention_layer_norm'    )
              a__						:     Tuple			=    tax_attention_lookup(A__		,				A__		,				'encoder'		,				'attention'    )
              a__						:     Optional[int]			=    layer_norm
              a__						:     List[Any]			=    k.T
              a__						:     Dict			=    o.T
              a__						:     Dict			=    q.T
              a__						:     List[str]			=    v.T

              # Block i, layer 1 (MLP).
              a__						:     Any			=    tax_layer_norm_lookup(A__		,				A__		,				'encoder'		,				'pre_mlp_layer_norm'    )
              a__						:     Any			=    tax_mlp_lookup(A__		,				A__		,				'encoder'		,				A__    )
              a__						:     Optional[Any]			=    layer_norm
              if split_mlp_wi:
                     a__						:     List[Any]			=    wi[0].T
                     a__						:     Union[str, Any]			=    wi[1].T
              else:
                     a__						:     Optional[int]			=    wi.T
              a__						:     Any			=    wo.T
              if scalable_attention:
                     # convert the rel_embedding of each layer
                     a__						:     Union[str, Any]			=    tax_relpos_bias_lookup(
                         A__		,				A__		,				'encoder'    ).T

       a__						:     str			=    old['encoder/encoder_norm/scale']

       if not scalable_attention:
              a__						:     List[str]			=    tax_relpos_bias_lookup(
                  A__		,				0		,				'encoder'    ).T
              a__						:     str			=    tax_relpos_bias_lookup(
                  A__		,				0		,				'decoder'    ).T

       if not is_encoder_only:
              # Decoder.
              for i in range(A__    ):
                     # Block i, layer 0 (Self Attention).
                     a__						:     Any			=    tax_layer_norm_lookup(A__		,				A__		,				'decoder'		,				'pre_self_attention_layer_norm'    )
                     a__						:     Tuple			=    tax_attention_lookup(A__		,				A__		,				'decoder'		,				'self_attention'    )
                     a__						:     Any			=    layer_norm
                     a__						:     Optional[int]			=    k.T
                     a__						:     List[Any]			=    o.T
                     a__						:     Any			=    q.T
                     a__						:     Optional[Any]			=    v.T

                     # Block i, layer 1 (Cross Attention).
                     a__						:     Any			=    tax_layer_norm_lookup(A__		,				A__		,				'decoder'		,				'pre_cross_attention_layer_norm'    )
                     a__						:     List[Any]			=    tax_attention_lookup(A__		,				A__		,				'decoder'		,				'encoder_decoder_attention'    )
                     a__						:     Any			=    layer_norm
                     a__						:     Tuple			=    k.T
                     a__						:     Union[str, Any]			=    o.T
                     a__						:     int			=    q.T
                     a__						:     str			=    v.T

                     # Block i, layer 2 (MLP).
                     a__						:     Union[str, Any]			=    tax_layer_norm_lookup(A__		,				A__		,				'decoder'		,				'pre_mlp_layer_norm'    )
                     a__						:     Optional[Any]			=    tax_mlp_lookup(A__		,				A__		,				'decoder'		,				A__    )
                     a__						:     Any			=    layer_norm
                     if split_mlp_wi:
                            a__						:     Any			=    wi[0].T
                            a__						:     Union[str, Any]			=    wi[1].T
                     else:
                            a__						:     str			=    wi.T
                     a__						:     Optional[int]			=    wo.T

                     if scalable_attention:
                            # convert the rel_embedding of each layer
                            a__						:     Tuple			=    tax_relpos_bias_lookup(A__		,				A__		,				'decoder'    ).T

              a__						:     Optional[int]			=    old['decoder/decoder_norm/scale']

              # LM Head (only in v1.1 checkpoints, in v1.0 embeddings are used instead)
              if "decoder/logits_dense/kernel" in old:
                     a__						:     Tuple			=    old['decoder/logits_dense/kernel'].T

       return new



def A_     (		A__		,				A__    )  ->		List[Any]:
       a__						:     List[Any]			=    collections.OrderedDict([(k, torch.from_numpy(v.copy()    )) for (k, v) in converted_params.items()]    )

       # Add what is missing.
       if "encoder.embed_tokens.weight" not in state_dict:
              a__						:     Optional[int]			=    state_dict['shared.weight']

       if not is_encoder_only:
              if "decoder.embed_tokens.weight" not in state_dict:
                     a__						:     int			=    state_dict['shared.weight']

              if "lm_head.weight" not in state_dict:  # For old 1.0 models.
                     print('Using shared word embeddings as lm_head.'    )
                     a__						:     List[str]			=    state_dict['shared.weight']

       return state_dict



def A_     (		A__		,				A__		,				A__		,				A__		,				A__    )  ->		Union[str, Any]:
       a__						:     Union[str, Any]			=    checkpoints.load_tax_checkpoint(A__    )
       a__						:     List[str]			=    convert_tax_to_pytorch(
           A__		,				num_layers=config.num_layers		,				is_encoder_only=A__		,				scalable_attention=A__    )
       a__						:     Tuple			=    make_state_dict(A__		,				A__    )
       model.load_state_dict(A__		,				strict=A__    )



def A_     (		A__		,				A__		,				A__		,				A__ = False		,				A__ = False		,				)  ->		int:
       a__						:     List[str]			=    MTaConfig.from_json_file(A__    )
       print(F'Building PyTorch model from configuration: {config}'    )
       # Non-v1.1 checkpoints could also use T5Model, but this works for all.
       # The v1.0 checkpoints will simply have an LM head that is the word embeddings.
       if is_encoder_only:
              a__						:     Optional[Any]			=    UMTaEncoderModel(A__    )
       else:
              a__						:     int			=    UMTaForConditionalGeneration(A__    )

       # Load weights from tf checkpoint
       load_tax_weights_in_ta(A__		,				A__		,				A__		,				A__		,				A__    )

       # Save pytorch-model
       print(F'Save PyTorch model to {pytorch_dump_path}'    )
       model.save_pretrained(A__    )

       # Verify that we can load the checkpoint.
       model.from_pretrained(A__    )
       print('Done'    )


if __name__ == "__main__":
    lowercase				:	str      						=  argparse.ArgumentParser(description="""Converts a native T5X checkpoint into a PyTorch checkpoint.""")
    # Required parameters
    parser.add_argument(
        """--t5x_checkpoint_path""", default=None, type=str, required=True, help="""Path to the T5X checkpoint."""
    )
    parser.add_argument(
        """--config_file""",
        default=None,
        type=str,
        required=True,
        help="""The config json file corresponding to the pre-trained T5 model.\nThis specifies the model architecture.""",
    )
    parser.add_argument(
        """--pytorch_dump_path""", default=None, type=str, required=True, help="""Path to the output PyTorch model."""
    )
    parser.add_argument(
        """--is_encoder_only""", action="""store_true""", help="""Check if the model is encoder-decoder model""", default=False
    )
    parser.add_argument(
        """--scalable_attention""",
        action="""store_true""",
        help="""Whether the model uses scaled attention (umt5 model)""",
        default=False,
    )
    lowercase				:	str      						=  parser.parse_args()
    convert_tax_checkpoint_to_pytorch(
        args.tax_checkpoint_path,
        args.config_file,
        args.pytorch_dump_path,
        args.is_encoder_only,
        args.scalable_attention,
    )









import pickle

import numpy as np
from matplotlib import pyplot as plt





class 			A__   :




   """simple docstring"""



   def __init__( self ,  lowercase ,  lowercase ,  lowercase ,  lowercase ,  lowercase ,  lowercase=0.2 ,  lowercase=0.2)      ->						Any:







          '''simple docstring'''

          a__						:     Tuple			=    bp_numa
          a__						:     Union[str, Any]			=    bp_numa
          a__						:     Optional[int]			=    bp_numa
          a__						:     Optional[int]			=    conva_get[:2]
          a__						:     Optional[Any]			=    conva_get[2]
          a__						:     Optional[int]			=    size_pa
          a__						:     Union[str, Any]			=    rate_w
          a__						:     Dict			=    rate_t
          a__						:     int			=    [
              np.mat(-1 * np.random.rand(self.conva[0] ,  self.conva[0]) + 0.5)
              for i in range(self.conva[1])
          ]
          a__						:     Optional[int]			=    np.mat(-1 * np.random.rand(self.num_bpa ,  self.num_bpa) + 0.5)
          a__						:     Optional[int]			=    np.mat(-1 * np.random.rand(self.num_bpa ,  self.num_bpa) + 0.5)
          a__						:     Any			=    -2 * np.random.rand(self.conva[1]) + 1
          a__						:     Optional[Any]			=    -2 * np.random.rand(self.num_bpa) + 1
          a__						:     Optional[int]			=    -2 * np.random.rand(self.num_bpa) + 1

   def 							__lowercase		( self ,  lowercase)      ->						List[Any]:







          '''simple docstring'''

          a__						:     Optional[Any]			=    {
              'num_bp1': self.num_bpa,
              'num_bp2': self.num_bpa,
              'num_bp3': self.num_bpa,
              'conv1': self.conva,
              'step_conv1': self.step_conva,
              'size_pooling1': self.size_poolinga,
              'rate_weight': self.rate_weight,
              'rate_thre': self.rate_thre,
              'w_conv1': self.w_conva,
              'wkj': self.wkj,
              'vji': self.vji,
              'thre_conv1': self.thre_conva,
              'thre_bp2': self.thre_bpa,
              'thre_bp3': self.thre_bpa,
          }
          with open(lowercase ,  'wb') as f:
                 pickle.dump(lowercase ,  lowercase)

          print(F'Model saved： {save_path}')

   @classmethod
   def 							__lowercase		( cls ,  lowercase)      ->						Any:







          '''simple docstring'''

          with open(lowercase ,  'rb') as f:
                 a__						:     Any			=    pickle.load(lowercase)  # noqa: S301

          a__						:     Dict			=    model_dic.get('conv1')
          conv_get.append(model_dic.get('step_conv1'))
          a__						:     Tuple			=    model_dic.get('size_pooling1')
          a__						:     Optional[int]			=    model_dic.get('num_bp1')
          a__						:     Tuple			=    model_dic.get('num_bp2')
          a__						:     Optional[Any]			=    model_dic.get('num_bp3')
          a__						:     Optional[Any]			=    model_dic.get('rate_weight')
          a__						:     int			=    model_dic.get('rate_thre')
          # create model instance
          a__						:     Union[str, Any]			=    CNN(lowercase ,  lowercase ,  lowercase ,  lowercase ,  lowercase ,  lowercase ,  lowercase)
          # modify model parameter
          a__						:     str			=    model_dic.get('w_conv1')
          a__						:     Optional[int]			=    model_dic.get('wkj')
          a__						:     Tuple			=    model_dic.get('vji')
          a__						:     str			=    model_dic.get('thre_conv1')
          a__						:     List[str]			=    model_dic.get('thre_bp2')
          a__						:     Tuple			=    model_dic.get('thre_bp3')
          return conv_ins

   def 							__lowercase		( self ,  lowercase)      ->						Any:







          '''simple docstring'''

          return 1 / (1 + np.exp(-1 * x))

   def 							__lowercase		( self ,  lowercase)      ->						Optional[int]:







          '''simple docstring'''

          return round(lowercase ,  3)

   def 							__lowercase		( self ,  lowercase ,  lowercase ,  lowercase ,  lowercase ,  lowercase)      ->						Any:







          '''simple docstring'''

          a__						:     Union[str, Any]			=    convs[0]
          a__						:     Tuple			=    convs[1]
          a__						:     Any			=    np.shape(lowercase)[0]
          # get the data slice of original image data, data_focus
          a__						:     Tuple			=    []
          for i_focus in range(0 ,  size_data - size_conv + 1 ,  lowercase):
                 for j_focus in range(0 ,  size_data - size_conv + 1 ,  lowercase):
                        a__						:     str			=    data[
                            i_focus : i_focus + size_conv, j_focus : j_focus + size_conv
                        ]
                        data_focus.append(lowercase)
        # calculate the feature map of every single kernel, and saved as list of matrix
          a__						:     str			=    []
          a__						:     Union[str, Any]			=    int((size_data - size_conv) / conv_step + 1)
          for i_map in range(lowercase):
                 a__						:     Tuple			=    []
                 for i_focus in range(len(lowercase)):
                        a__						:     Optional[Any]			=    (
                            np.sum(np.multiply(data_focus[i_focus] ,  w_convs[i_map]))
                            - thre_convs[i_map]
                        )
                        featuremap.append(self.sig(lowercase))
                 a__						:     Dict			=    np.asmatrix(lowercase).reshape(
                     lowercase ,  lowercase)
                 data_featuremap.append(lowercase)

          # expanding the data slice to One dimenssion
          a__						:     int			=    []
          for each_focus in data_focus:
                 focusa_list.extend(self.Expand_Mat(lowercase))
          a__						:     Optional[int]			=    np.asarray(lowercase)
          return focus_list, data_featuremap

   def 							__lowercase		( self ,  lowercase ,  lowercase ,  lowercase="average_pool")      ->						str:







          '''simple docstring'''

          a__						:     Any			=    len(featuremaps[0])
          a__						:     int			=    int(size_map / size_pooling)
          a__						:     Optional[Any]			=    []
          for i_map in range(len(lowercase)):
                 a__						:     Any			=    featuremaps[i_map]
                 a__						:     Optional[int]			=    []
                 for i_focus in range(0 ,  lowercase ,  lowercase):
                        for j_focus in range(0 ,  lowercase ,  lowercase):
                               a__						:     Any			=    feature_map[
                                   i_focus : i_focus + size_pooling,
                                   j_focus : j_focus + size_pooling,
                               ]
                               if pooling_type == "average_pool":
                                      # average pooling
                                      map_pooled.append(np.average(lowercase))
                               elif pooling_type == "max_pooling":
                                      # max pooling
                                      map_pooled.append(np.max(lowercase))
                 a__						:     List[str]			=    np.asmatrix(lowercase).reshape(lowercase ,  lowercase)
                 featuremap_pooled.append(lowercase)
          return featuremap_pooled

   def 							__lowercase		( self ,  lowercase)      ->						Optional[Any]:







          '''simple docstring'''

          a__						:     Any			=    []
          for i in range(len(lowercase)):
                 a__						:     Tuple			=    np.shape(data[i])
                 a__						:     List[str]			=    data[i].reshape(1 ,  shapes[0] * shapes[1])
                 a__						:     Optional[Any]			=    data_listed.getA().tolist()[0]
                 data_expanded.extend(lowercase)
          a__						:     Union[str, Any]			=    np.asarray(lowercase)
          return data_expanded

   def 							__lowercase		( self ,  lowercase)      ->						Dict:







          '''simple docstring'''

          a__						:     Dict			=    np.asarray(lowercase)
          a__						:     Optional[int]			=    np.shape(lowercase)
          a__						:     Any			=    data_mat.reshape(1 ,  shapes[0] * shapes[1])
          return data_expanded

   def 							__lowercase		( self ,  lowercase ,  lowercase ,  lowercase ,  lowercase ,  lowercase)      ->						str:







          '''simple docstring'''

          a__						:     int			=    []
          a__						:     Optional[int]			=    0
          for i_map in range(lowercase):
                 a__						:     Optional[Any]			=    np.ones((size_map, size_map))
                 for i in range(0 ,  lowercase ,  lowercase):
                        for j in range(0 ,  lowercase ,  lowercase):
                               a__						:     Union[str, Any]			=    pd_pool[
                                   i_pool
                               ]
                               a__						:     Tuple			=    i_pool + 1
                 a__						:     Optional[int]			=    np.multiply(
                     lowercase ,  np.multiply(out_map[i_map] ,  (1 - out_map[i_map])))
                 pd_all.append(lowercase)
          return pd_all

   def 							__lowercase		( self ,  lowercase ,  lowercase ,  lowercase ,  lowercase ,  lowercase ,  lowercase=bool)      ->						str:







          '''simple docstring'''

          print('----------------------Start Training-------------------------')
          print((' - - Shape: Train_Data  ', np.shape(lowercase)))
          print((' - - Shape: Teach_Data  ', np.shape(lowercase)))
          a__						:     Dict			=    0
          a__						:     List[Any]			=    []
          a__						:     Optional[int]			=    1_0000
          while rp < n_repeat and mse >= error_accuracy:
                 a__						:     Dict			=    0
                 print(F'-------------Learning Time {rp}--------------')
                 for p in range(len(lowercase)):
                        # print('------------Learning Image: %d--------------'%p)
                        a__						:     Dict			=    np.asmatrix(datas_train[p])
                        a__						:     Any			=    np.asarray(datas_teach[p])
                        a__			,							a__						:     Optional[int]			=    self.convolute(
                            lowercase ,  self.conva ,  self.w_conva ,  self.thre_conva ,  conv_step=self.step_conva ,  )
                        a__						:     Dict			=    self.pooling(lowercase ,  self.size_poolinga)
                        a__						:     Optional[Any]			=    np.shape(lowercase)
                        a__						:     Union[str, Any]			=    self._expand(lowercase)
                        a__						:     List[Any]			=    data_bp_input

                        a__						:     Tuple			=    np.dot(lowercase ,  self.vji.T) - self.thre_bpa
                        a__						:     Any			=    self.sig(lowercase)
                        a__						:     Any			=    np.dot(lowercase ,  self.wkj.T) - self.thre_bpa
                        a__						:     Any			=    self.sig(lowercase)

                        # --------------Model Leaning ------------------------
                        # calculate error and gradient---------------
                        a__						:     Any			=    np.multiply(
                            (data_teach - bp_outa) ,  np.multiply(lowercase ,  (1 - bp_outa)))
                        a__						:     Optional[Any]			=    np.multiply(
                            np.dot(lowercase ,  self.wkj) ,  np.multiply(lowercase ,  (1 - bp_outa)))
                        a__						:     Tuple			=    np.dot(lowercase ,  self.vji)

                        a__						:     Union[str, Any]			=    pd_i_all / (self.size_poolinga * self.size_poolinga)
                        a__						:     List[str]			=    pd_conva_pooled.T.getA().tolist()
                        a__						:     str			=    self._calculate_gradient_from_pool(
                            lowercase ,  lowercase ,  shape_featuremapa[0] ,  shape_featuremapa[1] ,  self.size_poolinga ,  )
                        # weight and threshold learning process---------
                        # convolution layer
                        for k_conv in range(self.conva[1]):
                               a__						:     Optional[int]			=    self._expand_mat(pd_conva_all[k_conv])
                               a__						:     int			=    self.rate_weight * np.dot(lowercase ,  lowercase)

                               a__						:     List[str]			=    self.w_conva[k_conv] + delta_w.reshape(
                                   (self.conva[0], self.conva[0]))

                               a__						:     str			=    (
                                   self.thre_conva[k_conv]
                                   - np.sum(pd_conva_all[k_conv]) * self.rate_thre
                               )
                        # all connected layer
                        a__						:     List[str]			=    self.wkj + pd_k_all.T * bp_outa * self.rate_weight
                        a__						:     List[str]			=    self.vji + pd_j_all.T * bp_outa * self.rate_weight
                        a__						:     Tuple			=    self.thre_bpa - pd_k_all * self.rate_thre
                        a__						:     Tuple			=    self.thre_bpa - pd_j_all * self.rate_thre
                        # calculate the sum error of all single image
                        a__						:     List[str]			=    np.sum(abs(data_teach - bp_outa))
                        error_count += errors
                        # print('   ----Teach      ',data_teach)
                        # print('   ----BP_output  ',bp_out3)
                 a__						:     Any			=    rp + 1
                 a__						:     Optional[Any]			=    error_count / patterns
                 all_mse.append(lowercase)

          def draw_error():
                 a__						:     int			=    [error_accuracy for i in range(int(n_repeat * 1.2))]
                 plt.plot(lowercase ,  '+-')
                 plt.plot(lowercase ,  'r--')
                 plt.xlabel('Learning Times')
                 plt.ylabel('All_mse')
                 plt.grid(lowercase ,  alpha=0.5)
                 plt.show()

          print('------------------Training Complished---------------------')
          print((' - - Training epoch: ', rp, F'     - - Mse: {mse:.6f}'))
          if draw_e:
                 draw_error()
          return mse

   def 							__lowercase		( self ,  lowercase)      ->						Optional[int]:







          '''simple docstring'''

          a__						:     str			=    []
          print('-------------------Start Testing-------------------------')
          print((' - - Shape: Test_Data  ', np.shape(lowercase)))
          for p in range(len(lowercase)):
                 a__						:     int			=    np.asmatrix(datas_test[p])
                 a__			,							a__						:     Optional[int]			=    self.convolute(
                     lowercase ,  self.conva ,  self.w_conva ,  self.thre_conva ,  conv_step=self.step_conva ,  )
                 a__						:     str			=    self.pooling(lowercase ,  self.size_poolinga)
                 a__						:     Optional[int]			=    self._expand(lowercase)

                 a__						:     str			=    data_bp_input
                 a__						:     Union[str, Any]			=    bp_outa * self.vji.T - self.thre_bpa
                 a__						:     Optional[Any]			=    self.sig(lowercase)
                 a__						:     int			=    bp_outa * self.wkj.T - self.thre_bpa
                 a__						:     Dict			=    self.sig(lowercase)
                 produce_out.extend(bp_outa.getA().tolist())
          a__						:     List[Any]			=    [list(map(self.do_round ,  lowercase)) for each in produce_out]
          return np.asarray(lowercase)

   def 							__lowercase		( self ,  lowercase)      ->						str:







          '''simple docstring'''

          a__						:     str			=    np.asmatrix(lowercase)
          a__			,							a__						:     str			=    self.convolute(
              lowercase ,  self.conva ,  self.w_conva ,  self.thre_conva ,  conv_step=self.step_conva ,  )
          a__						:     List[str]			=    self.pooling(lowercase ,  self.size_poolinga)

          return data_conveda, data_pooleda


if __name__ == "__main__":
    pass


