§
    é&Vfõ  ã                   óp   — d Z ddlZddlmZ ddlmZ ddlmZ  G d„ dej        j        j	        ¦  «        Z	dS )ztKeras integration for TensorBoard hparams.

Use `tensorboard.plugins.hparams.api` to access this module's contents.
é    N)Úapi_pb2)Úsummary)Ú
summary_v2c                   ó0   — e Zd ZdZdd„Zd„ Zdd„Zdd„ZdS )ÚCallbackzwCallback for logging hyperparameters to TensorBoard.

    NOTE: This callback only works in TensorFlow eager mode.
    Nc                 ó6  — t          |¦  «        | _        || _        t          j        | j        | j        ¬¦  «         |€t          d¦  «        ‚t          |t          ¦  «        r0t          j	        j
        j                             |¦  «        | _        dS || _        dS )a'  Create a callback for logging hyperparameters to TensorBoard.

        As with the standard `tf.keras.callbacks.TensorBoard` class, each
        callback object is valid for only one call to `model.fit`.

        Args:
          writer: The `SummaryWriter` object to which hparams should be
            written, or a logdir (as a `str`) to be passed to
            `tf.summary.create_file_writer` to create such a writer.
          hparams: A `dict` mapping hyperparameters to the values used in
            this session. Keys should be the names of `HParam` objects used
            in an experiment, or the `HParam` objects themselves. Values
            should be Python `bool`, `int`, `float`, or `string` values,
            depending on the type of the hyperparameter.
          trial_id: An optional `str` ID for the set of hyperparameter
            values used in this trial. Defaults to a hash of the
            hyperparameters.

        Raises:
          ValueError: If two entries in `hparams` share the same
            hyperparameter name.
        ©Útrial_idNz3writer must be a `SummaryWriter` or `str`, not None)ÚdictÚ_hparamsÚ	_trial_idr   Ú
hparams_pbÚ	TypeErrorÚ
isinstanceÚstrÚtfÚcompatÚv2r   Úcreate_file_writerÚ_writer)ÚselfÚwriterÚhparamsr
   s       ú_/var/www/html/software/conda/lib/python3.11/site-packages/tensorboard/plugins/hparams/_keras.pyÚ__init__zCallback.__init__"   s‹   € õ4 ˜W™œˆŒØ!ˆŒÝÔ˜dœm°d´nÐEÑEÔEÐEØˆ>ÝØEñô ð õ ˜¥Ñ$Ô$ð 	"Ýœ9œ<Ô/×BÒBÀ6ÑJÔJˆDŒLˆLˆLà!ˆDŒLˆLˆLó    c                 ó€   — | j         €t          d¦  «        ‚t          j        ¦   «         st          d¦  «        ‚| j         S )Nz@hparams Keras callback cannot be reused across training sessionsz>hparams Keras callback only supported in TensorFlow eager mode)r   ÚRuntimeErrorr   Úexecuting_eagerly)r   s    r   Ú_get_writerzCallback._get_writerH   sQ   € ØŒ<ÐÝØRñô ð õ Ô#Ñ%Ô%ð 	ÝØPñô ð ð Œ|Ðr   c                 óÆ   — ~|                       ¦   «                              ¦   «         5  t          j        | j        | j        ¬¦  «         d d d ¦  «         d S # 1 swxY w Y   d S )Nr	   )r    Ú
as_defaultr   r   r   r   )r   Úlogss     r   Úon_train_beginzCallback.on_train_beginS   sµ   € ØØ×ÒÑÔ×*Ò*Ñ,Ô,ð 	Gð 	GÝÔ˜tœ}°t´~ÐFÑFÔFÐFð	Gð 	Gð 	Gñ 	Gô 	Gð 	Gð 	Gð 	Gð 	Gð 	Gð 	Gð 	Gøøøð 	Gð 	Gð 	Gð 	Gð 	Gð 	Gs   ¨!AÁAÁAc                 óV  — ~|                       ¦   «                              ¦   «         5  t          j        t          j        ¦  «        }|                     ¦   «         }t          j        j	        j        j
                             |d¬¦  «         d d d ¦  «         n# 1 swxY w Y   d | _        d S )Nr   )Ústep)r    r"   r   Úsession_end_pbr   ÚSTATUS_SUCCESSÚSerializeToStringr   r   r   ÚexperimentalÚwrite_raw_pbr   )r   r#   ÚpbÚraw_pbs       r   Úon_train_endzCallback.on_train_endX   sÝ   € ØØ×ÒÑÔ×*Ò*Ñ,Ô,ð 	Kð 	KÝÔ'­Ô(>Ñ?Ô?ˆBØ×)Ò)Ñ+Ô+ˆFÝŒIŒLÔ Ô-×:Ò:¸6ÈÐ:ÑJÔJÐJð	Kð 	Kð 	Kñ 	Kô 	Kð 	Kð 	Kð 	Kð 	Kð 	Kð 	Køøøð 	Kð 	Kð 	Kð 	Kð ˆŒˆˆs   ¨A#BÂBÂB)N)Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   r    r$   r.   © r   r   r   r      sn   € € € € € ðð ð
$"ð $"ð $"ð $"ðL	ð 	ð 	ðGð Gð Gð Gð
ð ð ð ð ð r   r   )
r2   Ú
tensorflowr   Útensorboard.plugins.hparamsr   r   r   ÚkerasÚ	callbacksr   r3   r   r   ú<module>r8      s™   ððð ð Ð Ð Ð à /Ð /Ð /Ð /Ð /Ð /Ø /Ð /Ð /Ð /Ð /Ð /Ø 2Ð 2Ð 2Ð 2Ð 2Ð 2ðBð Bð Bð Bð BˆrŒxÔ!Ô*ñ Bô Bð Bð Bð Br   