
    2Vhv                        d dl mZ d dlmZ d dlmZ d dlmZ d dlmZ d dl	m
Z
 d dlmZ d dlmZ d d	lmZ  G d
 dej$                        Zd Zd Zd Zd Z G d dej$                        Z G d dej2                        Zy)    )
namedtuple)losses)metrics)ops)tree)KerasTensor)loss)get_object_name)Trackerc                   J     e Zd Zd fd	ZddZd Zd Zd Zed        Z	 xZ
S )	MetricsListc                 B    t         |   |       || _        || _        y )Nname)super__init__r   output_name)selfr   r   r   	__class__s       P/home/dcms/DCMS/lib/python3.12/site-packages/keras/src/trainers/compile_utils.pyr   zMetricsList.__init__   s"    d#&    c                 N    | j                   D ]  }|j                  |||        y )Nsample_weight)r   update_state)r   y_truey_predr   ms        r   r   zMetricsList.update_state   s)     	HANN66NG	Hr   c                 F    | j                   D ]  }|j                           y N)r   reset_stater   r   s     r   r!   zMetricsList.reset_state   s     	AMMO	r   c                 r    | j                   D ci c]  }|j                  |j                          c}S c c}w r    )r   r   resultr"   s     r   
get_resultzMetricsList.get_result   s)    ,0LL9q
"999s   "4c                     t         r    NotImplementedErrorr   s    r   
get_configzMetricsList.get_config       !!r   c                     t         r    r'   clsconfigs     r   from_configzMetricsList.from_config!       !!r   )metrics_listNr    )__name__
__module____qualname__r   r   r!   r%   r*   classmethodr0   __classcell__r   s   @r   r   r      s1    '
H:" " "r   r   c                 D    | yt        | t              ryt        |       ryy)NTF)
isinstancestrcallable)values    r   is_function_liker>   &   s$    }%r   c                     t        | j                        }t        |j                        }| j                  d   }|j                  d   }|dk(  }||k  xs |dk(  xr |dkD  }||fS )N   )lenshape)r   r   y_t_ranky_p_ranky_t_last_dimy_p_last_dim	is_binaryis_sparse_categoricals           r   is_binary_or_sparse_categoricalrJ   0   ss    6<< H6<< H<<#L<<#L!I8E|q0E\A5E  +++r   c                    | y t        |       j                         dvrt        j                  |       }nrt	        ||      \  }}|r t        j
                  t        |             }nA|r t        j                  t        |             }nt        j                  t        |             }t        | t               r| }nt        |      }t        |t        j                        st        j                  |      }||_        |S )N)accuracyaccr   )r;   lowermetrics_modulegetrJ   BinaryAccuracySparseCategoricalAccuracyCategoricalAccuracyr:   r
   MetricMeanMetricWrapperr   )
