Ë
    ›¾j…  ã                   óf  — d Z ddlmZ ddlZddlmZ  ej                  d«      deded	ee   d
ee   fd„«       Z	 ej                  d«      ded
ee   fd„«       Z
 ej                  d«      ddœdededed
ee   fd„«       Z ej                  d«      ddœdedededed
ee   f
d„«       Zdededed
efd„Z ej                  d«      ddddd œd!ed"ed#ed$ededed
ee   fd%„«       Z ej                  d&«      d'ed(ed)ed
ee   fd*„«       Z ej                  d+«      d,ed-ed.ed
ee   fd/„«       Zg d0¢Zy)1zEGenerators that provide different rates, schedules, decays or series.é    )ÚIterableNé   )Úregistryzconstant_then.v1ÚrateÚstepsÚscheduleÚreturnc              #   óJ   K  — t        |«      D ]  }| –— Œ |D ]  }|–— Œ y­w)z>Yield a constant rate for N steps, before starting a schedule.N)Úrange)r   r   r   ÚiÚvalues        úY/home/spazio/kingdom_calls/work5/transenv/lib/python3.12/site-packages/thinc/schedules.pyÚconstant_thenr   
   s4   è ø€ ô
 �5‹\ò ˆØ‹
ðàò ˆØ‹ñùs   ‚!#zconstant.v1c              #   ó   K  — 	 | –— Œ­w)zYield a constant rate.© )r   s    r   Úconstantr      s   è ø€ ð ØŠ
ð ùs   ‚	zdecaying.v1)ÚtÚ	base_rateÚdecayr   c             #   ó8   K  — 	 | dd||z  z   z  z  –— |dz  }Œ­w)a  Yield an infinite series of linearly decaying values,
    following the schedule: base_rate * 1 / (1 + decay * t)

    EXAMPLE:
        >>> learn_rates = decaying(0.001, 1e-4)
        >>> next(learn_rates)
        0.001
        >>> next(learn_rates)
        0.00999
    ç      ð?r   r   )r   r   r   s      r   Údecayingr      s1   è ø€ ð Ø˜3 #¨°©	¡/Ñ2Ñ3Ò3Ø	ˆQ‰ˆð ùs   ‚zcompounding.v1ç        ÚstartÚstopÚcompoundc             #   óL   K  — t        | «      }	 t        || |«      –— ||z  }Œ­w)ad  Yield an infinite series of compounding values. Each time the
    generator is called, a value is produced by multiplying the previous
    value by the compound rate.

    EXAMPLE:
        >>> sizes = compounding(1.0, 10.0, 1.5)
        >>> assert next(sizes) == 1.
        >>> assert next(sizes) == 1 * 1.5
        >>> assert next(sizes) == 1.5 * 1.5
    )ÚfloatÚ_clip)r   r   r   r   Úcurrs        r   Úcompoundingr!   -   s2   è ø€ ô �‹<€DØ
Ü�D˜% Ó&Ò&Ø�Ñˆð ùs   ‚"$r   c                 ó<   — ||kD  rt        | |«      S t        | |«      S )N)ÚmaxÚmin)r   r   r   s      r   r   r   A   s!   € Ø %¨¢Œ3ˆu�dÓÐC´3°u¸dÓ3CÐCó    zslanted_triangular.v1gš™™™™™¹?é    r   )Úcut_fracÚratior   r   Úmax_rateÚ	num_stepsr'   r(   c             #   ó¢   K  — t        ||z  «      }	 |dz  }||k  r||z  }nd||z
  |d|z  dz
  z  z  z
  }| d||dz
  z  z   z  d|z  z  }|–— Œ=­w)zxYield an infinite series of values according to Howard and Ruder's
    "slanted triangular learning rate" schedule.
    r   )Úint)	r)   r*   r'   r(   r   r   ÚcutÚpÚ
learn_rates	            r   Úslanted_triangularr0   E   s   è ø€ ô ˆi˜(Ñ"Ó
#€CØ
Ø	ˆQ‰ˆØˆsŠ7Ø�C‘‰Aà�a˜#‘g #¨¨X©¸Ñ)9Ñ":Ñ;Ñ<ˆAØ  Q¨%°!©)¡_Ñ!4Ñ5¸¸U¹ÑCˆ
ØÒð ùs   ‚AAzwarmup_linear.v1Úinitial_rateÚwarmup_stepsÚtotal_stepsc           	   #   ó’   K  — d}	 ||k  r|t        d|«      z  }nt        d||z
  t        d||z
  «      z  «      }|| z  –— |dz  }ŒA­w)z�Generate a series, starting from an initial rate, and then with a warmup
    period, and then a linear decline. Used for learning rates.
    r   r   r   r   )r#   )r1   r2   r3   ÚstepÚfactors        r   Úwarmup_linearr7   ]   si   è ø€ ð €DØ
Ø�,ÒØœC  <Ó0Ñ0‰FäØ�k DÑ(¬C°°[À<Ñ5OÓ,PÑPóˆFð �|Ñ#Ò#Ø�‰	ˆð ùs   ‚AAzcyclic_triangular.v1Úmin_lrÚmax_lrÚperiodc              #   óÒ   K  — d}	 t        j                  d|d|z  z  z   «      }t        j                  ||z  d|z  z
  dz   «      }t        dd|z
  «      }| || z
  |z  z   –— |dz  }Œa­w)Nr   é   r   )ÚnumpyÚfloorÚabsr#   )r8   r9   r:   ÚitÚcycleÚxÚrelatives          r   Úcyclic_triangularrD   p   s{   è ø€ à	
€BØ
ä—‘˜A  a¨&¡jÑ 1Ñ1Ó2ˆÜ�I‰I�b˜6‘k A¨¡IÑ-°Ñ1Ó2ˆÜ�q˜!˜a™%“=ˆØ˜ ™¨8Ñ3Ñ3Ò3Ø
ˆa‰ˆð ùs   ‚A%A')rD   r7   r   r   r   r7   r0   r!   )Ú__doc__Útypingr   r=   Úconfigr   Ú	schedulesr   r,   r   r   r   r!   r   r0   r7   rD   Ú__all__r   r%   r   ú<module>rJ      sN  ðÙ Kå ã å ð €×ÑÐ&Ó'ðØ
ðØðØ'/°¡ðàˆe�_òó (ðð €×Ñ�MÓ"ð�5ð ˜X e™_ò ó #ðð €×Ñ�MÓ"Ø9:ò ˜ð  eð °3ð ¸xÈ¹ò ó #ðð  €×ÑÐ$Ó%à>AòØðØðØ).ðØ6;ðàˆe�_òó &ðð&D�ð D˜uð D¨Eð D°eó Dð €×ÑÐ+Ó,ð
 ØØØòØðàðð ð	ð
 ðð ðð ðð ˆe�_òó -ðð. €×ÑÐ&Ó'ðØðØ'*ðØ9<ðàˆe�_òó (ðð$ €×ÑÐ*Ó+ð˜eð ¨Uð ¸Cð ÀHÈUÁOò ó ,ðò	�r%   