
    6biP5                        S r SSKJs  Jr  SSKJr  SSKJr  SSK	J
r
  SSKJr  SSKJr  SSKJr  SS	KJr  S
rSr\" 5       r\" SS5             SS j5       r\" S5      SS j5       r\" S5      SS j5       r\R0                  R3                  S\R4                  \R6                  S9\l         \R.                  R                   \l         g)a  Xception V1 model for TF-Keras.

On ImageNet, this model gets to a top-1 validation accuracy of 0.790
and a top-5 validation accuracy of 0.945.

Reference:
  - [Xception: Deep Learning with Depthwise Separable Convolutions](
      https://arxiv.org/abs/1610.02357) (CVPR 2017)
    N)backend)imagenet_utils)training)VersionAwareLayers)
data_utils)layer_utils)keras_exportzthttps://storage.googleapis.com/tensorflow/keras-applications/xception/xception_weights_tf_dim_ordering_tf_kernels.h5zzhttps://storage.googleapis.com/tensorflow/keras-applications/xception/xception_weights_tf_dim_ordering_tf_kernels_notop.h5z$keras.applications.xception.Xceptionzkeras.applications.Xceptionc           	      p   US;   d9  [         R                  R                  R                  U5      (       d  [	        S5      eUS:X  a  U (       a  US:w  a  [	        S5      e[
        R                  " USS[        R                  " 5       U US9nUc  [        R                  US	9nO1[        R                  " U5      (       d  [        R                  X#S
9nOUn[        R                  " 5       S:X  a  SOSn[        R                  SSSSSS9" U5      n	[        R                  USS9" U	5      n	[        R                  SSS9" U	5      n	[        R                  SSSSS9" U	5      n	[        R                  USS9" U	5      n	[        R                  SSS9" U	5      n	[        R                  SSSS SS!9" U	5      n
[        R                  US"9" U
5      n
[        R                  SSS SS#S$9" U	5      n	[        R                  US%S9" U	5      n	[        R                  SS&S9" U	5      n	[        R                  SSS SS'S$9" U	5      n	[        R                  US(S9" U	5      n	[        R!                  SSS S)S*9" U	5      n	[        R#                  X/5      n	[        R                  S+SSS SS!9" U	5      n
[        R                  US"9" U
5      n
[        R                  SS,S9" U	5      n	[        R                  S+SS SS-S$9" U	5      n	[        R                  US.S9" U	5      n	[        R                  SS/S9" U	5      n	[        R                  S+SS SS0S$9" U	5      n	[        R                  US1S9" U	5      n	[        R!                  SSS S2S*9" U	5      n	[        R#                  X/5      n	[        R                  S3SSS SS!9" U	5      n
[        R                  US"9" U
5      n
[        R                  SS4S9" U	5      n	[        R                  S3SS SS5S$9" U	5      n	[        R                  US6S9" U	5      n	[        R                  SS7S9" U	5      n	[        R                  S3SS SS8S$9" U	5      n	[        R                  US9S9" U	5      n	[        R!                  SSS S:S*9" U	5      n	[        R#                  X/5      n	[%        S;5       GH8  nU	n
S<['        US=-   5      -   n[        R                  SUS>-   S9" U	5      n	[        R                  S3SS SUS?-   S$9" U	5      n	[        R                  XS@-   S9" U	5      n	[        R                  SUSA-   S9" U	5      n	[        R                  S3SS SUSB-   S$9" U	5      n	[        R                  XSC-   S9" U	5      n	[        R                  SUSD-   S9" U	5      n	[        R                  S3SS SUSE-   S$9" U	5      n	[        R                  XSF-   S9" U	5      n	[        R#                  X/5      n	GM;     [        R                  SGSSS SS!9" U	5      n
[        R                  US"9" U
5      n
[        R                  SSHS9" U	5      n	[        R                  S3SS SSIS$9" U	5      n	[        R                  USJS9" U	5      n	[        R                  SSKS9" U	5      n	[        R                  SGSS SSLS$9" U	5      n	[        R                  USMS9" U	5      n	[        R!                  SSS SNS*9" U	5      n	[        R#                  X/5      n	[        R                  SOSS SSPS$9" U	5      n	[        R                  USQS9" U	5      n	[        R                  SSRS9" U	5      n	[        R                  SSSS SSTS$9" U	5      n	[        R                  USUS9" U	5      n	[        R                  SSVS9" U	5      n	U (       aJ  [        R)                  SWS9" U	5      n	[
        R*                  " Xa5        [        R-                  XVSXSY9" U	5      n	OAUSZ:X  a  [        R)                  5       " U	5      n	O US[:X  a  [        R/                  5       " U	5      n	Ub  [0        R2                  " U5      nOUn[4        R6                  " XS\S9nUS:X  aQ  U (       a  [8        R:                  " S][<        S^S_S`9nO[8        R:                  " Sa[>        S^SbS`9nURA                  U5        U$ Ub  URA                  U5        U$ )ca	  Instantiates the Xception architecture.

Reference:
- [Xception: Deep Learning with Depthwise Separable Convolutions](
    https://arxiv.org/abs/1610.02357) (CVPR 2017)

For image classification use cases, see
[this page for detailed examples](
  https://keras.io/api/applications/#usage-examples-for-image-classification-models).

For transfer learning use cases, make sure to read the
[guide to transfer learning & fine-tuning](
  https://keras.io/guides/transfer_learning/).

The default input image size for this model is 299x299.

Note: each TF-Keras Application expects a specific kind of input
preprocessing. For Xception, call
`tf.keras.applications.xception.preprocess_input` on your inputs before
passing them to the model. `xception.preprocess_input` will scale input
pixels between -1 and 1.

Args:
  include_top: whether to include the fully-connected
    layer at the top of the network.
  weights: one of `None` (random initialization),
    'imagenet' (pre-training on ImageNet),
    or the path to the weights file to be loaded.
  input_tensor: optional TF-Keras tensor
    (i.e. output of `layers.Input()`)
    to use as image input for the model.
  input_shape: optional shape tuple, only to be specified
    if `include_top` is False (otherwise the input shape
    has to be `(299, 299, 3)`.
    It should have exactly 3 inputs channels,
    and width and height should be no smaller than 71.
    E.g. `(150, 150, 3)` would be one valid value.
  pooling: Optional pooling mode for feature extraction
    when `include_top` is `False`.
    - `None` means that the output of the model will be
        the 4D tensor output of the
        last convolutional block.
    - `avg` means that global average pooling
        will be applied to the output of the
        last convolutional block, and thus
        the output of the model will be a 2D tensor.
    - `max` means that global max pooling will
        be applied.
  classes: optional number of classes to classify images
    into, only to be specified if `include_top` is True,
    and if no `weights` argument is specified.
  classifier_activation: A `str` or callable. The activation function to use
    on the "top" layer. Ignored unless `include_top=True`. Set
    `classifier_activation=None` to return the logits of the "top" layer.
    When loading pretrained weights, `classifier_activation` can only
    be `None` or `"softmax"`.

Returns:
  A `keras.Model` instance.
>   NimagenetzThe `weights` argument should be either `None` (random initialization), `imagenet` (pre-training on ImageNet), or the path to the weights file to be loaded.r     zWIf using `weights` as `"imagenet"` with `include_top` as true, `classes` should be 1000i+  G   )default_sizemin_sizedata_formatrequire_flattenweights)shape)tensorr   channels_first       )   r   )   r   Fblock1_conv1)stridesuse_biasnameblock1_conv1_bn)axisr   relublock1_conv1_act)r   @   block1_conv2)r   r   block1_conv2_bnblock1_conv2_act   )r   r   same)r   paddingr   )r    block2_sepconv1)r)   r   r   block2_sepconv1_bnblock2_sepconv2_actblock2_sepconv2block2_sepconv2_bnblock2_pool)r   r)   r      block3_sepconv1_actblock3_sepconv1block3_sepconv1_bnblock3_sepconv2_actblock3_sepconv2block3_sepconv2_bnblock3_pooli  block4_sepconv1_actblock4_sepconv1block4_sepconv1_bnblock4_sepconv2_actblock4_sepconv2block4_sepconv2_bnblock4_pool   block   _sepconv1_act	_sepconv1_sepconv1_bn_sepconv2_act	_sepconv2_sepconv2_bn_sepconv3_act	_sepconv3_sepconv3_bni   block13_sepconv1_actblock13_sepconv1block13_sepconv1_bnblock13_sepconv2_actblock13_sepconv2block13_sepconv2_bnblock13_pooli   block14_sepconv1block14_sepconv1_bnblock14_sepconv1_acti   block14_sepconv2block14_sepconv2_bnblock14_sepconv2_actavg_poolpredictions)
activationr   avgmaxxceptionz.xception_weights_tf_dim_ordering_tf_kernels.h5models 0a58e3b7378bc2990ea3b43d5981f1f6)cache_subdir	file_hashz4xception_weights_tf_dim_ordering_tf_kernels_notop.h5 b0042744bf5b25fce3cb969f33bebb97)!tfiogfileexists
ValueErrorr   obtain_input_shaper   image_data_formatlayersInputis_keras_tensorConv2DBatchNormalization
ActivationSeparableConv2DMaxPooling2DaddrangestrGlobalAveragePooling2Dvalidate_activationDenseGlobalMaxPooling2Dr   get_source_inputsr   Modelr   get_fileTF_WEIGHTS_PATHTF_WEIGHTS_PATH_NO_TOPload_weights)include_topr   input_tensorinput_shapepoolingclassesclassifier_activation	img_inputchannel_axisxresidualiprefixinputsmodelweights_paths                   \/home/james-whalen/.local/lib/python3.13/site-packages/tf_keras/src/applications/xception.pyXceptionr   2   s5
   P ))RUU[[-?-?-H-H<
 	
 *D1
 	
 !33--/#K LL{L3	&&|44LLI$I1137GG1RL
FFU 	 		A 	!!|:K!LQOA&'9:1=Ab&5~FqIA!!|:K!LQOA&'9:1=A}}VVVe  	H ((l(;HEHVVe:K 	 			A 	!!|:N!O		A 	&'<=a@AVVe:K 	 			A 	!!|:N!O		A 	] 	 			A 	

A=!A}}VVVe  	H ((l(;HEH&'<=a@AVVe:K 	 			A 	!!|:N!O		A 	&'<=a@AVVe:K 	 			A 	!!|:N!O		A 	] 	 			A 	

A=!A}}VVVe  	H ((l(;HEH&'<=a@AVVe:K 	 			A 	!!|:N!O		A 	&'<=a@AVVe:K 	 			A 	!!|:N!O		A 	] 	 			A 	

A=!A1X3q1u:%f6O+CDQG""+% # 
  %%^$; & 

 f6O+CDQG""+% # 
  %%^$; & 

 f6O+CDQG""+% # 
  %%^$; & 

 JJ}%M P }}fffu  	H ((l(;HEH&'=>qAAVVe:L 	 			A 	!! 5 	" 			A 	&'=>qAAffu;M 	 			A 	!! 5 	" 			A 	^ 	 			A 	

A=!Affu;M 	 			A 	!! 5 	" 			A 	&'=>qAAffu;M 	 			A 	!! 5 	" 			A 	&'=>qAA))z):1=**+@JLLM  

 e--/2A))+A.A ..|<NN6:6E *%..@%<	L &..F&%<	L 	<( L 
	7#L    z,keras.applications.xception.preprocess_inputc                 ,    [         R                  " XSS9$ )Nrc   )r   mode)r   preprocess_input)r   r   s     r   r   r   l  s    **	 r   z.keras.applications.xception.decode_predictionsc                 *    [         R                  " XS9$ )N)top)r   decode_predictions)predsr   s     r   r   r   s  s    ,,U<<r    )r   reterror)Tr   NNNr   softmax)N)rA   )__doc__tensorflow.compat.v2compatv2rc   tf_keras.srcr   tf_keras.src.applicationsr   tf_keras.src.enginer   tf_keras.src.layersr   tf_keras.src.utilsr   r    tensorflow.python.util.tf_exportr	   r|   r}   rj   r   r   r   PREPROCESS_INPUT_DOCformatPREPROCESS_INPUT_RET_DOC_TFPREPROCESS_INPUT_ERROR_DOC r   r   <module>r      s    " !   4 ( 2 ) * :> 
D 
 
	 *,I #ttn	 <= > >?= @= *>>EE	22

3
3 F   
 ,>>FF  r   