identifierr   r   
metric_objrH   rI   metric_names          r   
get_metricrY   =   s     :&99#''
3
+JF,
(	( '66C
OLJ"'AA_J (;;_J *c" %j1j."7"78#55jA
!JOr   c                    | y t        |       j                         dvrt        j                  |       }nEt	        ||      \  }}|rt        j
                  }n#|rt        j                  }nt        j                  }t        |t        j                        s5t        | t               r| }nt        |      }t        j                  ||      }|S )N)crossentropycer   )r;   rN   losses_modulerP   rJ   binary_crossentropysparse_categorical_crossentropycategorical_crossentropyr:   Lossr
   LossFunctionWrapper)rV   r   r   loss_objrH   rI   	loss_names          r   get_lossre   `   s     :&<< $$Z0+JF,
(	( $88H"$DDH$==Hh 2 23j#&"I'1I 44XINOr   c                        e Zd Z	 	 d fd	Zed        Zed        Zd Zd Zd Z	ddZ
d Zd	 Zd
 Zed        Z xZS )CompileMetricsc                 H   t         |   |       |r5t        |t        t        t
        f      st        d| dt        |             |r5t        |t        t        t
        f      st        d| dt        |             || _        || _	        d| _
        d| _        || _        y )Nr   zTExpected `metrics` argument to be a list, tuple, or dict. Received instead: metrics=	 of type zfExpected `weighted_metrics` argument to be a list, tuple, or dict. Received instead: weighted_metrics=Fcompile_metrics)r   r   r:   listtupledict
ValueErrortype_user_metrics_user_weighted_metricsbuiltr   output_names)r   r   weighted_metricsr   rs   r   s        r   r   zCompileMetrics.__init__}   s     	d#:geT/BC--4IYtG}oO  JtUD1%
 <<L;M N 0124 
 %&6#
%	(r   c                     | j                   sg S g }| j                  | j                  z   D ]B  }t        |t              r|j                  |j                         /|2|j                  |       D |S r    )rr   _flat_metrics_flat_weighted_metricsr:   r   extendr   append)r   r   r   s      r   r   zCompileMetrics.metrics   se    zzI##d&A&AA 	"A![)qyy)q!		"
 r   c                     | j                   sg S g }| j                  D ]   }||j                  |j                         " |S r    )rr   r   rx   	variablesr   varsr   s      r   r{   zCompileMetrics.variables   sD     zzI 	)A}AKK(	) r   c                    d}| j                   r| j                   }nt        |t              r#t        t	        |j                                     }nft        |t        t        f      rNt        |      }t        d |D              r.|D cg c]"  }|j                  j                  j                  $ }}nd }nd }|rt        |      }| j                  |      }| j                  |      }| j                  }| j                  }| j                  |||||d      | _        | j                  |||||d      | _        d| _        y c c}w )NrA   c              3   4   K   | ]  }t        |d         yw)_keras_historyN)hasattr.0xs     r   	<genexpr>z'CompileMetrics.build.<locals>.<genexpr>   s     @A71./@s   r   )argument_namert   T)rs   r:   rm   sortedrk   keysrl   rB   allr   	operationr   
_flatten_yrp   rq   _build_metrics_setrv   rw   rr   )r   r   r   num_outputsrs   r   r   rt   s           r   buildzCompileMetrics.build   s3   ,,L%!$v{{}"56Lu.f+K@@@IOPA 0 0 : : ? ?PP#Ll+K(($$66!44# 5 
 '+&=&=, '> '
# 
;  Qs   'D<c                    g }t        |t              r0|j                         D ]  }||vst        d| d| d| d|        |dk(  r|s|j	                  d        |S t        |t              rt        j                  |      }t        |t              s|g}t        d |D              st        d| d| d|       |j	                  t        |D 	cg c]  }	|	t        |	|d	   |d	          c}	             |S t        |t        t        f      rt        |      t        |      k7  r-t        d
| d| d| dt        |       dt        |       d      t        t        |||            D ]  \  }
\  }}}t        |t              s|g}|r||
   nd }t        d |D              st        d| d|       |j	                  t        |D 	cg c]  }	|	t        |	||       c}	|              |S t        |t              r|t        d| d| d|       |j                         D ]J  }t        ||   t              s	||   g||<   t        d ||   D              r5t        d| d| d||           t        |||      D ]V  \  }}}||v r;|j	                  t        ||   D 	cg c]  }	|	t        |	||       c}	|             F|j	                  d        X |S c c}	w c c}	w c c}	w )NzIn the dict argument `z`, key 'z5' does not correspond to any model output. Received:
=rA   c              3   2   K   | ]  }t        |        y wr    r>   )r   r   s     r   r   z4CompileMetrics._build_metrics_set.<locals>.<genexpr>   s     @1+A.@   zExpected all entries in the `z/` list to be metric objects. Received instead:
r   z7For a model with multiple outputs, when providing the `zY` argument as a list, it should have as many entries as the model has outputs. Received:
z
of length z whereas the model has z	 outputs.c              3   2   K   | ]  }t        |        y wr    r   r   es     r   r   z4CompileMetrics._build_metrics_set.<locals>.<genexpr>  s     @q/2@r   z$All entries in the sublists of the `zQ` list should be metric objects. Found the following sublist with unknown types: )r   z
Argument `zY` can only be provided as a dict when the model also returns a dict of outputs. Received c              3   2   K   | ]  }t        |        y wr    r   r   s     r   r   z4CompileMetrics._build_metrics_set.<locals>.<genexpr>'  s     Jq/2Jr   z)` dict should be metric objects. At key 'z3', found the following sublist with unknown types: )r:   rm   r   rn   ry   r   flattenrk   r   r   rY   rl   rB   	enumeratezip)r   r   r   rs   r   r   r   flat_metricsr   r   idxmlsytyps                 r   r   z!CompileMetrics._build_metrics_set   s    gt$ |+$0 @ 6 "..;_AgYH  !##D)l i gt,"ll73G!'40&iG@@@$7 GD(/7)5 
 ## &- ! } 'q&)VAY?T A 'D%=1w<3v;.$//<o >//<oQwi H""%g,/Fv;-y2  +40+ &C#r2 &c40"e0<<,$D@C@@(  - /&&)U,  !''# *-$%#$= !+1b" 5
 )-	l ? GT*'$$]O 4$$1?!G9> 
 $LLN 	D%gdmT:)0JGDMJJ(  - /''+f -33:4=/C 		 %(ff$E 2LD"bw$++' .5T]!"()'(} %/q"b$9!"
 -1	 %++D12 QB:!"s   KKK!c                     t        |t              r:| j                  r.g }| j                  D ]  }||v s|j                  ||           |S t	        j
                  |      S r    )r:   rm   rs   ry   r   r   )r   yr$   r   s       r   r   zCompileMetrics._flatten_y>  sZ    a4#4#4F)) +19MM!D'*+ M||Ar   c                 R   | j                   s| j                  ||       | j                  |      }| j                  |      }t        | j                  ||      D ]  \  }}}|s
