
    kh                        d Z ddlmZ ddlmZmZmZmZmZm	Z	m
Z
 ddlZddlmZ ddlmc mZ ddlmZmZmZmZ ddlmZmZmZmZmZmZ ddlmZmZ dd	l m!Z! dd
l"m#Z#m$Z$m%Z%m&Z&m'Z'm(Z(m)Z)m*Z* ddl+m,Z,m-Z-m.Z. ddl/m0Z0m1Z1 ddl2m3Z3m4Z4m5Z5 ddgZ6 G d dejn                        Z8 G d dejn                        Z9dde:de;de8fdZ<	 dde:de=de;de8fdZ>	 	 	 	 dde:de=de=dee?   de;de8fdZ@dde:de=de;de8fdZAdde:de=de;de8fdZB	 	 	 dde:de=dee?   de;de8f
dZCdd e:dee:ef   fd!ZD e3i d" eDd#      d$ eDd%d&d'(      d) eDd'd%eed*d+d,      d- eDd.d/d0d1d2d3d'4      d5 eDd6d'd1d2d.d/d0d78      d9 eDd'eed+d*d:d;d<      d= eDd>d'd%?      d@ eDdAd'd%?      dB eDdCd'd%?      dD eDdEd'd%?      dF eDdGd'eeH      dI eDdJd'eeH      dK eDdLd'eeH      dM eDdNd'eeH      dO eDdPd'eeH      dQ eDdRd'eeH      dS eDdTd'd+d*U      i dV eDdWd'd+d*U      dX eDdYd'dZd[d*d:\      d] eD       d^ eDd_d'd%?      d` eDdad'd%?      db eDdcd'd%?      dd eD       de eDeed+d*d%f      dg eDd'eed+d*d%h      di eDd'd+d*d%j      dk eDd'd+d*d%j      dl eDd'eed+d:d*d;dd%m	      dn eDd'd+d:d*d;dd%o      dp eDd'd*d+dd%q      dr eDd'dsdtd*d%u      dv eDd'dwdsdtdd%x      dy eDd'dwdsdtdd%x      i dz eDd'dwdsdtdd%x      d{ eDd'dsdtd*d|dd%o      d} eDd'd+d:d*d;dd%o      d~ eDd'd+d:d*d;dd%o      d eDd'd+d:d*d;dd%o      d eDd'dsdtd*d|dd%o      d eDd'd*d+dd%q      d eDd'dwd+d:d*d;dd%      d eDd'dsdtd*d|dd%o      d eDd'dsdtd*d|dd%o      d eDd+d:d*d%      d eDd'd*d+dd%q      d eDd'd|dd*ddd%o      d eDd'dsdtd*ddd%o      d eDd'dsdtd*ddd%o      d eDd'dwdsdtd*d|dd%      d eDd*d%      d eDd+d:d*d%      i      ZEe4dde;de8fd       ZFe4dde;de8fd       ZGe4dde;de8fd       ZHe4dde;de8fd       ZIe4dde;de8fd       ZJe4dde;de8fd       ZKe4dde;de8fd       ZLe4dde;de8fd       ZMe4dde;de8fd       ZNe4dde;de8fd       ZOe4dde;de8fd       ZPe4dde;de8fd       ZQe4dde;de8fd       ZRe4dde;de8fd       ZSe4dde;de8fd       ZTe4dde;de8fd       ZUe4dde;de8fd       ZVe4dde;de8fd       ZWe4dde;de8fd       ZXe4dde;de8fd       ZYe4dde;de8fd       ZZe4dde;de8fd       Z[e4dde;de8fd       Z\e4dde;de8fd       Z]e4dde;de8fd       Z^e4dde;de8fd       Z_e4dde;de8fd       Z`e4dde;de8fd       Zae4dde;de8fd       Zbe4dde;de8fd       Zce4dde;de8fd       Zde4dde;de8fd       Zee4dde;de8fd       Zf e5egd-d5d       y)z MobileNet V3

A PyTorch impl of MobileNet-V3, compatible with TF weights from official impl.

Paper: Searching for MobileNetV3 - https://arxiv.org/abs/1905.02244

Hacked together by / Copyright 2019, Ross Wightman
    )partial)AnyDictCallableListOptionalTupleUnionN)IMAGENET_DEFAULT_MEANIMAGENET_DEFAULT_STDIMAGENET_INCEPTION_MEANIMAGENET_INCEPTION_STD)SelectAdaptivePool2dLinear	LayerTypePadTypecreate_conv2dget_norm_act_layer   )build_model_with_cfgpretrained_cfg_for_features)SqueezeExcite)	BlockArgsEfficientNetBuilderdecode_arch_defefficientnet_init_weightsround_channelsresolve_bn_argsresolve_act_layerBN_EPS_TF_DEFAULT)FeatureInfoFeatureHooksfeature_take_indices)checkpoint_seq
checkpoint)generate_default_cfgsregister_modelregister_model_deprecationsMobileNetV3MobileNetV3Featuresc            '       t    e Zd ZdZddddddddd	d	d	d	ded
d
d	dfdededededededededede	e
   de	e
   de	e
   de	e
   dedededede	e   def& fdZd ej                  fd!Zej$                  j&                  d7d"ed eeef   fd#       Zej$                  j&                  d8d$ed d	fd%       Zej$                  j&                  d ej0                  fd&       Zd9deded d	fd'Z	 	 	 	 	 	 d:d(ej6                  d)e	eeee   f      d*ed+ed,ed-ed.ed eeej6                     eej6                  eej6                     f   f   fd/Z	 	 	 	 d;d)eeee   f   d0ed1ed.ed ee   f
d2Z d(ej6                  d ej6                  fd3Z!d7d(ej6                  d4ed ej6                  fd5Z"d(ej6                  d ej6                  fd6Z# xZ$S )<r)   a  MobileNetV3.

    Based on my EfficientNet implementation and building blocks, this model utilizes the MobileNet-v3 specific
    'efficient head', where global pooling is done before the head convolution without a final batch-norm
    layer before the classifier.

    Paper: `Searching for MobileNetV3` - https://arxiv.org/abs/1905.02244

    Other architectures utilizing MobileNet-V3 efficient head that are supported by this impl include:
      * HardCoRe-NAS - https://arxiv.org/abs/2102.11646 (defn in hardcorenas.py uses this class)
      * FBNet-V3 - https://arxiv.org/abs/2006.02049
      * LCNet - https://arxiv.org/abs/2109.15099
      * MobileNet-V4 - https://arxiv.org/abs/2404.10518
            F   T N        avg
block_argsnum_classesin_chans	stem_sizefix_stemnum_features	head_bias	head_normpad_type	act_layer
norm_layeraa_layerse_layerse_from_expround_chs_fn	drop_ratedrop_path_ratelayer_scale_init_valueglobal_poolc                    t         t        |           |
xs t        j                  }
|xs t        j
                  }t        ||
      }|xs t        }|| _        || _	        d| _
        |s ||      }t        ||dd|	      | _         ||d      | _        t        d|	|||
