



'''simple docstring'''




import os
import re
import warnings
from shutil import copyfile
from typing import TYPE_CHECKING, Any, Dict, List, Optional, Tuple

import sentencepiece as spm

from ...tokenization_utils import PreTrainedTokenizer


if TYPE_CHECKING:
						from ...tokenization_utils_base import TextInput
from ...utils import logging


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

lowerCamelCase							:Union[str, Any]				    =					{'''vocab_file''': '''spiece.model'''}

lowerCamelCase							:Optional[Any]				    =					{
    '''vocab_file''': {
        '''t5-small''': '''https://huggingface.co/t5-small/resolve/main/spiece.model''',
        '''t5-base''': '''https://huggingface.co/t5-base/resolve/main/spiece.model''',
        '''t5-large''': '''https://huggingface.co/t5-large/resolve/main/spiece.model''',
        '''t5-3b''': '''https://huggingface.co/t5-3b/resolve/main/spiece.model''',
        '''t5-11b''': '''https://huggingface.co/t5-11b/resolve/main/spiece.model''',
    }
}


# TODO(PVP) - this should be removed in Transformers v5
lowerCamelCase							:int				    =					{
    '''t5-small''': 5_1_2,
    '''t5-base''': 5_1_2,
    '''t5-large''': 5_1_2,
    '''t5-3b''': 5_1_2,
    '''t5-11b''': 5_1_2,
}

lowerCamelCase							:Dict				    =					'''▁'''