|j                  ||        |M| j                  |      }t        |      t        |      k  rFt        t        |            D cg c]  }|d   	 }}n!t        t        |            D cg c]  }d  }}t        | j                  |||      D ]  \  }}}}|s|j                  |||        y c c}w c c}w )Nr   )	rr   r   r   r   rv   r   rB   rangerw   )	r   r   r   r   r   y_ty_p_s_ws	            r   r   zCompileMetrics.update_stateG  s   zzJJvv&((t1166B 	)KAsCsC(	) $ OOM:M=!CK/;@V;M Naq!1 N N+0V+=>aT>M> #''!
 	.AsC sC-		. !O>s   6D	D$c                     | j                   sy | j                  D ]  }|s|j                           | j                  D ]  }|s|j                           y r    )rr   rv   r!   rw   r"   s     r   r!   zCompileMetrics.reset_state\  sP    zz## 	 A	  ,, 	 A	 r   c                    | j                   st        d      i }i }| j                  D ]  }|s|j                  D ]t  }|j                  }|j
                  r|j
                   d| }||vr|j                         ||<   d||<   I||   }||xx   dz  cc<   | d| }|j                         ||<   v  | j                  D ]  }|s|j                  D ]  }|j                  }|j
                  r|j
                   d| }||vr|j                         ||<   d||<   Id|j                   }|j
                  r|j
                   d| }||vrd||<   n||   }||xx   dz  cc<   | d| }|j                         ||<     |S )Nz<Cannot get result() since the metric has not yet been built.r   rA   	weighted_)rr   rn   rv   r   r   r   r$   rw   )r   resultsunique_name_countersr   r   r   indexs          r   r$   zCompileMetrics.resultf  s   zzN  !%% 	/C[[ /vv??!oo.av6D33$%HHJGDM12(.06E(.!3."V1UG,D$%HHJGDM/	/  .. 	/C[[ /vv??!oo.av6D33$%HHJGDM12(.&qvvh/D"%//!2!D6:#7756,T2 4T :,T2a72"&q0$%HHJGDM#/	/* r   c                     t         r    r'   r)   s    r   r*   zCompileMetrics.get_config  r+   r   c                     t         r    r'   r-   s     r   r0   zCompileMetrics.from_config  r1   r   )compile_metricNr    )r3   r4   r5   r   propertyr   r{   r   r   r   r   r!   r$   r*   r6   r0   r7   r8   s   @r   rg   rg   |   ss    
 )6 	 	 	 	&PdL.* ,\" " "r   rg   c                        e Zd Z edg d      Z	 	 	 d fd	Zed        Zed        Zd Z	d Z
d Zdd	Zdd
Zd Zed        Z xZS )CompileLossra   )pathr	   loss_weightsr   c                 N   |r:t        |t        t        t        t        f      st        d| dt        |             || _        || _        d| _	        || _
        t        | 1  d|       g | _        t        dd | j                  fi      | _        d | _        d | _        d | _        y )NzExpected `loss_weights` argument to be a float (single output case) or a list, tuple, or dict (multiple output case). Received instead: loss_weights=ri   Fcompile_loss)r   	reductionr   c                 6    t        | t        j                        S r    )r:   rO   rT   r   s    r   <lambda>z&CompileLoss.__init__.<locals>.<lambda>  s    jN,A,AB r   )r:   rk   rl   rm   floatrn   ro   