|||||
      }t        j                   |||       | _        |j"                  | _        | j$                  D cg c]  }|d	   	 c}| _        |j(                  | _        || _        t/        |
      | _        | j*                  | j0                  j3                         z  }|rOt        || j,                  d|	      | _         || j,                        | _        t        j8                         | _        nFt        || j,                  d|	|      | _        t        j8                         | _         |
d      | _        |rt        j<                  d      nt        j8                         | _        |dkD  rtA        | j,                  |      nt        j8                         | _!        tE        |        yc c}w )a0  Initialize MobileNetV3.

        Args:
            block_args: Arguments for blocks of the network.
            num_classes: Number of classes for classification head.
            in_chans: Number of input image channels.
            stem_size: Number of output channels of the initial stem convolution.
            fix_stem: If True, don't scale stem by round_chs_fn.
            num_features: Number of output channels of the conv head layer.
            head_bias: If True, add a learnable bias to the conv head layer.
            head_norm: If True, add normalization to the head layer.
            pad_type: Type of padding to use for convolution layers.
            act_layer: Type of activation layer.
            norm_layer: Type of normalization layer.
            aa_layer: Type of anti-aliasing layer.
            se_layer: Type of Squeeze-and-Excite layer.
            se_from_exp: If True, calculate SE channel reduction from expanded mid channels.
            round_chs_fn: Callable to round number of filters based on depth multiplier.
            drop_rate: Dropout rate.
            drop_path_rate: Stochastic depth rate.
            layer_scale_init_value: Enable layer scale on compatible blocks if not None.
            global_pool: Type of pooling to use for global pooling features of the FC head.
        Fr-      stridepaddingTinplace    )
output_strider;   rA   r@   r<   r=   r>   r?   rC   rD   stage	pool_typer   )rJ   )rJ   biasr   N)#superr)   __init__nnReLUBatchNorm2dr   r   r4   rB   grad_checkpointingr   	conv_stembn1r   
Sequentialblocksfeaturesfeature_info
stage_endsin_chsr8   head_hidden_sizer   rE   	feat_mult	conv_head	norm_headIdentityact2Flattenflattenr   
classifierr   )selfr3   r4   r5   r6   r7   r8   r9   r:   r;   r<   r=   r>   r?   r@   rA   rB   rC   rD   rE   norm_act_layerbuilderfnum_pooled_chs	__class__s                           S/var/www/teggl/fontify/venv/lib/python3.12/site-packages/timm/models/mobilenetv3.pyrT   zMobileNetV3.__init__-   s   Z 	k4)+(	12>>
+J	B,}&""' $Y/I&xAaQYZ!)T: &%#!)#9
 mmWY
%CD#,,/3/@/@A!1W:A#NN , 0+F**T-=-=-G-G-II*>4;P;PRS]efDN+D,A,ABDNDI +>4;P;PRS]eluvDN[[]DN!$/DI(3rzz!}HSVW&!6!6D]_]h]h]j!$') Bs   'Ireturnc                    | j                   | j                  g}|j                  | j                         |j                  | j                  | j
                  | j                  | j                  g       |j                  t        j                         t        j                  | j                        | j                  g       t        j                  | S )zqConvert model to sequential form.

        Returns:
            Sequential module containing all layers.
        )rY   rZ   extendr\   rE   rc   rd   rf   rU   rg   DropoutrB   ri   r[   )rj   layerss     rp   as_sequentialzMobileNetV3.as_sequential   s     ..$((+dkk"t''STrzz|RZZ%?QR}}f%%    coarsec                 .    t        d|rd      S d      S )z"Group parameters for optimization.z^conv_stem|bn1z^blocks\.(\d+)z^blocks\.(\d+)\.(\d+))stemr\   )dict)rj   rx   s     rp   group_matcherzMobileNetV3.group_matcher   s'     "(.$
 	
4L
 	
rw   enablec                     || _         yz)Enable or disable gradient checkpointing.NrX   rj   r}   s     rp   set_grad_checkpointingz"MobileNetV3.set_grad_checkpointing        #)rw   c                     | j                   S )zGet the classifier head.)ri   )rj   s    rp   get_classifierzMobileNetV3.get_classifier   s     rw   c                    || _         t        |      | _        |rt        j                  d      nt        j
                         | _        |dkD  rt        | j                  |      | _	        yt        j
                         | _	        y)zReset the classifier head.

        Args:
            num_classes: Number of classes for new classifier.
            global_pool: Global pooling type.
        rP   r   r   N)
r4   r   rE   rU   rg   re   rh   r   ra   ri   )rj   r4   rE   s      rp   reset_classifierzMobileNetV3.reset_classifier   s]     '/+F(3rzz!}HSVW&!6!6D]_]h]h]jrw   xindicesnorm
stop_early
output_fmtintermediates_onlyextra_blocksc                    |dv sJ d       |r	|sJ d       g }|r&t        t        | j                        dz   |      \  }	}
nMt        t        | j                        |      \  }	}
|	D cg c]  }| j                  |    }	}| j                  |
   }
d}| j	                  |      }| j                  |      }||	v r|j                  |       t        j                  j                         s|s| j                  }n| j                  d|
 }t        |d      D ]Z  \  }}| j                  r+t        j                  j                         st        ||      }n ||      }||	v sJ|j                  |       \ |r|S ||fS c c}w )aa   Forward features that returns intermediates.

        Args:
            x: Input image tensor
            indices: Take last n blocks if int, all if None, select matching indices if sequence
            norm: Apply norm layer to compatible intermediates
            stop_early: Stop iterating over blocks when last desired intermediate hit
            output_fmt: Shape of intermediate feature outputs
            intermediates_only: Only return intermediate features
            extra_blocks: Include outputs of all blocks and head conv in output, does not align with feature_info
        Returns:

        )NCHWzOutput shape must be NCHW.z/Must use intermediates_only for early stopping.r   r   N)start)r#   lenr\   r_   rY   rZ   appendtorchjitis_scripting	enumeraterX   r$   )rj   r   r   r   r   r   r   r   intermediatestake_indices	max_indexifeat_idxr\   blks                  rp   forward_intermediatesz!MobileNetV3.forward_intermediates   ss   . Y&D(DD&%X'XX%&:3t{{;Ka;OQX&Y#L)&:3t;OQX&Y#L)8DE1DOOA.ELE	2I NN1HHQK|#  #99!!#:[[F[[),F&vQ7 	(MHc&&uyy/E/E/G"3*F<'$$Q'	(   -3 Fs   'E5