class 	_lowerCAmelCase							(			__UpperCAmelCase ):
	__SCREAMING_SNAKE_CASE   :		Optional[Any]					=					VOCAB_FILES_NAMES
	__SCREAMING_SNAKE_CASE   :		Optional[int]					=					PRETRAINED_VOCAB_FILES_MAP
	__SCREAMING_SNAKE_CASE   :		Optional[int]					=					PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES
	__SCREAMING_SNAKE_CASE   :		Any					=					['input_ids', 'attention_mask']


	def __init__(self       ,      lowercase       ,      lowercase="</s>"       ,      lowercase="<unk>"       ,      lowercase="<pad>"       ,      lowercase=100       ,      lowercase=None       ,      lowercase = None       ,      lowercase=True       ,      **lowercase       ,      ):
				# Add extra_ids to the special token list
				if extra_ids > 0 and additional_special_tokens is None:
							A_	:						Dict	=     [F'<extra_id_{i}>' for i in range(lowercase							)]
				elif extra_ids > 0 and additional_special_tokens is not None:
							# Check that we have the right number of extra_id special tokens
							A_	:						List[str]	=     len(set(filter(lambda lowercase							: bool("""extra_id""" in str(lowercase							)							)       ,      lowercase							)							)							)
							if extra_tokens != extra_ids:
										raise ValueError(
										    F'Both extra_ids ({extra_ids}) and additional_special_tokens ({additional_special_tokens}) are'
										    """ provided to T5Tokenizer. In this case the additional_special_tokens must include the extra_ids"""
										    """ tokens"""							)
				if legacy:
							logger.warning_once(
							    F'You are using the legacy behaviour of the {self.__class__}. This means that tokens that come after special tokens will not be properly handled. We recommend you to'
							    """ read the related pull request available at https://github.com/huggingface/transformers/pull/24565"""							)

				A_	:						Optional[Any]	=     legacy
				A_	:						List[Any]	=     {} if sp_model_kwargs is None else sp_model_kwargs

				super().__init__(
				    eos_token=lowercase       ,      unk_token=lowercase       ,      pad_token=lowercase       ,      extra_ids=lowercase       ,      additional_special_tokens=lowercase       ,      sp_model_kwargs=self.sp_model_kwargs       ,      legacy=lowercase       ,      **lowercase       ,      )

				A_	:						int	=     vocab_file
				A_	:						Optional[int]	=     extra_ids

				A_	:						Union[str, Any]	=     spm.SentencePieceProcessor(**self.sp_model_kwargs							)
				self.sp_model.Load(lowercase							)


	@staticmethod
	def     _a	(lowercase       ,      lowercase       ,      lowercase							):
				if pretrained_model_name_or_path in TaTokenizer.max_model_input_sizes:
							A_	:						Optional[int]	=     TaTokenizer.max_model_input_sizes[pretrained_model_name_or_path]
							if init_max_model_length is not None and init_max_model_length != max_model_length:
										return init_max_model_length
							elif init_max_model_length is None:
										warnings.warn(
										    """This tokenizer was incorrectly instantiated with a model max length of"""
										    F' {deprecated_max_model_length} which will be corrected in Transformers v5.\nFor now, this'
										    """ behavior is kept to avoid breaking backwards compatibility when padding/encoding with"""
										    """ `truncation is True`.\n- Be aware that you SHOULD NOT rely on"""
										    F' {pretrained_model_name_or_path} automatically truncating your input to'
										    F' {deprecated_max_model_length} when padding/encoding.\n- If you want to encode/pad to sequences'
										    F' longer than {deprecated_max_model_length} you can either instantiate this tokenizer with'
										    """ `model_max_length` or pass `max_length` when encoding/padding.\n- To avoid this warning, please"""
										    """ instantiate this tokenizer with `model_max_length` set to your preferred value."""       ,      lowercase       ,      )

				return max_model_length


	@property
	def     _a	(self							):
				return self.sp_model.get_piece_size() + self._extra_ids


	def     _a	(self							):
				A_	:						Optional[int]	=     {self.convert_ids_to_tokens(lowercase							): i for i in range(self.vocab_size							)}
				vocab.update(self.added_tokens_encoder							)
				return vocab


	def     _a	(self       ,      lowercase       ,      lowercase = None       ,      lowercase = False							):
				if already_has_special_tokens:
							return super().get_special_tokens_mask(
							    token_ids_a=lowercase       ,      token_ids_a=lowercase       ,      already_has_special_tokens=lowercase							)

				# normal case: some special tokens
				if token_ids_a is None:
							return ([0] * len(lowercase							)) + [1]
				return ([0] * len(lowercase							)) + [1] + ([0] * len(lowercase							)) + [1]


	def     _a	(self							):
				return list(
				    set(filter(lambda lowercase							: bool(re.search(R"""<extra_id_\d+>"""       ,      lowercase							)							) is not None       ,      self.additional_special_tokens							)							)							)


	def     _a	(self							):
				return [self._convert_token_to_id(lowercase							) for token in self.get_sentinel_tokens()]


	def     _a	(self       ,      lowercase							):
				if len(lowercase							) > 0 and token_ids[-1] == self.eos_token_id:
							warnings.warn(
							    F'This sequence already has {self.eos_token}. In future versions this behavior may lead to duplicated'
							    """ eos tokens being added."""							)
							return token_ids
				else:
							return token_ids + [self.eos_token_id]


	def     _a	(self       ,      lowercase       ,      lowercase = None							):
				A_	:						Any	=     [self.eos_token_id]

				if token_ids_a is None:
							return len(token_ids_a + eos							) * [0]
				return len(token_ids_a + eos + token_ids_a + eos							) * [0]


	def     _a	(self       ,      lowercase       ,      lowercase = None							):
				A_	:						Dict	=     self._add_eos_if_not_present(lowercase							)
				if token_ids_a is None:
							return token_ids_a
				else:
							A_	:						List[Any]	=     self._add_eos_if_not_present(lowercase							)
							return token_ids_a + token_ids_a


	def __getstate__(self							):
				A_	:						List[Any]	=     self.__dict__.copy()
				A_	:						List[str]	=     None
				return state


	def __setstate__(self       ,      lowercase							):
				A_	:						Any	=     d

				# for backward compatibility
				if not hasattr(self       ,      """sp_model_kwargs"""							):
							A_	:						List[str]	=     {}

				A_	:						str	=     spm.SentencePieceProcessor(**self.sp_model_kwargs							)
				self.sp_model.Load(self.vocab_file							)


	def     _a	(self       ,      lowercase       ,      **lowercase							):
				# Replace the SPIECE_UNDERLINE with a space to make sure SPIECE_UNDERLINE is only used at
				# the beginning of the text
				if not self.legacy:
							A_	:						int	=     SPIECE_UNDERLINE + text.replace(lowercase       ,      """ """							)
				return super().tokenize(lowercase       ,      **lowercase							)


	def     _a	(self       ,      lowercase       ,      **lowercase							):
				if not self.legacy:
							A_	:						List[str]	=     text.startswith(lowercase							)
							if is_first:
										A_	:						Optional[Any]	=     text[1:]

				A_	:						List[Any]	=     self.sp_model.encode(lowercase       ,      out_type=lowercase							)

				if not self.legacy and not is_first and not text.startswith(""" """							) and tokens[0].startswith(lowercase							):
							A_	:						List[str]	=     ([tokens[0][1:]] if len(tokens[0]							) > 1 else []) + tokens[1:]
				return tokens


	def     _a	(self       ,      lowercase							):
				if token.startswith("""<extra_id_"""							):
							A_	:						Union[str, Any]	=     re.match(R"""<extra_id_(\d+)>"""       ,      lowercase							)
							A_	:						Any	=     int(match.group(1							)							)
							return self.vocab_size - num - 1
				return self.sp_model.piece_to_id(lowercase							)


	def     _a	(self       ,      lowercase							):
				if index < self.sp_model.get_piece_size():
							A_	:						Dict	=     self.sp_model.IdToPiece(lowercase							)
				else:
							A_	:						Dict	=     F'<extra_id_{self.vocab_size - 1 - index}>'
				return token


	def     _a	(self       ,      lowercase							):
				A_	:						int	=     []
				A_	:						Optional[Any]	=     """"""
				A_	:						Optional[int]	=     False
				for token in tokens:
							# make sure that special tokens are not decoded using sentencepiece model
							if token in self.all_special_tokens:
										if not prev_is_special:
													out_string += " "
										out_string += self.sp_model.decode(lowercase							) + token
										A_	:						int	=     True
										A_	:						List[Any]	=     []
							else:
										current_sub_tokens.append(lowercase							)
										A_	:						Union[str, Any]	=     False
				out_string += self.sp_model.decode(lowercase							)
				return out_string.strip()


	def     _a	(self       ,      lowercase       ,      lowercase = None							):
				if not os.path.isdir(lowercase							):
							logger.error(F'Vocabulary path ({save_directory}) should be a directory'							)
							return
				A_	:						Union[str, Any]	=     os.path.join(
				    lowercase       ,      (filename_prefix + """-""" if filename_prefix else """""") + VOCAB_FILES_NAMES["""vocab_file"""]							)

				if os.path.abspath(self.vocab_file							) != os.path.abspath(lowercase							) and os.path.isfile(self.vocab_file							):
							copyfile(self.vocab_file       ,      lowercase							)
				elif not os.path.isfile(self.vocab_file							):
							with open(lowercase       ,      """wb"""							) as fi:
										A_	:						Tuple	=     self.sp_model.serialized_model_proto()
										fi.write(lowercase							)

				return (out_vocab_file,)