_user_loss_user_loss_weightsrr   rs   r   r   _metricsr   _tracker_flat_losses_y_pred_build_structure_y_true_build_structure)r   r	   r   r   rs   r   s        r   r   zCompileLoss.__init__  s     
4e4!
 2 3? @-.	0  ".
(n	B BMM
 !'+$'+$r   c                     | j                   S r    )r   r)   s    r   r   zCompileLoss.metrics  s    }}r   c                 b    g }| j                   D ]  }|j                  |j                          |S r    )r   rx   r{   r|   s      r   r{   zCompileLoss.variables  s/     	%AKK$	%r   c           	      h   t        j                  |      }t        j                  |      s-|j                  }|y |j                  }t        |||      }	|}
t        j                  |      s?||}n|	j                  }t        |
      dk(  r|f}
nt        |
d   t              r	|
d d |fz   }
dj                  |
D cg c]  }t        |       c}      }|dk(  rPt        |t              rt        |j                               }nt        j                  |      }dj                  |      }| j                  j!                  t"        j%                  ||	||             y t'        t)        |      t        t*        f      r[t-        |D cg c]  }t        j                  |        c}      r.t        |      t        |      k(  rt        j.                  ||      }nQt'        t)        |      t        t*        f      r2t        |t)        |            s|D ]  }| j1                  |||||        y t        j                  |      s| j1                  |||||      S t        |t)        |            st3        d| d      t        |t              r|j5                         }d }nFt'        t)        |      t        t*        f      rt7        |      }d	 }nt9        d
t)        |       d      |D ]H  \  }}|	 ||||f      st3        d||fz    d      | j1                  ||   ||   |||   ||fz          J y c c}w c c}w )Nr   r@   / r   z
The path: zI in the `loss` argument, can't be found in the model's output (`y_pred`).c           	      f    t        |D cg c]  }t        |t              xr | |v  c}      S c c}w r    )r   r:   rm   keyobjsobjs      r   key_check_fnz/CompileLoss._build_nested.<locals>.key_check_fn  s3    EIJcZT*9scz9J Js   .c           
          t        |D cg c]1  }t        t        |      t        t        f      xr | t        |      k  3 c}      S c c}w r    )r   
issubclassro   rk   rl   rB   r   s      r   r   z/CompileLoss._build_nested.<locals>.key_check_fn  sK     $( #49tUm<Os3xO s   6AzUnsupported type z in the `loss` configuration.zl in the `loss` argument, can't be found in either the model's output (`y_pred`) or in the labels (`y_true`).)r   r   	is_nestedr	   weightre   r   rB   r:   intjoinr;   rm   rk   r   r   ry   r   ra   r   ro   rl   r   pack_sequence_as_build_nestedKeyErroritemsr   	TypeError)r   r   r   r	   rs   current_pathflat_y_pred_lossloss_weightresolved_loss	name_pathr   r   r   flat_output_namesiteratorr   r   s                     r   r   zCompileLoss._build_nested  s   ll6*~~d#IIE}++K$UFF;M$I>>,/+".K"/"4"4Ky>Q&!,I	"s3 )#2+ ?I889=4SY=>DrzlD1(,\->->-@(A%(,\(B%xx 12$$  }k4P tDzD%=1DA5..ABD	S--((6DT
T5M2:DJ<
  ""   ~~d#%%lL  $V-\N +1 1  dD!zz|H
 T
T5M2 H #DJ</LM  # 	JC}ff%56 !6 7 8) )  ssS!v%	G > Bs   9L*L/c           	      	   | j                   | j                  }| j                  }| j                  rt        | j                   t              rt        |t              st        | j                        t        | j                   j                               k(  rh| j                  D cg c]  }| j                   |    c}t        | j                  t              rc| j                  D cg c]  }| j                  |    }}n<t        d| j                   dt        | j                   j                                       G d d      |2	 t        j                  |       t        j                  fd|      nt        j                  fd	      g | _        t        t              rt!        t#        |      t        t$        f      r{t        j                               t        |      k(  rVt        |      t        |      k(  r?t'        ||      D ci c]  \  }}||
 }}}t'        ||      D ci c]  \  }}||
 }}}nt        t              rt        j(                  |      sst        j                               t        |      k(  rNt        |      d
k(  r@t'        ||g      D ci c]  \  }}||
 }}}t'        ||g      D ci c]  \  }}||
 }}}	 t        j                  ||      }	t        j(                        st        j                  fd|      | j-                  |||	d       t        | j                        d
kD  rP| j                  D ]A  }|j.                  dz   }| j0                  j3                  dt5        j6                  |             C t        j                  d |      | _        t        j                  d |      | _        d| _        y c c}w c c}w # t        $ r t        j                  |      }t        t        j                              t        |      k7  r7t        dt        t        j                               dt        |       d      t        j                  |      }Y !w xY wc c}}w c c}}w c c}}w c c}}w #  | j+                  |      }
t        j                  ||
      }	Y xY w)NzExpected keys z% in loss dict, but found loss.keys()=c                       e Zd Zd Zd Zy)'CompileLoss.build.<locals>.WeightedLossc                 2    |y t         j                  |       S r    )object__new__)r.   r	   r   s      r   r   z/CompileLoss.build.<locals>.WeightedLoss.__new__O  s    <~~c**r   c                      || _         || _        y r    )r	   r   )r   r	   r   s      r   r   z0CompileLoss.build.<locals>.WeightedLoss.__init__T  s     	$r   N)r3   r4   r5   r   r    r   r   WeightedLossr   N  s    +