prune_norm
prune_headc                     |r&t        t        | j                        dz   |      \  }}n1t        t        | j                        |      \  }}| j                  |   }| j                  d| | _        |t        | j                        k  r2t	        j
                         | _        t	        j
                         | _        |rDt	        j
                         | _        t	        j
                         | _        | j                  dd       |S )a~  Prune layers not required for specified intermediates.

        Args:
            indices: Indices of intermediate layers to keep.
            prune_norm: Whether to prune normalization layer.
            prune_head: Whether to prune the classifier head.
            extra_blocks: Include outputs of all blocks.

        Returns:
            List of indices that were kept.
        r   Nr   r0   )	r#   r   r\   r_   rU   re   rc   rd   r   )rj   r   r   r   r   r   r   s          rp   prune_intermediate_layersz%MobileNetV3.prune_intermediate_layers   s    $ &:3t{{;Ka;OQX&Y#L)&:3t;OQX&Y#L)	2Ikk*9-s4;;''[[]DN[[]DN[[]DN[[]DN!!!R(rw   c                     | j                  |      }| j                  |      }| j                  r8t        j                  j                         st        | j                  |d      }|S | j                  |      }|S )zForward pass through feature extraction layers.

        Args:
            x: Input tensor.

        Returns:
            Feature tensor.
        T)rh   )rY   rZ   rX   r   r   r   r$   r\   rj   r   s     rp   forward_featureszMobileNetV3.forward_features  sd     NN1HHQK""599+A+A+Ct{{At<A  AArw   
pre_logitsc                 L   | j                  |      }| j                  |      }| j                  |      }| j                  |      }| j	                  |      }| j
                  dkD  r,t        j                  || j
                  | j                        }|r|S | j                  |      S )zForward pass through classifier head.

        Args:
            x: Input features.
            pre_logits: Return features before final linear layer.

        Returns:
            Classification logits or features.
        r1   )ptraining)
rE   rc   rd   rf   rh   rB   Fdropoutr   ri   )rj   r   r   s      rp   forward_headzMobileNetV3.forward_head%  s     QNN1NN1IIaLLLO>>B		!t~~FAHq!!rw   c                 J    | j                  |      }| j                  |      }|S )zoForward pass.

        Args:
            x: Input tensor.

        Returns:
            Output logits.
        )r   r   r   s     rp   forwardzMobileNetV3.forward:  s)     !!!$a rw   FT)r2   )NFFr   FF)r   FTF)%__name__
__module____qualname____doc__r   r   intboolstrr   r   r   floatrT   rU   r[   rv   r   r   ignorer   r   r|   r   Moduler   r   Tensorr
   r   r	   r   r   r   r   r   __classcell__ro   s   @rp   r)   r)      s:   $  $" $"#-1.2,0,0 $%3!$&6:$)_(!_( _( 	_(
 _( _( _( _( _( _(  	*_( !+_( y)_( y)_( _(  #!_(" #_($ "%_(& %-UO'_(( )_(B
&r}} 
& YY
D 
T#s(^ 
 
 YY)T )T ) ) YY		  kC kc kd k  8<$$',!&8 ||8  eCcN348  	8 
 8  8  !%8  8  
tELL!5tELL7I)I#JJ	K8 x ./$#!&3S	>*  	
  
cB%,, 5<< ""ell " " "* %,, rw   c            $       4    e Zd ZdZddddddded	d
d
d
d
ddd
fdedeedf   dededede	dede
dede	dee   dee   dee   dee   dededee   f" fdZej"                  j$                  d$de	d d
fd!       Zd"ej(                  d eej(                     fd#Z xZS )%r*   zMobileNetV3 Feature Extractor.

    A work-in-progress feature extraction module for MobileNet-V3 to use as a backbone for segmentation
    and object detection models.
    )r   r   rG   r-      
bottleneckr-   r.   FrM   r0   TNr1   r3   out_indices.feature_locationr5   r6   r7   rN   r;   rA   r@   r<   r=   r>   r?   rB   rC   rD   c                    t         t        |           |xs t        j                  }|xs t        j
                  }|xs t        }|| _        d| _        |s |	|      }t        ||dd|      | _
         ||      | _         |d      | _        t        |||	|
|||||||      }t        j                   |||       | _        t!        |j"                  |      | _        | j$                  j'                         D ci c]  }|d   |d	    c}| _        t+        |        d
| _        |dk7  r<| j$                  j'                  d      }t/        || j1                               | _        y
y
c c}w )a  Initialize MobileNetV3Features.

        Args:
            block_args: Arguments for blocks of the network.
            out_indices: Output from stages at indices.
            feature_location: Location of feature before/after each block, must be in ['bottleneck', 'expansion'].
            in_chans: Number of input image channels.
            stem_size: Number of output channels of the initial stem convolution.
            fix_stem: If True, don't scale stem by round_chs_fn.
            output_stride: Output stride of the network.
            pad_type: Type of padding to use for convolution layers.
            round_chs_fn: Callable to round number of filters based on depth multiplier.
            se_from_exp: If True, calculate SE channel reduction from expanded mid channels.
            act_layer: Type of activation layer.
            norm_layer: Type of normalization layer.
            aa_layer: Type of anti-aliasing layer.
            se_layer: Type of Squeeze-and-Excite layer.
            drop_rate: Dropout rate.
            drop_path_rate: Stochastic depth rate.
            layer_scale_init_value: Enable layer scale on compatible blocks if not None.
        Fr-   rG   rH   TrK   )rN   r;   rA   r@   r<   r=   r>   r?   rC   rD   r   rO   indexNr   )module	hook_type)keys)rS   r*   rT   rU   rV   rW   r   rB   rX   r   rY   rZ   act1r   r[   r\   r!   r]   r^   	get_dicts_stage_out_idxr   feature_hooksr"   named_modules)rj   r3   r   r   r5   r6   r7   rN   r;   rA   r@   r<   r=   r>   r?   rB   rC   rD   rl   rm   hooksro   s                        rp   rT   zMobileNetV3Features.__init__O  sf   R 	!413(	12>>