'''simple docstring'''




import pickle

import numpy as np
from matplotlib import pyplot as plt







class 	_lowerCAmelCase							:


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


	def     _a	(self       ,      lowercase							):
				# save model dict with pickle
				A_	:						Union[str, 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     _a	(cls       ,      lowercase							):
				# read saved model
				with open(lowercase       ,      """rb"""							) as f:
							A_	:						Optional[int]	=     pickle.load(lowercase							)  # noqa: S301

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


	def     _a	(self       ,      lowercase							):
				return 1 / (1 + np.exp(-1 * x							))


	def     _a	(self       ,      lowercase							):
				return round(lowercase       ,      3							)


	def     _a	(self       ,      lowercase       ,      lowercase       ,      lowercase       ,      lowercase       ,      lowercase							):
				# convolution process
				A_	:						Dict	=     convs[0]
				A_	:						Any	=     convs[1]
				A_	:						Tuple	=     np.shape(lowercase							)[0]
				# get the data slice of original image data, data_focus
				A_	:						List[str]	=     []
				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_	:						List[Any]	=     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_	:						int	=     []
				A_	:						List[str]	=     int((size_data - size_conv) / conv_step + 1							)
				for i_map in range(lowercase							):
							A_	:						List[Any]	=     []
							for i_focus in range(len(lowercase							)							):
										A_	:						List[str]	=     (
										    np.sum(np.multiply(data_focus[i_focus]       ,      w_convs[i_map]							)							)
										    - thre_convs[i_map]
										)
										featuremap.append(self.sig(lowercase							)							)
							A_	:						Tuple	=     np.asmatrix(lowercase							).reshape(
							    lowercase       ,      lowercase							)
							data_featuremap.append(lowercase							)

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


	def     _a	(self       ,      lowercase       ,      lowercase       ,      lowercase="average_pool"							):
				# pooling process
				A_	:						Union[str, Any]	=     len(featuremaps[0]							)
				A_	:						str	=     int(size_map / size_pooling							)
				A_	:						List[str]	=     []
				for i_map in range(len(lowercase							)							):
							A_	:						Any	=     featuremaps[i_map]
							A_	:						Any	=     []
							for i_focus in range(0       ,      lowercase       ,      lowercase							):
										for j_focus in range(0       ,      lowercase       ,      lowercase							):
													A_	:						Tuple	=     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     _a	(self       ,      lowercase							):
				# expanding three dimension data to one dimension list
				A_	:						List[Any]	=     []
				for i in range(len(lowercase							)							):
							A_	:						Tuple	=     np.shape(data[i]							)
							A_	:						str	=     data[i].reshape(1       ,      shapes[0] * shapes[1]							)
							A_	:						Tuple	=     data_listed.getA().tolist()[0]
							data_expanded.extend(lowercase							)
				A_	:						Optional[Any]	=     np.asarray(lowercase							)
				return data_expanded


	def     _a	(self       ,      lowercase							):
				# expanding matrix to one dimension list
				A_	:						str	=     np.asarray(lowercase							)
				A_	:						Any	=     np.shape(lowercase							)
				A_	:						int	=     data_mat.reshape(1       ,      shapes[0] * shapes[1]							)
				return data_expanded


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


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

										A_	:						int	=     np.dot(lowercase       ,      self.vji.T							) - self.thre_bpa
										A_	:						Any	=     self.sig(lowercase							)
										A_	:						Optional[int]	=     np.dot(lowercase       ,      self.wkj.T							) - self.thre_bpa
										A_	:						List[str]	=     self.sig(lowercase							)

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

										A_	:						int	=     pd_i_all / (self.size_poolinga * self.size_poolinga)
										A_	:						str	=     pd_conva_pooled.T.getA().tolist()
										A_	:						List[Any]	=     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_	:						int	=     self._expand_mat(pd_conva_all[k_conv]							)
													A_	:						Any	=     self.rate_weight * np.dot(lowercase       ,      lowercase							)

													A_	:						Union[str, Any]	=     self.w_conva[k_conv] + delta_w.reshape(
													    (self.conva[0], self.conva[0])							)

													A_	:						Tuple	=     (
													    self.thre_conva[k_conv]
													    - np.sum(pd_conva_all[k_conv]							) * self.rate_thre
													)
										# all connected layer
										A_	:						Optional[int]	=     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_	:						List[Any]	=     self.thre_bpa - pd_k_all * self.rate_thre
										A_	:						Optional[Any]	=     self.thre_bpa - pd_j_all * self.rate_thre
										# calculate the sum error of all single image
										A_	:						Optional[int]	=     np.sum(abs(data_teach - bp_outa							)							)
										error_count += errors
										# print('   ----Teach      ',data_teach)
										# print('   ----BP_output  ',bp_out3)
							A_	:						List[Any]	=     rp + 1
							A_	:						Union[str, Any]	=     error_count / patterns
							all_mse.append(lowercase							)

				def draw_error():
							A_	:						str	=     [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     _a	(self       ,      lowercase							):
				# model predict
				A_	:						Tuple	=     []
				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_	:						str	=     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_	:						Tuple	=     self._expand(lowercase							)

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


	def     _a	(self       ,      lowercase							):
				# return the data of image after convoluting process so we can check it out
				A_	:						Optional[Any]	=     np.asmatrix(lowercase							)
				A_,    A_	:						Optional[Any]	=     self.convolute(
				    lowercase       ,      self.conva       ,      self.w_conva       ,      self.thre_conva       ,      conv_step=self.step_conva       ,      )
				A_	:						Union[str, Any]	=     self.pooling(lowercase       ,      self.size_poolinga							)

				return data_conveda, data_pooleda


if __name__ == "__main__":
						pass