%r   r   z4`loss_weights` must match the number of losses, got z losses and z	 weights.c                      | |      S r    r   )r   _weightr   s     r   r   z#CompileLoss.build.<locals>.<lambda>f  s    |E7'C r   c                      | d       S r    r   )r   r   s    r   r   z#CompileLoss.build.<locals>.<lambda>l  s    l5$7 r   rA   c                     S r    r   )r   r	   s    r   r   z#CompileLoss.build.<locals>.<lambda>  s     r   r   r   r   r   c                      y r    r   r   s    r   r   z#CompileLoss.build.<locals>.<lambda>      r   c                      y r    r   r   s    r   r   z#CompileLoss.build.<locals>.<lambda>  r   r   T)r   r   rs   r:   rm   setr   rn   rk   r   assert_same_structurer   rB   r   map_structurer   r   ro   rl   r   r   _get_y_pred_output_namesr   r   r   add_to_storerO   Meanr   r   rr   )r   r   r   r   r   r   flat_loss_weightsr   r   rs   inferred_flat_output_namesr   r   r	   s               @@r   r   zCompileLoss.build7  sU   .. --4??D1vt,4$$%T__-A-A-C)DD:>:K:KL$-Ld55t< %)$5$5$  //5$L $
 !$T%6%6$7 8))-doo.B.B.D)E(FH 	% 	% #
N**4> %%CD %%7D  tT"4<$7DIIK C(9$::Fs#455145F1OPID#dCiPFP145F1OPID#dCiPFPtT"NN6*DIIK C(9$::%&!+ ,//@6(+K'dCc	F  ,//@6(+K'dCc	F 	009JKL ~~d#%%nf=D664rB t  !A%** zzG+**~22= (,'9'9F(
$ (,'9'9F(
$ 
A M$2  N$(LL$>!t||D)*c2C.DD$"4<<#567 8"<01< 
  $44T;LMN6 QP	)-)F)Fv)N&002LsC   %O&O"O' R2R	+RRR 'BR ?R )Sc                 6   t        j                  |      }t        d |D              rbg }|D ]Y  }t        |d      r0|j	                  |j
                  j                  j                         ?|j	                  |j                         [ |S d gt        |      z  }|S )Nc              3   <   K   | ]  }t        |t                y wr    )r:   r   r   s     r   r   z7CompileLoss._get_y_pred_output_names.<locals>.<genexpr>  s     @q