,}""' $Y/I&xAaQYZi(d+	 &'%#!)#9-
 mmWY
%CD'(8(8+F?C?P?P?Z?Z?\]!qz1W:5]!$' "|+%%//5L/ME!-eT5G5G5I!JD , ^s   9E%r}   rq   c                     || _         yr   r   r   s     rp   r   z*MobileNetV3Features.set_grad_checkpointing  r   rw   r   c                 b   | j                  |      }| j                  |      }| j                  |      }| j                  g }d| j                  v r|j                  |       t        | j                        D ]g  \  }}| j                  r+t        j                  j                         st        ||      }n ||      }|dz   | j                  v sW|j                  |       i |S | j                  |       | j                  j                  |j                        }t        |j!                               S )zForward pass through feature extraction.

        Args:
            x: Input tensor.

        Returns:
            List of feature tensors.
        r   r   )rY   rZ   r   r   r   r   r   r\   rX   r   r   r   r%   
get_outputdevicelistvalues)rj   r   r]   r   bouts         rp   r   zMobileNetV3Features.forward  s     NN1HHQKIIaL%HD'''"!$++. '1**5993I3I3K"1a(A!Aq5D///OOA&' OKKN$$//9C

%%rw   r   )r   r   r   r   r   r   r	   r   r   r   r   r   r   r   r   rT   r   r   r   r   r   r   r   r   r   s   @rp   r*   r*   H  sx    ,;$0"!# "%3 $-1.2,0,0!$&6:%OK!OK sCxOK "	OK
 OK OK OK OK OK #OK OK  	*OK !+OK y)OK y)OK  !OK" "#OK$ %-UO%OKb YY)T )T ) )& &$u||*< &rw   variant
pretrainedrq   c                     d}t         }d}|j                  dd      rd|v sd|v rd}n
d}t        }d	}t        || |f|dk(  |d	k7  |d
|}|d	k(  rt	        |j
                        |_        |S )zCreate a MobileNetV3 model.

    Args:
        variant: Model variant name.
        pretrained: Load pretrained weights.
        **kwargs: Additional model arguments.

    Returns:
        MobileNetV3 model instance.
    r0   Nfeatures_onlyFfeature_cfgfeature_clscfg)r4   r8   	head_convr9   r:   rE   cls)r   pretrained_strictkwargs_filter)r)   popr*   r   r   default_cfg)r   r   kwargsfeatures_mode	model_clsr   models          rp   _create_mnv3r     s     MIMzz/5)F"mv&=!MqM+I!M  $u,'50# E 78I8IJLrw         ?channel_multiplierc                    dgddgdgg ddgdgdgg}t        dt        |      d	t        t        |
      t        t        j
                  fi t        |      t        |d      t        t        d      d|}t        | |fi |}|S )ad  Creates a MobileNet-V3 model.

    Ref impl: ?
    Paper: https://arxiv.org/abs/1905.02244

    Args:
        variant: Model variant name.
        channel_multiplier: Multiplier to number of channels per layer.
        pretrained: Load pretrained weights.
        **kwargs: Additional model arguments.

    Returns:
        MobileNetV3 model instance.
    ds_r1_k3_s1_e1_c16_nre_noskipir_r1_k3_s2_e4_c24_nreir_r1_k3_s1_e3_c24_nreir_r3_k5_s2_e3_c40_se0.25_nreir_r1_k3_s2_e6_c80zir_r1_k3_s1_e2.5_c80zir_r2_k3_s1_e2.3_c80ir_r2_k3_s1_e6_c112_se0.25ir_r3_k5_s2_e6_c160_se0.25cn_r1_k1_s1_c960F
multiplier
hard_swishhard_sigmoid)
gate_layer)r3   r9   rA   r=   r<   r?    )
r{   r   r   r   rU   rW   r   r   r   r   r   r   r   r   arch_defmodel_kwargsr   s          rp   _gen_mobilenet_v3_rwr     s    & 
))	!#;<	()N	%&	%&	H   "8,^8JK2>>E_V-DE#FL9>B L *==ELrw   depth_multiplier
group_sizec                    d| v r@d}d| v rt        |d      }dgddgdd	gd
gdgdgg}n`t        |d      }dgddgddgdgdgdgg}nCd}d| v rt        |d      }dgddgdgg ddgdgdgg}nt        |d      }dgdd gd!gg dd"gd#gdgg}t        t        d$t        j                  t
        %      }	t        d+t        |||&      |d'|d(k  t        t
        |)      t        t        j                  fi t        |      ||	d*|}
t        | |fi |
}|S ),a  Creates a MobileNet-V3 model.

    Ref impl: ?
    Paper: https://arxiv.org/abs/1905.02244

    Args:
        variant: Model variant name.
        channel_multiplier: Multiplier to number of channels per layer.
        depth_multiplier: Depth multiplier for model scaling.
        group_size: Group size for grouped convolutions.
        pretrained: Load pretrained weights.
        **kwargs: Additional model arguments.

    Returns:
        MobileNetV3 model instance.
    smalli   minimalreluds_r1_k3_s2_e1_c16zir_r1_k3_s2_e4.5_c24zir_r1_k3_s1_e3.67_c24ir_r1_k3_s2_e4_c40ir_r2_k3_s1_e6_c40ir_r2_k3_s1_e3_c48ir_r3_k3_s2_e6_c96cn_r1_k1_s1_c576r   zds_r1_k3_s2_e1_c16_se0.25_nrezir_r1_k3_s2_e4.5_c24_nrezir_r1_k3_s1_e3.67_c24_nreir_r1_k5_s2_e4_c40_se0.25zir_r2_k5_s1_e6_c40_se0.25zir_r2_k5_s1_e3_c48_se0.25zir_r3_k5_s2_e6_c96_se0.25r/   ds_r1_k3_s1_e1_c16ir_r1_k3_s2_e4_c24ir_r1_k3_s1_e3_c24ir_r3_k3_s2_e3_c40r   ir_r2_k3_s1_e6_c112ir_r3_k3_s2_e6_c160r   ds_r1_k3_s1_e1_c16_nrer   r   r   r   r   r   )r   force_act_layerrd_round_fn)r   r   r.         ?r   )r3   r8   r6   r7   rA   r=   r<   r?   r   )r   r   r   rU   rV   r   r{   r   rW   r   r   )r   r   r   r   r   r   r8   r<   r   r?   r   r   s               rp   _gen_mobilenet_v3r    s   0 ')&&9I &&')@A%';<%&%&#$H *&,?I 11+-HI,.IJ,-,-#$H )&&9I &&%';<%&V&'&'#$H" *&,?I **)+CD01V-.-.#$H  }QSQXQXftuH 
"8>N[ef!#d*^8JK2>>E_V-DE
 
L *==ELrw   c                    | j                  d      d   }|dv rd}dgddgdd	gd
dgddgg ddgg}n@|dk(  rd}dgddgddgddgddgg ddgg}n#|dk(  rd}dgddgd d!gd"d#gd$d%gg d&d'gg}nt        t        t        |d()      }t        t        d*|+      }t        |d,      }	t        d0t        |      d-d.||d.t        t        j                  fi t        |      |	|d/	|}
t        | |fi |
}|S )1a  FBNetV3 model generator.

    Paper: `FBNetV3: Joint Architecture-Recipe Search using Predictor Pretraining`
        - https://arxiv.org/abs/2006.02049
    FIXME untested, this is a preliminary impl of some FBNet-V3 variants.

    Args:
        variant: Model variant name.
        channel_multiplier: Channel width multiplier.
        pretrained: Load pretrained weights.
        **kwargs: Additional model arguments.

    Returns:
        MobileNetV3 model instance.
    _)ar   r.   ds_r2_k3_s1_e1_c16ir_r1_k5_s2_e4_c24ir_r3_k5_s1_e2_c24zir_r1_k5_s2_e5_c40_se0.25zir_r4_k5_s1_e3_c40_se0.25ir_r1_k5_s2_e5_c72ir_r4_k3_s1_e3_c72zir_r1_k3_s1_e5_c120_se0.25zir_r5_k5_s1_e3_c120_se0.25)zir_r1_k3_s2_e6_c184_se0.25zir_r5_k5_s1_e4_c184_se0.25zir_r1_k5_s1_e6_c224_se0.25cn_r1_k1_s1_c1344d   ir_r1_k3_s2_e5_c24ir_r5_k3_s1_e2_c24r
  zir_r4_k3_s1_e3_c40_se0.25ir_r1_k3_s2_e5_c72zir_r1_k3_s1_e5_c128_se0.25zir_r6_k5_s1_e3_c128_se0.25)zir_r1_k3_s2_e6_c208_se0.25zir_r5_k5_s1_e5_c208_se0.25zir_r1_k5_s1_e6_c240_se0.25cn_r1_k1_s1_c1440grM   ds_r3_k3_s1_e1_c24ir_r1_k5_s2_e4_c40ir_r4_k5_s1_e2_c40zir_r1_k5_s2_e4_c56_se0.25zir_r4_k5_s1_e3_c56_se0.25ir_r1_k5_s2_e5_c104ir_r4_k3_s1_e3_c104zir_r1_k3_s1_e5_c160_se0.25zir_r8_k5_s1_e3_c160_se0.25)zir_r1_k3_s2_e6_c264_se0.25zir_r6_k5_s1_e5_c264_se0.25zir_r2_k5_s1_e6_c288_se0.25cn_r1_k1_s1_c1728ffffff?)r   round_limitr   )r   r  r   i  F)	r3   r8   r9   r6   rA   r@   r=   r<   r?   r   )splitNotImplementedr   r   r   r   r{   r   rU   rW   r   r   )r   r   r   r   vlr6   r   rA   r?   r<   r   r   s               rp   _gen_fbnetv3r2    s     
s	B	B	Z	!"!#78(*EF!#78)+GHf !
 
s	!"!#78(*EF!#78)+GHf !
 
s	!"!#78(*EF"$9:)+GHf !
 >6HVZ[L}\ZH!&,7I "8,!2>>E_V-DE L *==ELrw   c                 &   dgdgdgddgdgdgg}t        dt        |      dt        t        |	      t        t        j
                  fi t        |      t        |d
      t        t        dt        j                        dd|}t        | |fi |}|S )a  LCNet model generator.

    Essentially a MobileNet-V3 crossed with a MobileNet-V1

    Paper: `PP-LCNet: A Lightweight CPU Convolutional Neural Network` - https://arxiv.org/abs/2109.15099

    Args:
        variant: Model variant name.
        channel_multiplier: Multiplier to number of channels per layer.
        pretrained: Load pretrained weights.
        **kwargs: Additional model arguments.

    Returns:
        MobileNetV3 model instance.
    dsa_r1_k3_s1_c32dsa_r2_k3_s2_c64dsa_r2_k3_s2_c128dsa_r1_k3_s2_c256dsa_r1_k5_s1_c256dsa_r4_k5_s1_c256zdsa_r2_k5_s2_c512_se0.25r.   r   r   r   )r   r  r/   )r3   r6   rA   r=   r<   r?   r8   r   )r{   r   r   r   rU   rW   r   r   r   rV   r   r   s          rp   
_gen_lcnetr:    s    $ 
			12		#$H  	"8,^8JK2>>E_V-DE#FL9>SUSZSZ[	 	L *==ELrw   c                 ^   d}d| v rQd}d| v rd}t        |d      }dgdd	gg d
g ddgg}	nd| v rd}t        |d      }dgddgg dg ddgg}	nJ d|  d       d}d| v rd}t        |d      }ddgddgg dg ddgg}	nOd| v rd}t        |d      }dgdd	gg dg d dgg}	n-d| v rd}t        |d      }dgddgg d!g d"dgg}	nJ d|  d       t        d(t        |	|#      dd$|||d%k  t        t        |&      t        t
        j                  fi t        |      ||d'
|}
t        | |fi |
}|S ))a  Creates a MobileNet-V4 model.

    Paper: https://arxiv.org/abs/2404.10518

    Args:
        variant: Model variant name.
        channel_multiplier: Multiplier to number of channels per layer.
        group_size: Group size for grouped convolutions.
        pretrained: Load pretrained weights.
        **kwargs: Additional model arguments.

    Returns:
        MobileNetV3 model instance.
    r/   hybridgh㈵>mediumrM   r  er_r1_k3_s2_e4_c48uir_r1_a3_k5_s2_e4_c80uir_r1_a3_k3_s1_e2_c80)uir_r1_a3_k5_s2_e6_c160uir_r1_a0_k0_s1_e2_c160uir_r1_a3_k3_s1_e4_c160uir_r1_a3_k5_s1_e4_c160mqa_r1_k3_h4_s1_v2_d64_c160rC  rE  uir_r1_a3_k0_s1_e4_c160rE  rC  rE  rF  )uir_r1_a5_k5_s2_e6_c256uir_r1_a5_k5_s1_e4_c256uir_r2_a3_k5_s1_e4_c256uir_r1_a0_k0_s1_e2_c256uir_r1_a3_k5_s1_e2_c256rJ  uir_r1_a0_k0_s1_e4_c256mqa_r1_k3_h4_s1_d64_c256uir_r1_a3_k0_s1_e4_c256rM  rH  rM  uir_r1_a5_k0_s1_e4_c256rM  rO  r   larger!  geluuir_r1_a3_k5_s2_e4_c96uir_r1_a3_k3_s1_e4_c96)uir_r1_a3_k5_s2_e4_c192uir_r3_a3_k3_s1_e4_c192uir_r1_a3_k5_s1_e4_c192uir_r2_a5_k3_s1_e4_c192mqa_r1_k3_h8_s1_v2_d48_c192uir_r1_a5_k3_s1_e4_c192rX  rY  rX  rY  rX  uir_r1_a3_k0_s1_e4_c192)uir_r4_a5_k5_s2_e4_c512uir_r1_a5_k0_s1_e4_c512uir_r1_a5_k3_s1_e4_c512uir_r2_a5_k0_s1_e4_c512r]  uir_r1_a5_k5_s1_e4_c512mqa_r1_k3_h8_s1_d64_c512r\  r`  r\  r`  r\  r`  r\  FzUnknown variant .Nr  cn_r1_k3_s2_e1_c32cn_r1_k1_s1_e1_c32cn_r1_k3_s2_e1_c96cn_r1_k1_s1_e1_c64)uir_r1_a5_k5_s2_e3_c96uir_r4_a0_k3_s1_e2_c96uir_r1_a3_k0_s1_e4_c96)uir_r1_a3_k3_s2_e6_c128uir_r1_a5_k5_s1_e4_c128uir_r1_a0_k5_s1_e4_c128uir_r1_a0_k5_s1_e3_c128uir_r2_a0_k3_s1_e4_c128)rA  uir_r2_a3_k3_s1_e4_c160rD  rC  rF  rB  rF  )	rG  rH  rI  rL  rN  rK  rH  uir_r2_a0_k0_s1_e4_c256uir_r1_a5_k0_s1_e2_c256)rT  rU  rV  uir_r5_a5_k3_s1_e4_c192rZ  )r[  r\  r]  r^  r]  r_  uir_r3_a5_k0_s1_e4_c512)r   Tr   r   )
r3   r9   r:   r8   r6   r7   rA   r=   r<   rD   r   )	r   r{   r   r   r   rU   rW   r   r   )r   r   r   r   r   r8   rD   r6   r<   r   r   r   s               rp   _gen_mobilenet_v4rs    sF   * L7!%wI)&&9I )
 -,
& 'Y/H` I)&&9I )
 -,
$ 'W.H` 8,WIQ775!%gI)&&9I )( )(
 '5H<  I)&&9I )
 -,

 'C$HJ I)&&9I )
 -,
	 '=!HF 8,WIQ775 "8
C!#c)^8JK2>>E_V-DE5 L *==ELrw   r0   urlc                 0    | dddddt         t        ddd
|S )	zCreate default configuration dictionary.

    Args:
        url: Model weight URL.
        **kwargs: Additional configuration options.

    Returns:
        Configuration dictionary.
    r,   )r-      rv  )   rw  g      ?bilinearrY   ri   )
rt  r4   
input_size	pool_sizecrop_pctinterpolationmeanstd
first_convri   )r   r   )rt  r   s     rp   _cfgr    s2     4}SYJ%.B!	
  rw   zmobilenetv3_large_075.untrained)rt  zmobilenetv3_large_100.ra_in1kbicubiczvhttps://github.com/rwightman/pytorch-image-models/releases/download/v0.1-weights/mobilenetv3_large_100_ra-f55367f5.pthztimm/)r|  rt  	hf_hub_idz)mobilenetv3_large_100.ra4_e3600_r224_in1kr-  )r-      r  )r  r|  r}  r~  r{  test_input_sizetest_crop_pctz(mobilenetv3_large_100.miil_in21k_ft_in1krx  )r1   r1   r1   )r   r   r   z+https://github.com/Alibaba-MIIL/ImageNet21KzarXiv:2104.10972v4zhttps://github.com/rwightman/pytorch-image-models/releases/download/v0.1-tresnet/mobilenetv3_large_100_1k_miil_78_0-66471c13.pth)r|  r}  r~  
origin_url	paper_idsrt  r  z mobilenetv3_large_100.miil_in21kz~https://github.com/rwightman/pytorch-image-models/releases/download/v0.1-tresnet/mobilenetv3_large_100_in21k_miil-d71cc17b.pthi+  )rt  r  r  r  r|  r}  r~  r4   z*mobilenetv3_large_150d.ra4_e3600_r256_in1k)   r  )r-   @  r  )r  r}  r~  ry  r{  rz  r  r  zmobilenetv3_small_050.lamb_in1kzyhttps://github.com/rwightman/pytorch-image-models/releases/download/v0.1-weights/mobilenetv3_small_050_lambc-4b7bbe87.pth)rt  r  r|  zmobilenetv3_small_075.lamb_in1kzyhttps://github.com/rwightman/pytorch-image-models/releases/download/v0.1-weights/mobilenetv3_small_075_lambc-384766db.pthzmobilenetv3_small_100.lamb_in1kzxhttps://github.com/rwightman/pytorch-image-models/releases/download/v0.1-weights/mobilenetv3_small_100_lamb-266a294c.pthzmobilenetv3_rw.rmsp_in1kzmhttps://github.com/rwightman/pytorch-image-models/releases/download/v0.1-weights/mobilenetv3_100-35495452.pthztf_mobilenetv3_large_075.in1kzvhttps://github.com/rwightman/pytorch-image-models/releases/download/v0.1-weights/tf_mobilenetv3_large_075-150ee8b0.pth)rt  r  r}  r~  ztf_mobilenetv3_large_100.in1kzvhttps://github.com/rwightman/pytorch-image-models/releases/download/v0.1-weights/tf_mobilenetv3_large_100-427764d5.pthz%tf_mobilenetv3_large_minimal_100.in1kz~https://github.com/rwightman/pytorch-image-models/releases/download/v0.1-weights/tf_mobilenetv3_large_minimal_100-8596ae28.pthztf_mobilenetv3_small_075.in1kzvhttps://github.com/rwightman/pytorch-image-models/releases/download/v0.1-weights/tf_mobilenetv3_small_075-da427f52.pthztf_mobilenetv3_small_100.in1kzvhttps://github.com/rwightman/pytorch-image-models/releases/download/v0.1-weights/tf_mobilenetv3_small_100-37f49e2b.pthz%tf_mobilenetv3_small_minimal_100.in1kz~https://github.com/rwightman/pytorch-image-models/releases/download/v0.1-weights/tf_mobilenetv3_small_minimal_100-922a7843.pthzfbnetv3_b.ra2_in1kzkhttps://github.com/rwightman/pytorch-image-models/releases/download/v0.1-weights/fbnetv3_b_224-ead5d2a1.pth)rt  r  r  r{  zfbnetv3_d.ra2_in1kzkhttps://github.com/rwightman/pytorch-image-models/releases/download/v0.1-weights/fbnetv3_d_224-c98bce42.pthzfbnetv3_g.ra2_in1kzkhttps://github.com/rwightman/pytorch-image-models/releases/download/v0.1-weights/fbnetv3_g_240-0b1df83b.pth)r-      r  )r-      r  )rt  r  ry  r  r{  rz  zlcnet_035.untrainedzlcnet_050.ra2_in1kzghttps://github.com/rwightman/pytorch-image-models/releases/download/v0.1-weights/lcnet_050-f447553b.pthzlcnet_075.ra2_in1kzghttps://github.com/rwightman/pytorch-image-models/releases/download/v0.1-weights/lcnet_075-318cad2c.pthzlcnet_100.ra2_in1kzghttps://github.com/rwightman/pytorch-image-models/releases/download/v0.1-weights/lcnet_100-a929038c.pthzlcnet_150.untrainedz$mobilenetv4_conv_small_035.untrained)r}  r~  r  r  r|  z*mobilenetv4_conv_small_050.e3000_r224_in1k)r  r}  r~  r  r  r|  z&mobilenetv4_conv_small.e2400_r224_in1k)r  r  r  r|  z&mobilenetv4_conv_small.e1200_r224_in1kz&mobilenetv4_conv_small.e3600_r256_in1k)	r  r}  r~  ry  rz  r{  r  r  r|  z&mobilenetv4_conv_medium.e500_r256_in1k)r  ry  rz  r{  r  r  r|  z&mobilenetv4_conv_medium.e500_r224_in1k)r  r{  r  r  r|  z/mobilenetv4_conv_medium.e250_r384_in12k_ft_in1k)r-     r  )   r  )r  ry  rz  r{  r|  z'mobilenetv4_conv_medium.e180_r384_in12ki-.  )r  r4   ry  rz  r{  r|  z*mobilenetv4_conv_medium.e180_ad_r384_in12kz'mobilenetv4_conv_medium.e250_r384_in12kz%mobilenetv4_conv_large.e600_r384_in1k)r-     r  z%mobilenetv4_conv_large.e500_r256_in1kz1mobilenetv4_hybrid_medium.e200_r256_in12k_ft_in1kz+mobilenetv4_hybrid_medium.ix_e550_r256_in1kz+mobilenetv4_hybrid_medium.ix_e550_r384_in1kz(mobilenetv4_hybrid_medium.e500_r224_in1kz)mobilenetv4_hybrid_medium.e200_r256_in12k)r  r4   ry  rz  r{  r  r  r|  z*mobilenetv4_hybrid_large.ix_e600_r384_in1kz'mobilenetv4_hybrid_large.e600_r384_in1kz$mobilenetv4_conv_aa_medium.untrained)ry  rz  r{  r|  z+mobilenetv4_conv_blur_medium.e500_r224_in1kz1mobilenetv4_conv_aa_large.e230_r448_in12k_ft_in1k)   r  )r-      r  z1mobilenetv4_conv_aa_large.e230_r384_in12k_ft_in1k)r-     r  z(mobilenetv4_conv_aa_large.e600_r384_in1kz)mobilenetv4_conv_aa_large.e230_r384_in12kz'mobilenetv4_hybrid_medium_075.untrained)r{  r|  z&mobilenetv4_hybrid_large_075.untrainedc                      t        dd| i|}|S ) MobileNet V3 r   )mobilenetv3_large_075r  r  r   r   r   s      rp   r  r         ]
]V\]ELrw   c                      t        dd| i|}|S )r  r   )mobilenetv3_large_100r   r  r  s      rp   r  r         \z\U[\ELrw   c                 "    t        dd| d|}|S )r  g333333?)r   r   )mobilenetv3_large_150d      ?r  r  s      rp   r  r    s     sc^hslrsELrw   c                      t        dd| i|}|S )r  r   )mobilenetv3_small_050      ?r  r  s      rp   r  r    r  rw   c                      t        dd| i|}|S )r  r   )mobilenetv3_small_075r  r  r  s      rp   r  r    r  rw   c                      t        dd| i|}|S )r  r   )mobilenetv3_small_100r   r  r  s      rp   r  r  
  r  rw   c                 L    |j                  dt               t        dd| i|}|S )r  bn_epsr   )mobilenetv3_rwr   )
setdefaultr    r   r  s      rp   r  r    s-     h 12 X:XQWXELrw   c                 p    |j                  dt               |j                  dd       t        dd| i|}|S )r  r  r;   samer   )tf_mobilenetv3_large_075r  r  r    r  r  s      rp   r  r    =     h 12
j&)`:`Y_`ELrw   c                 p    |j                  dt               |j                  dd       t        dd| i|}|S )r  r  r;   r  r   )tf_mobilenetv3_large_100r   r  r  s      rp   r  r  "  =     h 12
j&)_*_X^_ELrw   c                 p    |j                  dt               |j                  dd       t        dd| i|}|S )r  r  r;   r  r   ) tf_mobilenetv3_large_minimal_100r   r  r  s      rp   r  r  +  >     h 12
j&)gR\g`fgELrw   c                 p    |j                  dt               |j                  dd       t        dd| i|}|S )r  r  r;   r  r   )tf_mobilenetv3_small_075r  r  r  s      rp   r  r  4  r  rw   c                 p    |j                  dt               |j                  dd       t        dd| i|}|S )r  r  r;   r  r   )tf_mobilenetv3_small_100r   r  r  s      rp   r  r  =  r  rw   c                 p    |j                  dt               |j                  dd       t        dd| i|}|S )r  r  r;   r  r   ) tf_mobilenetv3_small_minimal_100r   r  r  s      rp   r  r  F  r  rw   c                      t        dd| i|}|S )z FBNetV3-B r   )	fbnetv3_br2  r  s      rp   r  r  O       FFvFELrw   c                      t        dd| i|}|S )z FBNetV3-D r   )	fbnetv3_dr  r  s      rp   r  r  V  r  rw   c                      t        dd| i|}|S )z FBNetV3-G r   )	fbnetv3_gr  r  s      rp   r  r  ]  r  rw   c                      t        dd| i|}|S )z PP-LCNet 0.35r   )	lcnet_035ffffff?r:  r  s      rp   r  r  d       JZJ6JELrw   c                      t        dd| i|}|S )z PP-LCNet 0.5r   )	lcnet_050r  r  r  s      rp   r  r  k       IJI&IELrw   c                      t        dd| i|}|S ) PP-LCNet 1.0r   )	lcnet_075r  r  r  s      rp   r  r  r  r  rw   c                      t        dd| i|}|S )r  r   )	lcnet_100r   r  r  s      rp   r  r  y  r  rw   c                      t        dd| i|}|S )z PP-LCNet 1.5r   )	lcnet_150r  r  r  s      rp   r  r    r  rw   c                      t        dd| i|}|S ) MobileNet V4 r   )mobilenetv4_conv_small_035r  rs  r  s      rp   r  r         bZb[abELrw   c                      t        dd| i|}|S )r  r   )mobilenetv4_conv_small_050r  r  r  s      rp   r  r    r  rw   c                      t        dd| i|}|S )r  r   )mobilenetv4_conv_smallr   r  r  s      rp   r  r    r  rw   c                      t        dd| i|}|S )r  r   )mobilenetv4_conv_mediumr   r  r  s      rp   r  r    s     ^^W]^ELrw   c                      t        dd| i|}|S )r  r   )mobilenetv4_conv_larger   r  r  s      rp   r  r    r  rw   c                      t        dd| i|}|S ) MobileNet V4 Hybrid r   )mobilenetv4_hybrid_mediumr   r  r  s      rp   r  r    s     `:`Y_`ELrw   c                      t        dd| i|}|S ) MobileNet V4 Hybridr   )mobilenetv4_hybrid_larger   r  r  s      rp   r  r    s     _*_X^_ELrw   c                 "    t        d| dd|}|S ) MobileNet V4 w/ AvgPool AA r2   r   r>   )mobilenetv4_conv_aa_mediumr   r  r  s      rp   r  r    s     qJafqjpqELrw   c                 "    t        d| dd|}|S )z MobileNet V4 Conv w/ Blur AA blurpcr  )mobilenetv4_conv_blur_mediumr   r  r  s      rp   r  r    s     vjckvouvELrw   c                 "    t        d| dd|}|S )r  r2   r  )mobilenetv4_conv_aa_larger   r  r  s      rp   r  r    s     p:`epiopELrw   c                      t        dd| i|}|S )r  r   )mobilenetv4_hybrid_medium_075r  r  r  s      rp   r  r    s     ePZe^deELrw   c                      t        dd| i|}|S )r  r   )mobilenetv4_hybrid_large_075r  r  r  s      rp   r  r    s     dzd]cdELrw   )mobilenetv3_large_100_miil mobilenetv3_large_100_miil_in21kr   )r   F)r   r   NF)r   NF)r0   )hr   	functoolsr   typingr   r   r   r   r   r	   r
   r   torch.nnrU   torch.nn.functional
functionalr   	timm.datar   r   r   r   timm.layersr   r   r   r   r   r   _builderr   r   _efficientnet_blocksr   _efficientnet_builderr   r   r   r   r   r   r   r    	_featuresr!   r"   r#   _manipulater$   r%   	_registryr&   r'   r(   __all__r   r)   r*   r   r   r   r   r   r   r  r2  r:  rs  r  default_cfgsr  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r   r   rw   rp   <module>r     sZ    D D D     r r k k G /J J J F F 3 Y Y/
0h")) hV	x&")) x&v!# !4 !k !J KP++*/+CG++` %("%$( mm!m  m SM	m
 m m`D# D5 DD Dgr DN* * *$ *ep *^ %($( 	@@!@ SM@ 	@ @Fc T#s(^ & % W&%t|W&#T E&W& 0&=CY}C2IW& / |@& O1W&  ' M@& |SX)Z!W&, 1$$*@ 46S`ps3u-W&6 &t H(!7W&> &t H(!?W&F &t G(!GW&P {!!QW&Z $T E$*@&B[W&b $T E$*@&BcW&j ,T M$*@.BkW&r $T E$*@&BsW&z $T F$*@&B{W&B ,T M$*@.BCW&L $y%6MW&T $y%6UW&\ $y -$Z`b]W&f 46gW&h $uiW&r $usW&| $u}W&F 46GW&J +D$*@%T-TKW&P 1$$*@%T3TQW&X -d%T/TYW&^ -d%T/T_W&d -d$*@ FT%S		/SeW&n -d F}CW`/boW&v -d}CW`/bwW&~ 6t HY80W&F .t HI	0/GW&P 1$ HI	3/QW&Z .t HI	0/[W&f ,T H}CW`.bgW&n ,T F}CW`.boW&x 8 F}CW`:byW&@ 24 F}CW`4bAW&H 24 H}CW`4bIW&P /}CW`1bQW&V 0 F}CW`	2bWW&` 1$ H}CW`3baW&h .t H}CW`0biW&t +D FTQZ-\uW&z 24}CW`4b{W&@ 8 H}CW`:bAW&H 8 H}CW`:bIW&P / H}CW`1bQW&X 0 H}CW`	2bYW&b .tY00cW&h -d FTQZ/\iW& Wt d    d   
 t +  
 d    d    d    t +    K    K    K    K    K    K   $ [   $ [   $ [   $ [   $ [   $ [   $ [   $ [   4 k   4 k   t +    ;   t +   $ [    K   4 k   T    $ [   d    T    H"L(J' rw   