1k*@s   r   )	r   r   r   r   ry   r   r   r   rB   )r   r   r   rs   tensors        r   r   z$CompileLoss._get_y_pred_output_names  s    ll6*@K@AL% 56#34 ''(=(=(G(G(L(LM ''4	5  !6C$44Lr   c                     t        j                  | j                        5  | j                  |||      cd d d        S # 1 sw Y   y xY wr    )r   
name_scoper   call)r   r   r   r   s       r   __call__zCompileLoss.__call__  s7    ^^DII& 	<99VV];	< 	< 	<s	   =Ac                 	   t        j                  |      st        j                  |      su| j                  s| j                  ||       | j                  d   \  }}}}t        j                   ||||      | j                        }|t        j                  ||      }|S 	 t        j                  ||       | j                  s| j                  ||       	 t        j                  | j6                  |       	 t        j                  | j8                  |       t        | j:                        dk(  rd gn| j:                  }g }d
 }t3        | j                  |      D ]  \  \  }}}}} |||       |||      }}|t        j                  |      r
 |||      }n|}t        j                   ||||      | j                        }|rI|j=                  t?        j@                  |      t        j,                  |      d   jB                  d          |t        j                  ||      }|jE                  |        |rtG        |      }|S y # t        $ r t        j                  |      st        |d      rt        |      dk(  r|g}nwt        |t        t        f      rat        |t               rQt#        | j$                        t#        |j'                               k(  r"| j$                  D cg c]  }||   	 nc c}w }}	 t        j(                  ||      }nW#  	 t        j*                  ||       t        j(                  |t        j,                  |            }n#  	 t        j,                  |      }	t        j,                  | j.                        }
t1        |
      D cg c]  \  }}|||f nc c}}w }}}t        |	      t        |      k(  sJ d gt        |
      z  }t3        |	|      D ]  \  }\  }}|||<    t        j(                  | j.                  |      }nE#  t        j4                  d |      }t        j4                  d |      }t        d| d| d	      xY wY nxY wY nxY wY w xY w# t        $ r7 t        j(                  | j6                  t        j,                  |            }Y w xY w# t        $ r7 t        j(                  | j8                  t        j,                  |            }Y w xY w)Nr   )dtype__len__rA   c                      yN*r   r   s    r   r   z"CompileLoss.call.<locals>.<lambda>  r   r   c                      yr  r   r  s    r   r   z"CompileLoss.call.<locals>.<lambda>  r   r   z5y_true and y_pred have different structures.
y_true: z	
y_pred: 
c                     | D ]  }||   }	 |S r    r   )r   r   _paths      r   resolve_pathz&CompileLoss.call.<locals>.resolve_path  s     ''Mr   r   )$r   r   rr   r   r   r   castr  multiplyr   rn   r   rB   r:   rk   rl   rm   r   rs   r   r   assert_same_pathsr   r   r   r   r   r   r   r   r   loss_moduleunscale_loss_for_distributionrC   ry   sum)r   r   r   r   r   loss_fnr   
loss_valuer   flat_y_true	flat_lossir	   flat_loss_non_nonesr   y_true_structy_pred_structr   loss_valuesr  r   metricr   _sample_weightr=   
total_losss                             r   r   zCompileLoss.call  s   ~~f%dnnV.D::

66*)-):):1)=&AwQ6djjJ & \\*kB
5	&&vv6l zzJJvv&	&&t'C'CVL
	&&t'C'CVL  -24& 	
 8;w8
 	&3+T7KV $D&1<f3MC(T^^M-J!-dM!B!.HHS.1E ##==eD"&,,s"3A"6"<"<Q"? $  &UK8u%)	&, [)JS  3	 NN6*FI.K1$  FT5M2z&$7Ot(()S-??7;7H7HItfTlIIFI%..vv>#**66:!2264<<;OPF&*ll6&:$(LL$A	 ,5Y+?/ '4#/ I/ /+ /
  #;/37J3KKKK"&#i.!8.1')</ ,NC!T ),F1I, "&!6!6t!O(,(:(:)6) )-(:(:)6) )''4o 6''4oR9  O3	t  	**,,dll6.BF	  	**,,dll6.BF	s   !I  Q3 7 R6 B Q0(K54Q0=LQ0Q)?MQ)Q$APN/.A.PQ$AQ	Q$"Q)'Q0/Q03<R32R36<S65S6c                     t         r    r'   r)   s    r   r*   zCompileLoss.get_config.  r+   r   c                     t         r    r'   r-   s     r   r0   zCompileLoss.from_config1  r1   r   )Nsum_over_batch_sizeNr    )r3   r4   r5   r   ra   r   r   r   r{   r   r   r   r   r   r*   r6   r0   r7   r8   s   @r   r   r     s    fFGD
 '#,J    fPjX<xt" " "r   r   N)collectionsr   	keras.srcr   r]   r   rO   r   r   %keras.src.backend.common.keras_tensorr   keras.src.lossesr	   r  keras.src.utils.namingr
   keras.src.utils.trackingr   rT   r   r>   rJ   rY   re   rg   ra   r   r   r   r   <module>r(     sp    " - /   = 0 2 ,".'' "2
, F8]"^** ]"@	W"-$$ W"r   