§
    ¦˜ºh¥E ã                   ó†  — d Z ddlZddlZddlZddlZddlmZ ddlmZm	Z	 ddl
ZddlmZ ddlmZ ddlmZmZmZmZ dd	lmZmZmZmZ dd
lmZmZmZmZ ddlm Z m!Z!m"Z"m#Z# ddl$m%Z%m&Z&m'Z' ddl(m)Z)m*Z* ddl+m,Z, d„ Z-ddddddddddœ	d„Z. e#dgdgddgddg e"h d£¦  «        g e!eddd¬¦  «        dg e!e	ddd¬¦  «        dgdgddg e!eddd¬¦  «        gedgdgdgdgdœd¬¦  «        dddddddddddddœd „¦   «         Z/dddddddddddd!œd"„Z0	 	 	 	 	 d;d#„Z1d$„ Z2d<d%„Z3	 d=dd&ddddd'dddd(d&dd&d&d&dddd)d*d+œd,„Z4 e#dg e"d(d-h¦  «        gdg e!eddd¬¦  «        gd.œd¬¦  «        d/d0d(ddddddddddd1œd2„¦   «         Z5 G d3„ d4ee¦  «        Z6 G d5„ d6e6e¦  «        Z7 G d7„ d8e6e¦  «        Z8 G d9„ d:e6e¦  «        Z9dS )>z Dictionary learning.
é    N)Úceil)ÚIntegralÚReal)Úeffective_n_jobs)Úlinalgé   )ÚBaseEstimatorÚClassNamePrefixFeaturesOutMixinÚTransformerMixinÚ_fit_context)ÚLarsÚLassoÚ	LassoLarsÚorthogonal_mp_gram)Úcheck_arrayÚcheck_random_stateÚgen_batchesÚgen_even_slices)ÚHiddenÚIntervalÚ
StrOptionsÚvalidate_params)Úrandomized_svdÚ	row_normsÚsvd_flip)ÚParallelÚdelayed)Úcheck_is_fittedc                 óZ   — |r&| dv r$t          d                     | ¦  «        ¦  «        ‚d S d S )N)ÚompÚlarsz9Positive constraint not supported for '{}' coding method.)Ú
ValueErrorÚformat©ÚmethodÚpositives     úl/var/www/html/services/rag-service/venv/lib/python3.11/site-packages/sklearn/decomposition/_dict_learning.pyÚ_check_positive_codingr(      sG   € Øð 
�F˜oÐ-Ð-ÝØG×NÒNÈvÑVÔVñ
ô 
ð 	
ð
ð 
Ð-Ð-ó    Ú
lasso_larsTéè  F©	ÚgramÚcovÚ	algorithmÚregularizationÚcopy_covÚinitÚmax_iterÚverboser&   c       	   
      óê  — | j         \  }}|j         d         }|dk    r�t          |¦  «        |z  }	 t          j        d¬¦  «        }t	          |d|	|d|
|¬¦  «        }|                     |j        | j        |¬¦  «         |j        }t          j        di |¤Ž �nÇ# t          j        di |¤Ž w xY w|dk    r|t          |¦  «        |z  }t          |d||d	|
¬
¦  «        }|�(|j	        d         st          j
        |¦  «        }||_        |                     |j        | j        d¬¦  «         |j        }�n/|dk    rˆ	 t          j        d¬¦  «        }t          d|	|t          |¦  «        d¬¦  «        }|                     |j        | j        |¬¦  «         |j        }t          j        di |¤Ž n·# t          j        di |¤Ž w xY w|dk    r_t          j        |¦  «        t          j        t          j        |¦  «        |z
  d¦  «        z  j        }|
rt          j        |dd|¬¦  «         n<|dk    r6t#          ||t          |¦  «        dt%          | d	¬¦  «        |¬¦  «        j        }|                     ||¦  «        S )a¶	  Generic sparse coding with precomputed Gram and/or covariance matrices.

    Each row of the result is the solution to a Lasso problem.

    Parameters
    ----------
    X : ndarray of shape (n_samples, n_features)
        Data matrix.

    dictionary : ndarray of shape (n_components, n_features)
        The dictionary matrix against which to solve the sparse coding of
        the data. Some of the algorithms assume normalized rows.

    gram : ndarray of shape (n_components, n_components), default=None
        Precomputed Gram matrix, `dictionary * dictionary'`
        gram can be `None` if method is 'threshold'.

    cov : ndarray of shape (n_components, n_samples), default=None
        Precomputed covariance, `dictionary * X'`.

    algorithm : {'lasso_lars', 'lasso_cd', 'lars', 'omp', 'threshold'},             default='lasso_lars'
        The algorithm used:

        * `'lars'`: uses the least angle regression method
          (`linear_model.lars_path`);
        * `'lasso_lars'`: uses Lars to compute the Lasso solution;
        * `'lasso_cd'`: uses the coordinate descent method to compute the
          Lasso solution (`linear_model.Lasso`). lasso_lars will be faster if
          the estimated components are sparse;
        * `'omp'`: uses orthogonal matching pursuit to estimate the sparse
          solution;
        * `'threshold'`: squashes to zero all coefficients less than
          regularization from the projection `dictionary * data'`.

    regularization : int or float, default=None
        The regularization parameter. It corresponds to alpha when
        algorithm is `'lasso_lars'`, `'lasso_cd'` or `'threshold'`.
        Otherwise it corresponds to `n_nonzero_coefs`.

    init : ndarray of shape (n_samples, n_components), default=None
        Initialization value of the sparse code. Only used if
        `algorithm='lasso_cd'`.

    max_iter : int, default=1000
        Maximum number of iterations to perform if `algorithm='lasso_cd'` or
        `'lasso_lars'`.

    copy_cov : bool, default=True
        Whether to copy the precomputed covariance matrix; if `False`, it may
        be overwritten.

    verbose : int, default=0
        Controls the verbosity; the higher, the more messages.

    positive: bool, default=False
        Whether to enforce a positivity constraint on the sparse code.

        .. versionadded:: 0.20

    Returns
    -------
    code : ndarray of shape (n_components, n_features)
        The sparse codes.
    r   r*   Úignore)ÚallF)ÚalphaÚfit_interceptr4   Ú
precomputeÚfit_pathr&   r3   )ÚXyÚlasso_cdT)r8   r9   r:   r3   Ú
warm_startr&   NÚ	WRITEABLE)Úcheck_inputr!   )r9   r4   r:   Ún_nonzero_coefsr;   Ú	threshold©Úoutr    )Úsquared)ÚGramr<   rA   ÚtolÚnorms_squaredÚcopy_Xy© )ÚshapeÚfloatÚnpÚseterrr   ÚfitÚTÚcoef_r   ÚflagsÚarrayr   ÚintÚsignÚmaximumÚabsÚclipr   r   Úreshape)ÚXÚ
dictionaryr-   r.   r/   r0   r1   r2   r3   r4   r&   Ú	n_samplesÚ
n_featuresÚn_componentsr8   Úerr_mgtr*   Únew_codeÚclfr!   s                       r'   Ú_sparse_encode_precomputedrb   &   sÙ  € ð^ œGÑ€IˆzØÔ# AÔ&€Là�LÒ Ð Ý�nÑ%Ô%¨
Ñ2ˆð	!Ý”i HÐ-Ñ-Ô-ˆGõ #ØØ#ØØØØ!Ø!ðñ ô ˆJð �NŠN˜:œ<¨¬°ˆNÑ5Ô5Ð5Ø!Ô'ˆHåŒIÐ Ð ˜Ð Ð Ð Ñ ø�BŒIÐ Ð ˜Ð Ð Ð Ð øøøà	�jÒ	 Ð	 Ý�nÑ%Ô%¨
Ñ2ˆõ
 ØØØØØØð
ñ 
ô 
ˆð Ðð ”:˜kÔ*ð &Ý”x ‘~”~�ØˆCŒIà�Š�
”˜aœc¨uˆÑ5Ô5Ð5Ø”9ˆ‰à	�fÒ	Ð	ð	!Ý”i HÐ-Ñ-Ô-ˆGõ Ø#ØØÝ # NÑ 3Ô 3Øðñ ô ˆDð �HŠH�Z”\ 1¤3¨3ˆHÑ/Ô/Ð/Ø”zˆHåŒIÐ Ð ˜Ð Ð Ð Ð ø�BŒIÐ Ð ˜Ð Ð Ð Ð øøøà	�kÒ	!Ð	!Ý”G˜C‘L”L¥2¤:­b¬f°S©k¬k¸NÑ.JÈAÑ#NÔ#NÑNÔQˆØð 	5ÝŒG�H˜a ¨8Ð4Ñ4Ô4Ð4øà	�eÒ	Ð	Ý%ØØÝ Ñ/Ô/ØÝ# A¨tÐ4Ñ4Ô4Øð
ñ 
ô 
ô ð 	ð ×Ò˜I |Ñ4Ô4Ð4s   ±AB ÂB+Ä7AF( Æ(F;z
array-like>   r    r!   r=   rB   r*   é   Úleft©ÚclosedÚbooleanr4   ©rZ   r[   r-   r.   r/   rA   r8   r1   r2   r3   Ún_jobsr@   r4   r&   ©Úprefer_skip_nested_validation)r-   r.   r/   rA   r8   r1   r2   r3   ri   r@   r4   r&   c                óÚ  — |ru|dk    rQt          |dt          j        t          j        g¬¦  «        }t          | dt          j        t          j        g¬¦  «        } nt          |¦  «        }t          | ¦  «        } |j        d         | j        d         k    r-t          d                     |j        | j        ¦  «        ¦  «        ‚t          ||¦  «         t          | |||||||||	|
||¬¦  «        S )aF  Sparse coding.

    Each row of the result is the solution to a sparse coding problem.
    The goal is to find a sparse array `code` such that::

        X ~= code * dictionary

    Read more in the :ref:`User Guide <SparseCoder>`.

    Parameters
    ----------
    X : array-like of shape (n_samples, n_features)
        Data matrix.

    dictionary : array-like of shape (n_components, n_features)
        The dictionary matrix against which to solve the sparse coding of
        the data. Some of the algorithms assume normalized rows for meaningful
        output.

    gram : array-like of shape (n_components, n_components), default=None
        Precomputed Gram matrix, `dictionary * dictionary'`.

    cov : array-like of shape (n_components, n_samples), default=None
        Precomputed covariance, `dictionary' * X`.

    algorithm : {'lasso_lars', 'lasso_cd', 'lars', 'omp', 'threshold'},             default='lasso_lars'
        The algorithm used:

        * `'lars'`: uses the least angle regression method
          (`linear_model.lars_path`);
        * `'lasso_lars'`: uses Lars to compute the Lasso solution;
        * `'lasso_cd'`: uses the coordinate descent method to compute the
          Lasso solution (`linear_model.Lasso`). lasso_lars will be faster if
          the estimated components are sparse;
        * `'omp'`: uses orthogonal matching pursuit to estimate the sparse
          solution;
        * `'threshold'`: squashes to zero all coefficients less than
          regularization from the projection `dictionary * data'`.

    n_nonzero_coefs : int, default=None
        Number of nonzero coefficients to target in each column of the
        solution. This is only used by `algorithm='lars'` and `algorithm='omp'`
        and is overridden by `alpha` in the `omp` case. If `None`, then
        `n_nonzero_coefs=int(n_features / 10)`.

    alpha : float, default=None
        If `algorithm='lasso_lars'` or `algorithm='lasso_cd'`, `alpha` is the
        penalty applied to the L1 norm.
        If `algorithm='threshold'`, `alpha` is the absolute value of the
        threshold below which coefficients will be squashed to zero.
        If `algorithm='omp'`, `alpha` is the tolerance parameter: the value of
        the reconstruction error targeted. In this case, it overrides
        `n_nonzero_coefs`.
        If `None`, default to 1.

    copy_cov : bool, default=True
        Whether to copy the precomputed covariance matrix; if `False`, it may
        be overwritten.

    init : ndarray of shape (n_samples, n_components), default=None
        Initialization value of the sparse codes. Only used if
        `algorithm='lasso_cd'`.

    max_iter : int, default=1000
        Maximum number of iterations to perform if `algorithm='lasso_cd'` or
        `'lasso_lars'`.

    n_jobs : int, default=None
        Number of parallel jobs to run.
        ``None`` means 1 unless in a :obj:`joblib.parallel_backend` context.
        ``-1`` means using all processors. See :term:`Glossary <n_jobs>`
        for more details.

    check_input : bool, default=True
        If `False`, the input arrays X and dictionary will not be checked.

    verbose : int, default=0
        Controls the verbosity; the higher, the more messages.

    positive : bool, default=False
        Whether to enforce positivity when finding the encoding.

        .. versionadded:: 0.20

    Returns
    -------
    code : ndarray of shape (n_samples, n_components)
        The sparse codes.

    See Also
    --------
    sklearn.linear_model.lars_path : Compute Least Angle Regression or Lasso
        path using LARS algorithm.
    sklearn.linear_model.orthogonal_mp : Solves Orthogonal Matching Pursuit problems.
    sklearn.linear_model.Lasso : Train Linear Model with L1 prior as regularizer.
    SparseCoder : Find a sparse representation of data from a fixed precomputed
        dictionary.
    r=   ÚC)ÚorderÚdtyperc   zRDictionary and X have different numbers of features:dictionary.shape: {} X.shape{}©r-   r.   r/   rA   r8   r1   r2   r3   ri   r4   r&   )	r   rM   Úfloat64Úfloat32rK   r"   r#   r(   Ú_sparse_encoderh   s                 r'   Úsparse_encodert   Í   s	  € ðT ð Ø˜
Ò"Ð"Ý$Ø #­b¬j½"¼*Ð-Eðñ ô ˆJõ ˜A Sµ´½R¼ZÐ0HÐIÑIÔIˆAˆAå$ ZÑ0Ô0ˆJÝ˜A‘”ˆAàÔ˜Ô˜aœg aœjÒ(Ð(Ýð-ß-3ªV°JÔ4DÀaÄgÑ-NÔ-Nñ
ô 
ð 	
õ
 ˜9 hÑ/Ô/Ð/åØ	ØØØØØ'ØØØØØØØðñ ô ð r)   rp   c                óê  ‡ ‡‡‡‡‡‡‡	‡‡‡— ‰ j         \  }}‰j         d         }‰dv r&|Š‰€!t          t          |dz  d¦  «        |¦  «        Šn|Š‰€dŠ‰€ ‰dk    rt          j        ‰‰j        ¦  «        Š‰€"‰dk    rd	Št          j        ‰‰ j        ¦  «        Št          |
¦  «        dk    s‰dk    rt          ‰ ‰‰‰‰‰‰‰‰	‰‰¬
¦  «        }|S ‰ j         d         }‰j         d         }t          j        ||f¦  «        }t          t          |t          |
¦  «        ¦  «        ¦  «        } t          |
‰¬¦  «        ˆ ˆˆˆˆˆˆˆ	ˆˆˆfd„|D ¦   «         ¦  «        }t          ||¦  «        D ]
\  }}|||<   Œ|S )z1Sparse coding without input/parameter validation.r   )r!   r    Né
   rc   g      ð?rB   r=   Fr,   )ri   r4   c              3   ó¤   •K  — | ]J} t          t          ¦  «        ‰|         ‰‰‰�‰d d …|f         nd ‰‰‰‰�‰|         nd ‰	‰‰
¬¦  «        V — ŒKd S )Nr,   )r   rb   )Ú.0Ú
this_slicerZ   r/   r1   r.   r[   r-   r2   r3   r&   r0   r4   s     €€€€€€€€€€€r'   ú	<genexpr>z!_sparse_encode.<locals>.<genexpr>µ  s�   øè è € ð :ð :ð ð 	,�Õ*Ñ+Ô+ØˆjŒMØØØ&) o��A�A�A�z�MÔ"Ð"¸4ØØ)ØØ%)Ð%5��jÔ!Ð!¸4ØØØð	
ñ 	
ô 	
ð:ð :ð :ð :ð :ð :r)   )rK   ÚminÚmaxrM   ÚdotrP   r   rb   ÚemptyÚlistr   r   Úzip)rZ   r[   r-   r.   r/   rA   r8   r1   r2   r3   ri   r4   r&   r\   r]   r^   ÚcodeÚslicesÚ
code_viewsry   Ú	this_viewr0   s   `````  ``` ``        @r'   rs   rs   z  s  øøøøøøøøøøø€ ð$ œGÑ€IˆzØÔ# AÔ&€Là�OÐ#Ð#Ø(ˆØÐ!Ý ¥ Z°"¡_°aÑ!8Ô!8¸,ÑGÔGˆNøàˆØÐ!Ø ˆNà€|˜	 [Ò0Ð0ÝŒv�j *¤,Ñ/Ô/ˆà
€{�y JÒ.Ð.ØˆÝŒf�Z ¤Ñ%Ô%ˆå˜ÑÔ 1Ò$Ð$¨	°[Ò(@Ð(@Ý)ØØØØØØ)ØØØØØð
ñ 
ô 
ˆð ˆð ”˜”
€IØÔ# AÔ&€LÝŒ8�Y Ð-Ñ.Ô.€DÝ•/ )Õ-=¸fÑ-EÔ-EÑFÔFÑGÔG€Fà9• °Ð9Ñ9Ô9ð :ð :ð :ð :ð :ð :ð :ð :ð :ð :ð :ð :ð :ð :ð !ð:ñ :ô :ñ ô €Jõ  "% V¨ZÑ!8Ô!8ð %ð %Ñˆ
�IØ$ˆˆZÑÐØ€Kr)   c           
      óæ  — |j         \  }}	t          |¦  «        }|€
|j        |z  }|€
|j        |z  }d}
t          |	¦  «        D �]}|||f         dk    r2| |xx         |dd…|f         ||         | z  z
  |||f         z  z  cc<   no||                     |¦  «                 }d|                     ¦   «         pdz  }|                     d|t          |¦  «        ¬¦  «        }||z   | |<   d|dd…|f<   |
dz  }
|r$t          j	        | |         dd| |         ¬¦  «         | |xx         t          t          j        | |         ¦  «        d¦  «        z  cc<   �Œ|r|
dk    rt          |
› d�¦  «         dS dS dS )	a¯  Update the dense dictionary factor in place.

    Parameters
    ----------
    dictionary : ndarray of shape (n_components, n_features)
        Value of the dictionary at the previous iteration.

    Y : ndarray of shape (n_samples, n_features)
        Data matrix.

    code : ndarray of shape (n_samples, n_components)
        Sparse coding of the data against which to optimize the dictionary.

    A : ndarray of shape (n_components, n_components), default=None
        Together with `B`, sufficient stats of the online model to update the
        dictionary.

    B : ndarray of shape (n_features, n_components), default=None
        Together with `A`, sufficient stats of the online model to update the
        dictionary.

    verbose: bool, default=False
        Degree of output the procedure will print.

    random_state : int, RandomState instance or None, default=None
        Used for randomly initializing the dictionary. Pass an int for
        reproducible results across multiple function calls.
        See :term:`Glossary <random_state>`.

    positive : bool, default=False
        Whether to enforce positivity when finding the dictionary.

        .. versionadded:: 0.20
    Nr   g�íµ ÷Æ°>g{®Gáz„?rc   )ÚsizerC   z unused atoms resampled.)rK   r   rP   ÚrangeÚchoiceÚstdÚnormalÚlenrM   rX   r|   r   ÚnormÚprint)r[   ÚYr�   ÚAÚBr4   Úrandom_stater&   r\   r^   Ún_unusedÚkÚnewdÚnoise_levelÚnoises                  r'   Ú_update_dictr—   Ê  s¹  € ðX #œjÑ€Iˆ|Ý% lÑ3Ô3€Là€yØŒF�T‰MˆØ€yØŒC�$‰Jˆà€Hå�<Ñ Ô ð <ñ <ˆØˆQ�ˆTŒ7�TŠ>ˆ>à�qˆMˆMŒM˜a    1 œg¨¨!¬¨zÑ(9Ñ9¸Q¸qÀ!¸t¼WÑDÑDˆMˆM‰MˆMð �\×(Ò(¨Ñ3Ô3Ô4ˆDð  $§(¢(¡*¤* /°Ñ2ˆKØ ×'Ò'¨¨;½SÀ¹Y¼YÐ'ÑGÔGˆEà  5™LˆJ�q‰MØˆD����A�‰JØ˜‰MˆHàð 	?ÝŒG�J˜q”M 1 d°
¸1´Ð>Ñ>Ô>Ð>ð 	�1ˆˆŒ��Vœ[¨°A¬Ñ7Ô7¸Ñ;Ô;Ñ;ˆˆ‰‰àð 5�8˜a’<�<Ý�Ð3Ð3Ð3Ñ4Ô4Ð4Ð4Ð4ð5ð 5�<�<r)   c                óÖ  — t          j         ¦   «         }|�|�t          j        |d¬¦  «        }|}nFt          j        | d¬¦  «        \  }}}t          ||¦  «        \  }}|dd…t          j        f         |z  }t          |¦  «        }||k    r|dd…d|…f         }|d|…dd…f         }nnt          j        |t          j	        t          |¦  «        ||z
  f¦  «        f         }t          j
        |t          j	        ||z
  |j        d         f¦  «        f         }t          j        |¦  «        }g }t          j        }|
dk    rt          dd¬	¦  «         d
}t          |¦  «        D �]x}t          j         ¦   «         |z
  }|
dk    r>t           j                             d¦  «         t           j                             ¦   «          n|
rt          d|||dz  |fz  ¦  «         t)          | ||||||||
¬¦	  «	        }t+          || ||
||¬¦  «         dt          j        | ||z  z
  dz  ¦  «        z  |t          j        t          j        |¦  «        ¦  «        z  z   }|                     |¦  «         |dk    rL|d         |d
         z
  }|||d
         z  k     r,|
dk    rt          d¦  «         n|
rt          d|z  ¦  «          n$|dz  dk    r|	� |	t3          ¦   «         ¦  «         �Œz|r	||||dz   fS |||fS )z"Main dictionary learning algorithmNÚF)rn   F)Úfull_matricesrc   ú[dict_learning]ú ©Úendéÿÿÿÿú.zCIteration % 3i (elapsed time: % 3is, % 4.1fmn, current cost % 7.3f)é<   )r/   r8   r2   ri   r&   r3   r4   ©r4   r‘   r&   ç      à?r   r   éþÿÿÿÚ z+--- Convergence reached after %d iterationsé   )ÚtimerM   rS   r   Úsvdr   Únewaxisr‹   Úc_ÚzerosÚr_rK   ÚasfortranarrayÚnanr�   r‡   ÚsysÚstdoutÚwriteÚflushrt   r—   ÚsumrW   ÚappendÚlocals)rZ   r^   r8   r3   rG   r%   ri   Ú	dict_initÚ	code_initÚcallbackr4   r‘   Úreturn_n_iterÚpositive_dictÚpositive_codeÚmethod_max_iterÚt0r�   r[   ÚSÚrÚerrorsÚcurrent_costÚiiÚdtÚdEs                             r'   Ú_dict_learningrÅ     s`  € õ( 
Œ‰Œ€BàÐ Ð!6ÝŒx˜	¨Ð-Ñ-Ô-ˆàˆ
ˆ
å$œj¨¸%Ð@Ñ@Ô@Ñˆˆa�å# D¨*Ñ5Ô5ÑˆˆjØ�q�q�q�"œ*�}Ô%¨
Ñ2ˆ
ÝˆJ‰Œ€AØ�qÒÐØ�A�A�A�}˜�}Ð$Ô%ˆØ   ¨q¨q¨qÐ 0Ô1ˆ
ˆ
åŒu�T�2œ8¥S¨¡Y¤Y°¸qÑ0@Ð$AÑBÔBÐBÔCˆÝ”UØ�œ ,°Ñ"2°JÔ4DÀQÔ4GÐ!HÑIÔIÐIô
ˆ
õ Ô" :Ñ.Ô.€Jà€FÝ”6€Là�!‚|€|ÝÐ SÐ)Ñ)Ô)Ð)ð 
€Bå�H‰oŒoð 3ñ 3ˆÝŒY‰[Œ[˜2ÑˆØ�aŠ<ˆ<ÝŒJ×Ò˜SÑ!Ô!Ð!ÝŒJ×ÒÑÔÐÐØð 	ÝØUØ�r˜2 ™7 LÐ1ñ2ñô ð õ ØØØØØØØ"Ø$Øð

ñ 

ô 

ˆõ 	ØØØØØ%Ø"ð	
ñ 	
ô 	
ð 	
ð �RœV Q¨°
Ñ):Ñ%:¸qÑ$@ÑAÔAÑAÀEÍBÌFÝŒF�4‰LŒLñM
ô M
ñ E
ñ 
ˆð 	�Š�lÑ#Ô#Ð#à�Š6ˆ6Ø˜”˜f RœjÑ(ˆBà�C˜& œ*Ñ$Ò$Ð$Ø˜a’<�<å˜"‘I”I�I�IØð NÝÐGÈ"ÑLÑMÔMÐMØ�Ø�‰6�QŠ;ˆ;˜8Ð/ØˆH•V‘X”XÑÔÐùàð (Ø�Z ¨¨a©Ð/Ð/à�Z Ð'Ð'r)   c                 ój   — | dk    r,d|› d�}|r|d|› �z  }t          j        |t          ¦  «         | S |S )NÚ
deprecatedú'zB' is deprecated in version 1.1 and will be removed in version 1.4.rœ   )ÚwarningsÚwarnÚFutureWarning)ÚparamÚnameÚdefaultÚadditional_messageÚmsgs        r'   Ú_check_warn_deprecatedrÑ   ‹  sZ   € Ø�ÒÐàX�ÐXÐXÐXð 	ð ð 	,ØÐ+Ð)Ð+Ð+Ñ+ˆCÝŒ�c�=Ñ)Ô)Ð)Øˆàˆr)   rÇ   é   r!   çü©ñÒMbP?rv   )r8   Ún_iterr3   Úreturn_coder¶   r¸   Ú
batch_sizer4   Úshuffleri   r%   Úiter_offsetr‘   Úreturn_inner_statsÚinner_statsr¹   rº   r»   r¼   rG   Úmax_no_improvementc                ó,  — ||||f}|�(t          d„ |D ¦   «         ¦  «        st          d¦  «        ‚t          |dd¬¦  «        }t          |ddd	¬
¦  «        }t          |dd¬¦  «        }t          |ddd¬
¦  «        }|�d|z   }t          d;i d|“d|“d|“d|“d|“d|“d|
“d|“d|“d|“d|“d|“d|“d|“d|	“d|“d|“d |“Ž                     | ¦  «        }|s|j        S |                     | ¦  «        }||j        fS t          |dd!d"¬
¦  «        }|€| j        d#         }|d$vrt          d%¦  «        ‚t          ||¦  «         d|z   }t          j	        ¦   «         }| j        \  }}t          |¦  «        }t          |¦  «        }|�|}n/t          | ||¬&¦  «        \  }} }| dd…t          j        f         |z  }t          |¦  «        }!||!k    r|d|…dd…f         }n=t          j        |t          j        ||!z
  |j        d#         f|j        ¬'¦  «        f         }|	d#k    rt'          d(d)¬*¦  «         |
r*|                      ¦   «         }"|                     |"¦  «         n| }"t-          |"d+t          j        t          j        gd¬,¦  «        }"t-          |d-|"j        d¬,¦  «        }t          j        |d.¬/¦  «        }t5          ||¦  «        }#t7          j        |#¦  «        }#|€;t          j        ||f|"j        ¬'¦  «        }$t          j        ||f|"j        ¬'¦  «        }%n4|d                              ¦   «         }$|d#                              ¦   «         }%|d#z
  }&t;          t=          |||z   ¦  «        |#¦  «        D �]u\  }&}'|"|'         }(t          j	        ¦   «         |z
  })|	d#k    r>t>          j          !                    d0¦  «         t>          j          "                    ¦   «          n9|	r7|	d1k    s|&tG          d2|	z  ¦  «        z  dk    rt'          d3|&|)|)d4z  fz  ¦  «         tI          |(||||d|||	¬5¦	  «	        }*|&|d#z
  k     rt          |&d#z   |z  ¦  «        }+nt          |d6z  |&z   d#z   |z
  ¦  «        }+|+d#z   |z
  |+d#z   z  },|$|,z  }$|$t          j%        |*j&        |*¦  «        z  }$|%|,z  }%|%t          j%        |(j&        |*¦  «        z  }%tO          ||(|*|$|%|	||¬7¦  «         |� |tQ          ¦   «         ¦  «         �Œw|r|r||$|%f|&|z
  d#z   fS ||$|%ffS |r‹|	d#k    rt'          d8d)¬*¦  «         n|	d#k    rt'          d9d)¬*¦  «         tI          | ||||d|||	¬5¦	  «	        }|	d#k    r-t          j	        ¦   «         |z
  })t'          d:|)|)d4z  fz  ¦  «         |r|||&|z
  d#z   fS ||fS |r
||&|z
  d#z   fS |S )<a[  Solve a dictionary learning matrix factorization problem online.

    Finds the best dictionary and the corresponding sparse code for
    approximating the data matrix X by solving::

        (U^*, V^*) = argmin 0.5 || X - U V ||_Fro^2 + alpha * || U ||_1,1
                     (U,V)
                     with || V_k ||_2 = 1 for all  0 <= k < n_components

    where V is the dictionary and U is the sparse code. ||.||_Fro stands for
    the Frobenius norm and ||.||_1,1 stands for the entry-wise matrix norm
    which is the sum of the absolute values of all the entries in the matrix.
    This is accomplished by repeatedly iterating over mini-batches by slicing
    the input data.

    Read more in the :ref:`User Guide <DictionaryLearning>`.

    Parameters
    ----------
    X : ndarray of shape (n_samples, n_features)
        Data matrix.

    n_components : int or None, default=2
        Number of dictionary atoms to extract. If None, then ``n_components``
        is set to ``n_features``.

    alpha : float, default=1
        Sparsity controlling parameter.

    n_iter : int, default=100
        Number of mini-batch iterations to perform.

        .. deprecated:: 1.1
           `n_iter` is deprecated in 1.1 and will be removed in 1.4. Use
           `max_iter` instead.

    max_iter : int, default=None
        Maximum number of iterations over the complete dataset before
        stopping independently of any early stopping criterion heuristics.
        If ``max_iter`` is not None, ``n_iter`` is ignored.

        .. versionadded:: 1.1

    return_code : bool, default=True
        Whether to also return the code U or just the dictionary `V`.

    dict_init : ndarray of shape (n_components, n_features), default=None
        Initial values for the dictionary for warm restart scenarios.
        If `None`, the initial values for the dictionary are created
        with an SVD decomposition of the data via
        :func:`~sklearn.utils.extmath.randomized_svd`.

    callback : callable, default=None
        A callable that gets invoked at the end of each iteration.

    batch_size : int, default=256
        The number of samples to take in each batch.

        .. versionchanged:: 1.3
           The default value of `batch_size` changed from 3 to 256 in version 1.3.

    verbose : bool, default=False
        To control the verbosity of the procedure.

    shuffle : bool, default=True
        Whether to shuffle the data before splitting it in batches.

    n_jobs : int, default=None
        Number of parallel jobs to run.
        ``None`` means 1 unless in a :obj:`joblib.parallel_backend` context.
        ``-1`` means using all processors. See :term:`Glossary <n_jobs>`
        for more details.

    method : {'lars', 'cd'}, default='lars'
        * `'lars'`: uses the least angle regression method to solve the lasso
          problem (`linear_model.lars_path`);
        * `'cd'`: uses the coordinate descent method to compute the
          Lasso solution (`linear_model.Lasso`). Lars will be faster if
          the estimated components are sparse.

    iter_offset : int, default=0
        Number of previous iterations completed on the dictionary used for
        initialization.

        .. deprecated:: 1.1
           `iter_offset` serves internal purpose only and will be removed in 1.4.

    random_state : int, RandomState instance or None, default=None
        Used for initializing the dictionary when ``dict_init`` is not
        specified, randomly shuffling the data when ``shuffle`` is set to
        ``True``, and updating the dictionary. Pass an int for reproducible
        results across multiple function calls.
        See :term:`Glossary <random_state>`.

    return_inner_stats : bool, default=False
        Return the inner statistics A (dictionary covariance) and B
        (data approximation). Useful to restart the algorithm in an
        online setting. If `return_inner_stats` is `True`, `return_code` is
        ignored.

        .. deprecated:: 1.1
           `return_inner_stats` serves internal purpose only and will be removed in 1.4.

    inner_stats : tuple of (A, B) ndarrays, default=None
        Inner sufficient statistics that are kept by the algorithm.
        Passing them at initialization is useful in online settings, to
        avoid losing the history of the evolution.
        `A` `(n_components, n_components)` is the dictionary covariance matrix.
        `B` `(n_features, n_components)` is the data approximation matrix.

        .. deprecated:: 1.1
           `inner_stats` serves internal purpose only and will be removed in 1.4.

    return_n_iter : bool, default=False
        Whether or not to return the number of iterations.

        .. deprecated:: 1.1
           `return_n_iter` will be removed in 1.4 and n_iter will never be returned.

    positive_dict : bool, default=False
        Whether to enforce positivity when finding the dictionary.

        .. versionadded:: 0.20

    positive_code : bool, default=False
        Whether to enforce positivity when finding the code.

        .. versionadded:: 0.20

    method_max_iter : int, default=1000
        Maximum number of iterations to perform when solving the lasso problem.

        .. versionadded:: 0.22

    tol : float, default=1e-3
        Control early stopping based on the norm of the differences in the
        dictionary between 2 steps. Used only if `max_iter` is not None.

        To disable early stopping based on changes in the dictionary, set
        `tol` to 0.0.

        .. versionadded:: 1.1

    max_no_improvement : int, default=10
        Control early stopping based on the consecutive number of mini batches
        that does not yield an improvement on the smoothed cost function. Used only if
        `max_iter` is not None.

        To disable convergence detection based on cost function, set
        `max_no_improvement` to None.

        .. versionadded:: 1.1

    Returns
    -------
    code : ndarray of shape (n_samples, n_components),
        The sparse code (only returned if `return_code=True`).

    dictionary : ndarray of shape (n_components, n_features),
        The solutions to the dictionary learning problem.

    n_iter : int
        Number of iterations run. Returned only if `return_n_iter` is
        set to `True`.

    See Also
    --------
    dict_learning : Solve a dictionary learning matrix factorization problem.
    DictionaryLearning : Find a dictionary that sparsely encodes data.
    MiniBatchDictionaryLearning : A faster, less accurate, version of the dictionary
        learning algorithm.
    SparsePCA : Sparse Principal Components Analysis.
    MiniBatchSparsePCA : Mini-batch Sparse Principal Components Analysis.
    Nc              3   ó"   K  — | ]
}|d k    V — ŒdS )rÇ   NrJ   )rx   Úargs     r'   rz   z'dict_learning_online.<locals>.<genexpr>a  s'   è è € Ð'LÐ'LÀ¨¨|Ò(;Ð'LÐ'LÐ'LÐ'LÐ'LÐ'Lr)   zuThe following arguments are incompatible with 'max_iter': return_n_iter, return_inner_stats, iter_offset, inner_statsrØ   r   )rÎ   rÙ   Fz,From 1.4 inner_stats will never be returned.)rÎ   rÏ   rÚ   r¹   z�From 1.4 'n_iter' will never be returned. Refer to the 'n_iter_' and 'n_steps_' attributes of the MiniBatchDictionaryLearning object instead.Úlasso_r^   r8   rÔ   ri   Úfit_algorithmrÖ   r×   r¶   r‘   Útransform_algorithmÚtransform_alphar»   rº   Útransform_max_iterr4   r¸   rG   rÛ   éd   zUse 'max_iter' instead.rc   )r!   Úcdz/Coding method not supported as a fit algorithm.©r‘   ©ro   r›   rœ   r�   rm   ©rn   ro   Úcopyr™   ÚW©Úrequirementsr    rv   ç      Y@z.Iteration % 3i (elapsed time: % 3is, % 4.1fmn)r¡   )r/   r8   ri   r@   r&   r3   r4   r   r¢   zLearning code...ú|z"done (total time: % 3is, % 4.1fmn)rJ   ))r7   r"   rÑ   ÚMiniBatchDictionaryLearningrO   Úcomponents_Ú	transformrK   r(   r§   rL   r   r   rM   r©   r‹   r¬   r«   ro   r�   ré   r×   r   rq   rr   Úrequirer   Ú	itertoolsÚcycler€   r‡   r¯   r°   r±   r²   r   rt   r}   rP   r—   rµ   )-rZ   r^   r8   rÔ   r3   rÕ   r¶   r¸   rÖ   r4   r×   ri   r%   rØ   r‘   rÙ   rÚ   r¹   rº   r»   r¼   rG   rÛ   Údepsrá   Úestr�   r½   r\   r]   r[   Ú_r¾   r¿   ÚX_trainÚbatchesr�   r�   rÂ   ÚbatchÚthis_XrÃ   Ú	this_codeÚthetaÚbetas-                                                r'   Údict_learning_onlinerÿ   ˜  s—  € ðP Ð-¨{¸KÐH€DØÐ¥CÐ'LÐ'LÀtÐ'LÑ'LÔ'LÑ$LÔ$LÐÝðJñ
ô 
ð 	
õ
 )¨°mÈQÐOÑOÔO€KÝ/ØØØØIð	ñ ô Ðõ )¨°mÈTÐRÑRÔR€KÝ*ØØØðWðñ ô €Mð ÐØ&¨Ñ/Ðå)ð 
ð 
ð 
Ø%˜ð
à�%ð
ð �6ð
ð �6ð	
ð
 !˜&ð
ð "�zð
ð �Gð
ð  �ið
ð &˜ð
ð !4Ð 3ð
ð "˜Eð
ð (˜-ð
ð (˜-ð
ð  /˜ð
ð �Gð
ð  �Xð!
ð" �ð#
ð$  2Ð1ð%
÷& Š#ˆa‰&Œ&ð' 	ð* ð 	)Ø”?Ð"à—=’= Ñ#Ô#ˆDØ˜œÐ(Ð(õ
 $Ø� #Ð:Sðñ ô €Fð ÐØ”w˜q”zˆà�^Ð#Ð#ÝÐJÑKÔKÐKå˜6 =Ñ1Ô1Ð1à˜Ñ€Få	Œ‰Œ€BØœGÑ€Iˆzå�%‰LŒL€EÝ% lÑ3Ô3€Lð ÐØˆ
ˆ
å)¨!¨\ÈÐUÑUÔUÑˆˆ1ˆjØ�q�q�q�"œ*�}Ô%¨
Ñ2ˆ
ÝˆJ‰Œ€AØ�qÒÐØ   ¨q¨q¨qÐ 0Ô1ˆ
ˆ
å”UØÝŒH�l QÑ&¨
Ô(8¸Ô(;Ð<ÀJÔDTÐUÑUÔUðWô
ˆ
ð
 �!‚|€|ÝÐ SÐ)Ñ)Ô)Ð)àð Ø—&’&‘(”(ˆØ×Ò˜WÑ%Ô%Ð%Ð%àˆåØ�s¥2¤:­r¬zÐ":Àðñ ô €Gõ ˜Z¨s¸'¼-ÈeÐTÑTÔT€JÝ”˜J°SÐ9Ñ9Ô9€Jå˜) ZÑ0Ô0€GÝŒo˜gÑ&Ô&€Gð ÐÝŒH�l LÐ1¸¼ÐGÑGÔGˆåŒH�j ,Ð/°w´}ÐEÑEÔEˆˆà˜ŒN×ÒÑ!Ô!ˆØ˜ŒN×ÒÑ!Ô!ˆð 
�q‰€Bå�˜{¨K¸&Ñ,@ÑAÔAÀ7ÑKÔKð 3ñ 3‰	ˆˆEØ˜”ˆÝŒY‰[Œ[˜2ÑˆØ�aŠ<ˆ<ÝŒJ×Ò˜SÑ!Ô!Ð!ÝŒJ×ÒÑÔÐÐØð 	Ø˜Š|ˆ|˜r¥D¨°©Ñ$9Ô$9Ñ9¸QÒ>Ð>ÝØDÈÈBÐPRÐUWÑPWÐGXÑXñô ð õ "ØØØØØØØ"Ø$Øð

ñ 

ô 

ˆ	ð �
˜Q‘ÒÐÝ˜2 ™6 ZÑ/Ñ0Ô0ˆEˆEå˜* a™-¨"Ñ,¨qÑ0°:Ñ=Ñ>Ô>ˆEØ˜‘	˜JÑ&¨5°1©9Ñ5ˆà	ˆT‰	ˆØ	�RŒV�I”K Ñ+Ô+Ñ+ˆØ	ˆT‰	ˆØ	�RŒV�F”H˜iÑ(Ô(Ñ(ˆõ 	ØØØØØØØ%Ø"ð		
ñ 		
ô 		
ð 		
ð ÐØˆH•V‘X”XÑÔÐùàð &Øð 	&Ø  1˜v r¨KÑ'7¸!Ñ';Ð;Ð;à  1˜vÐ%Ð%Øð $Ø�QŠ;ˆ;ÝÐ$¨#Ð.Ñ.Ô.Ð.Ð.Ø˜Š\ˆ\Ý�#˜3ÐÑÔÐÝØØØØØØØ"Ø$Øð

ñ 

ô 

ˆð �QŠ;ˆ;Ý”‘”˜rÑ!ˆBÝÐ6¸"¸bÀ2¹g¸ÑFÑGÔGÐGØð 	$Ø˜ R¨+Ñ%5¸Ñ%9Ð9Ð9à˜Ð#Ð#àð Ø˜2 Ñ+¨aÑ/Ð/Ð/àÐr)   rå   )rZ   r%   r¹   r¼   rä   ç:Œ0âŽyE>)r3   rG   r%   ri   r¶   r·   r¸   r4   r‘   r¹   rº   r»   r¼   c                ó²   — t          ||||||||	||
||||¬¦  «        }|                     | ¦  «        }|r||j        |j        |j        fS ||j        |j        fS )a0  Solve a dictionary learning matrix factorization problem.

    Finds the best dictionary and the corresponding sparse code for
    approximating the data matrix X by solving::

        (U^*, V^*) = argmin 0.5 || X - U V ||_Fro^2 + alpha * || U ||_1,1
                     (U,V)
                    with || V_k ||_2 = 1 for all  0 <= k < n_components

    where V is the dictionary and U is the sparse code. ||.||_Fro stands for
    the Frobenius norm and ||.||_1,1 stands for the entry-wise matrix norm
    which is the sum of the absolute values of all the entries in the matrix.

    Read more in the :ref:`User Guide <DictionaryLearning>`.

    Parameters
    ----------
    X : array-like of shape (n_samples, n_features)
        Data matrix.

    n_components : int
        Number of dictionary atoms to extract.

    alpha : int or float
        Sparsity controlling parameter.

    max_iter : int, default=100
        Maximum number of iterations to perform.

    tol : float, default=1e-8
        Tolerance for the stopping condition.

    method : {'lars', 'cd'}, default='lars'
        The method used:

        * `'lars'`: uses the least angle regression method to solve the lasso
           problem (`linear_model.lars_path`);
        * `'cd'`: uses the coordinate descent method to compute the
          Lasso solution (`linear_model.Lasso`). Lars will be faster if
          the estimated components are sparse.

    n_jobs : int, default=None
        Number of parallel jobs to run.
        ``None`` means 1 unless in a :obj:`joblib.parallel_backend` context.
        ``-1`` means using all processors. See :term:`Glossary <n_jobs>`
        for more details.

    dict_init : ndarray of shape (n_components, n_features), default=None
        Initial value for the dictionary for warm restart scenarios. Only used
        if `code_init` and `dict_init` are not None.

    code_init : ndarray of shape (n_samples, n_components), default=None
        Initial value for the sparse code for warm restart scenarios. Only used
        if `code_init` and `dict_init` are not None.

    callback : callable, default=None
        Callable that gets invoked every five iterations.

    verbose : bool, default=False
        To control the verbosity of the procedure.

    random_state : int, RandomState instance or None, default=None
        Used for randomly initializing the dictionary. Pass an int for
        reproducible results across multiple function calls.
        See :term:`Glossary <random_state>`.

    return_n_iter : bool, default=False
        Whether or not to return the number of iterations.

    positive_dict : bool, default=False
        Whether to enforce positivity when finding the dictionary.

        .. versionadded:: 0.20

    positive_code : bool, default=False
        Whether to enforce positivity when finding the code.

        .. versionadded:: 0.20

    method_max_iter : int, default=1000
        Maximum number of iterations to perform.

        .. versionadded:: 0.22

    Returns
    -------
    code : ndarray of shape (n_samples, n_components)
        The sparse code factor in the matrix factorization.

    dictionary : ndarray of shape (n_components, n_features),
        The dictionary factor in the matrix factorization.

    errors : array
        Vector of errors at each iteration.

    n_iter : int
        Number of iterations run. Returned only if `return_n_iter` is
        set to True.

    See Also
    --------
    dict_learning_online : Solve a dictionary learning matrix factorization
        problem online.
    DictionaryLearning : Find a dictionary that sparsely encodes data.
    MiniBatchDictionaryLearning : A faster, less accurate version
        of the dictionary learning algorithm.
    SparsePCA : Sparse Principal Components Analysis.
    MiniBatchSparsePCA : Mini-batch Sparse Principal Components Analysis.
    )r^   r8   r3   rG   rà   ri   r¶   r¸   r·   r4   r‘   r»   rº   rã   )ÚDictionaryLearningÚfit_transformrð   Úerror_Ún_iter_)rZ   r^   r8   r3   rG   r%   ri   r¶   r·   r¸   r4   r‘   r¹   rº   r»   r¼   Ú	estimatorr�   s                     r'   Údict_learningr  6  s”   € õR #Ø!ØØØØØØØØØØ!Ø#Ø#Ø*ðñ ô €Ið  ×"Ò" 1Ñ%Ô%€DØð 
àØÔ!ØÔØÔð	
ð 	
ð �Ô&¨	Ô(8Ð8Ð8r)   c                   ó$   — e Zd ZdZd„ Zd„ Zd„ ZdS )Ú_BaseSparseCodingz>Base class from SparseCoder and DictionaryLearning algorithms.c                 óh   — || _         || _        || _        || _        || _        || _        || _        d S ©N)rá   Útransform_n_nonzero_coefsrâ   rã   Ú
split_signri   r»   )Úselfrá   r  râ   r  ri   r»   rã   s           r'   Ú__init__z_BaseSparseCoding.__init__Ý  s@   € ð $7ˆÔ Ø)BˆÔ&Ø.ˆÔØ"4ˆÔØ$ˆŒØˆŒØ*ˆÔÐÐr)   c           
      ó²  — |                       |d¬¦  «        }t          | d¦  «        r| j        €| j        }n| j        }t	          ||| j        | j        || j        | j        | j	        ¬¦  «        }| j
        rb|j        \  }}t          j        |d|z  f¦  «        }t          j        |d¦  «        |dd…d|…f<   t          j        |d¦  «         |dd…|d…f<   |}|S )zWPrivate method allowing to accommodate both DictionaryLearning and
        SparseCoder.F)Úresetr8   N)r/   rA   r8   r3   ri   r&   r   r   )Ú_validate_dataÚhasattrrâ   r8   rt   rá   r  rã   ri   r»   r  rK   rM   r~   rV   Úminimum)r  rZ   r[   râ   r�   r\   r]   Ú
split_codes           r'   Ú
_transformz_BaseSparseCoding._transformï  s  € ð ×Ò ¨ÐÑ/Ô/ˆå�4˜Ñ!Ô!ð 	3 dÔ&:Ð&BØ"œjˆOˆOà"Ô2ˆOåØØØÔ.Ø Ô:Ø!ØÔ,Ø”;ØÔ'ð	
ñ 	
ô 	
ˆð Œ?ð 	à$(¤JÑ!ˆI�zÝœ 9¨a°*©nÐ"=Ñ>Ô>ˆJÝ)+¬°D¸!Ñ)<Ô)<ˆJ�q�q�q˜+˜:˜+�~Ñ&Ý*,¬*°T¸1Ñ*=Ô*=Ð)=ˆJ�q�q�q˜*˜+˜+�~Ñ&ØˆDàˆr)   c                 óV   — t          | ¦  «         |                      || j        ¦  «        S )aû  Encode the data as a sparse combination of the dictionary atoms.

        Coding method is determined by the object parameter
        `transform_algorithm`.

        Parameters
        ----------
        X : ndarray of shape (n_samples, n_features)
            Test data to be transformed, must have the same number of
            features as the data used to train the model.

        Returns
        -------
        X_new : ndarray of shape (n_samples, n_components)
            Transformed data.
        )r   r  rð   ©r  rZ   s     r'   rñ   z_BaseSparseCoding.transform  s)   € õ" 	˜ÑÔÐØ�Š˜q $Ô"2Ñ3Ô3Ð3r)   N)Ú__name__Ú
__module__Ú__qualname__Ú__doc__r  r  rñ   rJ   r)   r'   r	  r	  Ú  sG   € € € € € ØHÐHð+ð +ð +ð$ð ð ð>4ð 4ð 4ð 4ð 4r)   r	  c                   ó–   ‡ — e Zd ZdZdgZddddddddœˆ fd„
Zdd	„Zdˆ fd
„	Zd„ Ze	d„ ¦   «         Z
e	d„ ¦   «         Ze	d„ ¦   «         Zˆ xZS )ÚSparseCodera  Sparse coding.

    Finds a sparse representation of data against a fixed, precomputed
    dictionary.

    Each row of the result is the solution to a sparse coding problem.
    The goal is to find a sparse array `code` such that::

        X ~= code * dictionary

    Read more in the :ref:`User Guide <SparseCoder>`.

    Parameters
    ----------
    dictionary : ndarray of shape (n_components, n_features)
        The dictionary atoms used for sparse coding. Lines are assumed to be
        normalized to unit norm.

    transform_algorithm : {'lasso_lars', 'lasso_cd', 'lars', 'omp',             'threshold'}, default='omp'
        Algorithm used to transform the data:

        - `'lars'`: uses the least angle regression method
          (`linear_model.lars_path`);
        - `'lasso_lars'`: uses Lars to compute the Lasso solution;
        - `'lasso_cd'`: uses the coordinate descent method to compute the
          Lasso solution (linear_model.Lasso). `'lasso_lars'` will be faster if
          the estimated components are sparse;
        - `'omp'`: uses orthogonal matching pursuit to estimate the sparse
          solution;
        - `'threshold'`: squashes to zero all coefficients less than alpha from
          the projection ``dictionary * X'``.

    transform_n_nonzero_coefs : int, default=None
        Number of nonzero coefficients to target in each column of the
        solution. This is only used by `algorithm='lars'` and `algorithm='omp'`
        and is overridden by `alpha` in the `omp` case. If `None`, then
        `transform_n_nonzero_coefs=int(n_features / 10)`.

    transform_alpha : float, default=None
        If `algorithm='lasso_lars'` or `algorithm='lasso_cd'`, `alpha` is the
        penalty applied to the L1 norm.
        If `algorithm='threshold'`, `alpha` is the absolute value of the
        threshold below which coefficients will be squashed to zero.
        If `algorithm='omp'`, `alpha` is the tolerance parameter: the value of
        the reconstruction error targeted. In this case, it overrides
        `n_nonzero_coefs`.
        If `None`, default to 1.

    split_sign : bool, default=False
        Whether to split the sparse feature vector into the concatenation of
        its negative part and its positive part. This can improve the
        performance of downstream classifiers.

    n_jobs : int, default=None
        Number of parallel jobs to run.
        ``None`` means 1 unless in a :obj:`joblib.parallel_backend` context.
        ``-1`` means using all processors. See :term:`Glossary <n_jobs>`
        for more details.

    positive_code : bool, default=False
        Whether to enforce positivity when finding the code.

        .. versionadded:: 0.20

    transform_max_iter : int, default=1000
        Maximum number of iterations to perform if `algorithm='lasso_cd'` or
        `lasso_lars`.

        .. versionadded:: 0.22

    Attributes
    ----------
    n_components_ : int
        Number of atoms.

    n_features_in_ : int
        Number of features seen during :term:`fit`.

        .. versionadded:: 0.24

    feature_names_in_ : ndarray of shape (`n_features_in_`,)
        Names of features seen during :term:`fit`. Defined only when `X`
        has feature names that are all strings.

        .. versionadded:: 1.0

    See Also
    --------
    DictionaryLearning : Find a dictionary that sparsely encodes data.
    MiniBatchDictionaryLearning : A faster, less accurate, version of the
        dictionary learning algorithm.
    MiniBatchSparsePCA : Mini-batch Sparse Principal Components Analysis.
    SparsePCA : Sparse Principal Components Analysis.
    sparse_encode : Sparse coding where each row of the result is the solution
        to a sparse coding problem.

    Examples
    --------
    >>> import numpy as np
    >>> from sklearn.decomposition import SparseCoder
    >>> X = np.array([[-1, -1, -1], [0, 0, 3]])
    >>> dictionary = np.array(
    ...     [[0, 1, 0],
    ...      [-1, -1, 2],
    ...      [1, 1, 1],
    ...      [0, 1, 1],
    ...      [0, 2, 1]],
    ...    dtype=np.float64
    ... )
    >>> coder = SparseCoder(
    ...     dictionary=dictionary, transform_algorithm='lasso_lars',
    ...     transform_alpha=1e-10,
    ... )
    >>> coder.transform(X)
    array([[ 0.,  0., -1.,  0.,  0.],
           [ 0.,  1.,  1.,  0.,  0.]])
    r[   r    NFr+   )rá   r  râ   r  ri   r»   rã   c          	      ód   •— t          ¦   «                              |||||||¦  «         || _        d S r  )Úsuperr  r[   )
r  r[   rá   r  râ   r  ri   r»   rã   Ú	__class__s
            €r'   r  zSparseCoder.__init__�  sC   ø€ õ 	‰Œ×ÒØØ%ØØØØØñ	
ô 	
ð 	
ð %ˆŒˆˆr)   c                 ó   — | S )aÌ  Do nothing and return the estimator unchanged.

        This method is just there to implement the usual API and hence
        work in pipelines.

        Parameters
        ----------
        X : Ignored
            Not used, present for API consistency by convention.

        y : Ignored
            Not used, present for API consistency by convention.

        Returns
        -------
        self : object
            Returns the instance itself.
        rJ   ©r  rZ   Úys      r'   rO   zSparseCoder.fit´  s	   € ð& ˆr)   c                 óR   •— t          ¦   «                              || j        ¦  «        S )aQ  Encode the data as a sparse combination of the dictionary atoms.

        Coding method is determined by the object parameter
        `transform_algorithm`.

        Parameters
        ----------
        X : ndarray of shape (n_samples, n_features)
            Training vector, where `n_samples` is the number of samples
            and `n_features` is the number of features.

        y : Ignored
            Not used, present for API consistency by convention.

        Returns
        -------
        X_new : ndarray of shape (n_samples, n_components)
            Transformed data.
        )r   r  r[   )r  rZ   r$  r!  s      €r'   rñ   zSparseCoder.transformÉ  s!   ø€ õ( ‰wŒw×!Ò! ! T¤_Ñ5Ô5Ð5r)   c                 ó8   — dt           j        t           j        gdœS )NF)Úrequires_fitÚpreserves_dtype©rM   rq   rr   ©r  s    r'   Ú
_more_tagszSparseCoder._more_tagsß  s    € à!Ý "¤
­B¬JÐ7ð
ð 
ð 	
r)   c                 ó&   — | j         j        d         S )zNumber of atoms.r   ©r[   rK   r*  s    r'   Ún_components_zSparseCoder.n_components_å  ó   € ð ŒÔ$ QÔ'Ð'r)   c                 ó&   — | j         j        d         S )z%Number of features seen during `fit`.rc   r-  r*  s    r'   Ún_features_in_zSparseCoder.n_features_in_ê  r/  r)   c                 ó   — | j         S )ú&Number of transformed output features.)r.  r*  s    r'   Ú_n_features_outzSparseCoder._n_features_outï  s   € ð Ô!Ð!r)   r  )r  r  r  r  Ú_required_parametersr  rO   rñ   r+  Úpropertyr.  r1  r4  Ú__classcell__©r!  s   @r'   r  r  #  s  ø€ € € € € ðuð uðn )˜>Ðð "Ø"&ØØØØØð%ð %ð %ð %ð %ð %ð %ð.ð ð ð ð*6ð 6ð 6ð 6ð 6ð 6ð,
ð 
ð 
ð ð(ð (ñ „Xð(ð ð(ð (ñ „Xð(ð ð"ð "ñ „Xð"ð "ð "ð "ð "r)   r  c                   óB  ‡ — e Zd ZU dZi d eeddd¬¦  «        dg“d eeddd¬¦  «        g“d	 eeddd¬¦  «        g“d
 eeddd¬¦  «        g“d eddh¦  «        g“d eh d£¦  «        g“d eeddd¬¦  «        dg“d eeddd¬¦  «        dg“dedg“dej	        dg“dej	        dg“de
dg“ddg“ddg“ddg“ddg“ddg“d eeddd¬¦  «        gi¥Zeed<   	 d*ddddd ddddddd!d!dd!d!dd"œˆ fd#„Zd*d$„Z ed%¬&¦  «        d*d'„¦   «         Zed(„ ¦   «         Zd)„ Zˆ xZS )+r  aà  Dictionary learning.

    Finds a dictionary (a set of atoms) that performs well at sparsely
    encoding the fitted data.

    Solves the optimization problem::

        (U^*,V^*) = argmin 0.5 || X - U V ||_Fro^2 + alpha * || U ||_1,1
                    (U,V)
                    with || V_k ||_2 <= 1 for all  0 <= k < n_components

    ||.||_Fro stands for the Frobenius norm and ||.||_1,1 stands for
    the entry-wise matrix norm which is the sum of the absolute values
    of all the entries in the matrix.

    Read more in the :ref:`User Guide <DictionaryLearning>`.

    Parameters
    ----------
    n_components : int, default=None
        Number of dictionary elements to extract. If None, then ``n_components``
        is set to ``n_features``.

    alpha : float, default=1.0
        Sparsity controlling parameter.

    max_iter : int, default=1000
        Maximum number of iterations to perform.

    tol : float, default=1e-8
        Tolerance for numerical error.

    fit_algorithm : {'lars', 'cd'}, default='lars'
        * `'lars'`: uses the least angle regression method to solve the lasso
          problem (:func:`~sklearn.linear_model.lars_path`);
        * `'cd'`: uses the coordinate descent method to compute the
          Lasso solution (:class:`~sklearn.linear_model.Lasso`). Lars will be
          faster if the estimated components are sparse.

        .. versionadded:: 0.17
           *cd* coordinate descent method to improve speed.

    transform_algorithm : {'lasso_lars', 'lasso_cd', 'lars', 'omp',             'threshold'}, default='omp'
        Algorithm used to transform the data:

        - `'lars'`: uses the least angle regression method
          (:func:`~sklearn.linear_model.lars_path`);
        - `'lasso_lars'`: uses Lars to compute the Lasso solution.
        - `'lasso_cd'`: uses the coordinate descent method to compute the
          Lasso solution (:class:`~sklearn.linear_model.Lasso`). `'lasso_lars'`
          will be faster if the estimated components are sparse.
        - `'omp'`: uses orthogonal matching pursuit to estimate the sparse
          solution.
        - `'threshold'`: squashes to zero all coefficients less than alpha from
          the projection ``dictionary * X'``.

        .. versionadded:: 0.17
           *lasso_cd* coordinate descent method to improve speed.

    transform_n_nonzero_coefs : int, default=None
        Number of nonzero coefficients to target in each column of the
        solution. This is only used by `algorithm='lars'` and
        `algorithm='omp'`. If `None`, then
        `transform_n_nonzero_coefs=int(n_features / 10)`.

    transform_alpha : float, default=None
        If `algorithm='lasso_lars'` or `algorithm='lasso_cd'`, `alpha` is the
        penalty applied to the L1 norm.
        If `algorithm='threshold'`, `alpha` is the absolute value of the
        threshold below which coefficients will be squashed to zero.
        If `None`, defaults to `alpha`.

        .. versionchanged:: 1.2
            When None, default value changed from 1.0 to `alpha`.

    n_jobs : int or None, default=None
        Number of parallel jobs to run.
        ``None`` means 1 unless in a :obj:`joblib.parallel_backend` context.
        ``-1`` means using all processors. See :term:`Glossary <n_jobs>`
        for more details.

    code_init : ndarray of shape (n_samples, n_components), default=None
        Initial value for the code, for warm restart. Only used if `code_init`
        and `dict_init` are not None.

    dict_init : ndarray of shape (n_components, n_features), default=None
        Initial values for the dictionary, for warm restart. Only used if
        `code_init` and `dict_init` are not None.

    callback : callable, default=None
        Callable that gets invoked every five iterations.

        .. versionadded:: 1.3

    verbose : bool, default=False
        To control the verbosity of the procedure.

    split_sign : bool, default=False
        Whether to split the sparse feature vector into the concatenation of
        its negative part and its positive part. This can improve the
        performance of downstream classifiers.

    random_state : int, RandomState instance or None, default=None
        Used for initializing the dictionary when ``dict_init`` is not
        specified, randomly shuffling the data when ``shuffle`` is set to
        ``True``, and updating the dictionary. Pass an int for reproducible
        results across multiple function calls.
        See :term:`Glossary <random_state>`.

    positive_code : bool, default=False
        Whether to enforce positivity when finding the code.

        .. versionadded:: 0.20

    positive_dict : bool, default=False
        Whether to enforce positivity when finding the dictionary.

        .. versionadded:: 0.20

    transform_max_iter : int, default=1000
        Maximum number of iterations to perform if `algorithm='lasso_cd'` or
        `'lasso_lars'`.

        .. versionadded:: 0.22

    Attributes
    ----------
    components_ : ndarray of shape (n_components, n_features)
        dictionary atoms extracted from the data

    error_ : array
        vector of errors at each iteration

    n_features_in_ : int
        Number of features seen during :term:`fit`.

        .. versionadded:: 0.24

    feature_names_in_ : ndarray of shape (`n_features_in_`,)
        Names of features seen during :term:`fit`. Defined only when `X`
        has feature names that are all strings.

        .. versionadded:: 1.0

    n_iter_ : int
        Number of iterations run.

    See Also
    --------
    MiniBatchDictionaryLearning: A faster, less accurate, version of the
        dictionary learning algorithm.
    MiniBatchSparsePCA : Mini-batch Sparse Principal Components Analysis.
    SparseCoder : Find a sparse representation of data from a fixed,
        precomputed dictionary.
    SparsePCA : Sparse Principal Components Analysis.

    References
    ----------

    J. Mairal, F. Bach, J. Ponce, G. Sapiro, 2009: Online dictionary learning
    for sparse coding (https://www.di.ens.fr/sierra/pdfs/icml09.pdf)

    Examples
    --------
    >>> import numpy as np
    >>> from sklearn.datasets import make_sparse_coded_signal
    >>> from sklearn.decomposition import DictionaryLearning
    >>> X, dictionary, code = make_sparse_coded_signal(
    ...     n_samples=30, n_components=15, n_features=20, n_nonzero_coefs=10,
    ...     random_state=42,
    ... )
    >>> dict_learner = DictionaryLearning(
    ...     n_components=15, transform_algorithm='lasso_lars', transform_alpha=0.1,
    ...     random_state=42,
    ... )
    >>> X_transformed = dict_learner.fit(X).transform(X)

    We can check the level of sparsity of `X_transformed`:

    >>> np.mean(X_transformed == 0)
    0.52...

    We can compare the average squared euclidean norm of the reconstruction
    error of the sparse coded signal relative to the squared euclidean norm of
    the original signal:

    >>> X_hat = X_transformed @ dict_learner.components_
    >>> np.mean(np.sum((X_hat - X) ** 2, axis=1) / np.sum(X ** 2, axis=1))
    0.05...
    r^   rc   Nrd   re   r8   r   r3   rG   rà   r!   rå   rá   >   r    r!   r=   rB   r*   r  râ   ri   r·   r¶   r¸   r4   r  rg   r‘   r»   rº   rã   Ú_parameter_constraintsr+   r   r    F)r8   r3   rG   rà   rá   r  râ   ri   r·   r¶   r¸   r4   r  r‘   r»   rº   rã   c          	      óð   •— t          ¦   «                              |||||	||¦  «         || _        || _        || _        || _        || _        |
| _        || _        || _	        || _
        || _        || _        d S r  )r   r  r^   r8   r3   rG   rà   r·   r¶   r¸   r4   r‘   rº   )r  r^   r8   r3   rG   rà   rá   r  râ   ri   r·   r¶   r¸   r4   r  r‘   r»   rº   rã   r!  s                      €r'   r  zDictionaryLearning.__init__Í  s�   ø€ õ, 	‰Œ×ÒØØ%ØØØØØñ	
ô 	
ð 	
ð )ˆÔØˆŒ
Ø ˆŒØˆŒØ*ˆÔØ"ˆŒØ"ˆŒØ ˆŒØˆŒØ(ˆÔØ*ˆÔÐÐr)   c                 ó0   — |                       |¦  «         | S )á»  Fit the model from data in X.

        Parameters
        ----------
        X : array-like of shape (n_samples, n_features)
            Training vector, where `n_samples` is the number of samples
            and `n_features` is the number of features.

        y : Ignored
            Not used, present for API consistency by convention.

        Returns
        -------
        self : object
            Returns the instance itself.
        )r  r#  s      r'   rO   zDictionaryLearning.fitø  s   € ð" 	×Ò˜1ÑÔÐØˆr)   Trj   c                 ó¶  — t          | j        | j        ¬¦  «         d| j        z   }t          | j        ¦  «        }|                      |¦  «        }| j        €|j        d         }n| j        }t          ||| j	        | j
        | j        || j        | j        | j        | j        | j        | j        |d| j        | j        ¬¦  «        \  }}}| _        || _        || _        |S )añ  Fit the model from data in X and return the transformed data.

        Parameters
        ----------
        X : array-like of shape (n_samples, n_features)
            Training vector, where `n_samples` is the number of samples
            and `n_features` is the number of features.

        y : Ignored
            Not used, present for API consistency by convention.

        Returns
        -------
        V : ndarray of shape (n_samples, n_components)
            Transformed data.
        r$   rß   Nrc   T)r8   rG   r3   r%   r¼   ri   r·   r¶   r¸   r4   r‘   r¹   rº   r»   )r(   rà   r»   r   r‘   r  r^   rK   rÅ   r8   rG   r3   rã   ri   r·   r¶   r¸   r4   rº   r  rð   r  )	r  rZ   r$  r%   r‘   r^   ÚVÚUÚEs	            r'   r  z DictionaryLearning.fit_transform  sé   € õ$ 	 dÔ&8À4ÔCUÐVÑVÔVÐVà˜DÔ.Ñ.ˆå)¨$Ô*;Ñ<Ô<ˆØ×Ò Ñ"Ô"ˆàÔÐ$Øœ7 1œ:ˆLˆLàÔ,ˆLå .ØØØ”*Ø”Ø”]ØØ Ô3Ø”;Ø”nØ”nØ”]Ø”LØ%ØØÔ,ØÔ,ð!!
ñ !
ô !
Ñˆˆ1ˆa�”ð$ ˆÔØˆŒàˆr)   c                 ó&   — | j         j        d         S ©r3  r   ©rð   rK   r*  s    r'   r4  z"DictionaryLearning._n_features_outA  ó   € ð ÔÔ% aÔ(Ð(r)   c                 ó6   — dt           j        t           j        giS ©Nr(  r)  r*  s    r'   r+  zDictionaryLearning._more_tagsF  ó   € à¥¤
­B¬JÐ7ð
ð 	
r)   r  )r  r  r  r  r   r   r   r   rM   ÚndarrayÚcallabler:  ÚdictÚ__annotations__r  rO   r   r  r6  r4  r+  r7  r8  s   @r'   r  r  õ  sÜ  ø€ € € € € € ð~ð ~ð@$Ø˜˜ (¨A¨t¸FÐCÑCÔCÀTÐJð$à�(�(˜4  D°Ð8Ñ8Ô8Ð9ð$ð 	�X�X˜h¨¨4¸Ð?Ñ?Ô?Ð@ð$ð 	��˜˜q $¨vÐ6Ñ6Ô6Ð7ð	$ð
 	˜*˜* f¨d ^Ñ4Ô4Ð5ð$ð 	ØˆJÐMÐMÐMÑNÔNð 
ð$ð 	$ h h¨x¸¸DÈÐ&PÑ&PÔ&PÐRVÐ%Wð$ð 	˜H˜H T¨1¨d¸6ÐBÑBÔBÀDÐIð$ð 	�8˜TÐ"ð$ð 	�b”j $Ð'ð$ð 	�b”j $Ð'ð$ð 	�X˜tÐ$ð$ð 	�I�;ð$ð  	�y�kð!$ð" 	˜Ð(ð#$ð$ 	˜)˜ð%$ð& 	˜)˜ð'$ð( 	˜x˜x¨°!°TÀ&ÐIÑIÔIÐJð)$ð $Ð˜Dð ð ñ ð2 ð)+ð ØØØØ!Ø"&ØØØØØØØØØØØð))+ð )+ð )+ð )+ð )+ð )+ð )+ðVð ð ð ð( €\°Ð5Ñ5Ô5ð2ð 2ð 2ñ 6Ô5ð2ðh ð)ð )ñ „Xð)ð
ð 
ð 
ð 
ð 
ð 
ð 
r)   r  c                   ó  ‡ — e Zd ZU dZi d eeddd¬¦  «        dg“d eeddd¬¦  «        g“d	 eeddd¬¦  «         e ed
h¦  «        ¦  «        g“d eeddd¬¦  «        dg“d eddh¦  «        g“ddeg“d eeddd¬¦  «        g“ddg“dde	j
        g“d eh d£¦  «        g“d eeddd¬¦  «        dg“d eeddd¬¦  «        dg“ddg“ddg“ddg“ddg“ddg“ eeddd¬¦  «        gdeg eeddd¬¦  «        g eeddd¬¦  «        dgdœ¥Zeed<   	 d2dd
ddddd dd!ddd"d"dd"d"d#dd$d%d&œˆ fd'„Zd(„ Zd)„ Zd*„ Zd+„ Zd,„ Z ed ¬-¦  «        d2d.„¦   «         Z ed ¬-¦  «        d2d/„¦   «         Zed0„ ¦   «         Zd1„ Zˆ xZS )3rï   a'  Mini-batch dictionary learning.

    Finds a dictionary (a set of atoms) that performs well at sparsely
    encoding the fitted data.

    Solves the optimization problem::

       (U^*,V^*) = argmin 0.5 || X - U V ||_Fro^2 + alpha * || U ||_1,1
                    (U,V)
                    with || V_k ||_2 <= 1 for all  0 <= k < n_components

    ||.||_Fro stands for the Frobenius norm and ||.||_1,1 stands for
    the entry-wise matrix norm which is the sum of the absolute values
    of all the entries in the matrix.

    Read more in the :ref:`User Guide <DictionaryLearning>`.

    Parameters
    ----------
    n_components : int, default=None
        Number of dictionary elements to extract.

    alpha : float, default=1
        Sparsity controlling parameter.

    n_iter : int, default=1000
        Total number of iterations over data batches to perform.

        .. deprecated:: 1.1
           ``n_iter`` is deprecated in 1.1 and will be removed in 1.4. Use
           ``max_iter`` instead.

    max_iter : int, default=None
        Maximum number of iterations over the complete dataset before
        stopping independently of any early stopping criterion heuristics.
        If ``max_iter`` is not None, ``n_iter`` is ignored.

        .. versionadded:: 1.1

    fit_algorithm : {'lars', 'cd'}, default='lars'
        The algorithm used:

        - `'lars'`: uses the least angle regression method to solve the lasso
          problem (`linear_model.lars_path`)
        - `'cd'`: uses the coordinate descent method to compute the
          Lasso solution (`linear_model.Lasso`). Lars will be faster if
          the estimated components are sparse.

    n_jobs : int, default=None
        Number of parallel jobs to run.
        ``None`` means 1 unless in a :obj:`joblib.parallel_backend` context.
        ``-1`` means using all processors. See :term:`Glossary <n_jobs>`
        for more details.

    batch_size : int, default=256
        Number of samples in each mini-batch.

        .. versionchanged:: 1.3
           The default value of `batch_size` changed from 3 to 256 in version 1.3.

    shuffle : bool, default=True
        Whether to shuffle the samples before forming batches.

    dict_init : ndarray of shape (n_components, n_features), default=None
        Initial value of the dictionary for warm restart scenarios.

    transform_algorithm : {'lasso_lars', 'lasso_cd', 'lars', 'omp',             'threshold'}, default='omp'
        Algorithm used to transform the data:

        - `'lars'`: uses the least angle regression method
          (`linear_model.lars_path`);
        - `'lasso_lars'`: uses Lars to compute the Lasso solution.
        - `'lasso_cd'`: uses the coordinate descent method to compute the
          Lasso solution (`linear_model.Lasso`). `'lasso_lars'` will be faster
          if the estimated components are sparse.
        - `'omp'`: uses orthogonal matching pursuit to estimate the sparse
          solution.
        - `'threshold'`: squashes to zero all coefficients less than alpha from
          the projection ``dictionary * X'``.

    transform_n_nonzero_coefs : int, default=None
        Number of nonzero coefficients to target in each column of the
        solution. This is only used by `algorithm='lars'` and
        `algorithm='omp'`. If `None`, then
        `transform_n_nonzero_coefs=int(n_features / 10)`.

    transform_alpha : float, default=None
        If `algorithm='lasso_lars'` or `algorithm='lasso_cd'`, `alpha` is the
        penalty applied to the L1 norm.
        If `algorithm='threshold'`, `alpha` is the absolute value of the
        threshold below which coefficients will be squashed to zero.
        If `None`, defaults to `alpha`.

        .. versionchanged:: 1.2
            When None, default value changed from 1.0 to `alpha`.

    verbose : bool or int, default=False
        To control the verbosity of the procedure.

    split_sign : bool, default=False
        Whether to split the sparse feature vector into the concatenation of
        its negative part and its positive part. This can improve the
        performance of downstream classifiers.

    random_state : int, RandomState instance or None, default=None
        Used for initializing the dictionary when ``dict_init`` is not
        specified, randomly shuffling the data when ``shuffle`` is set to
        ``True``, and updating the dictionary. Pass an int for reproducible
        results across multiple function calls.
        See :term:`Glossary <random_state>`.

    positive_code : bool, default=False
        Whether to enforce positivity when finding the code.

        .. versionadded:: 0.20

    positive_dict : bool, default=False
        Whether to enforce positivity when finding the dictionary.

        .. versionadded:: 0.20

    transform_max_iter : int, default=1000
        Maximum number of iterations to perform if `algorithm='lasso_cd'` or
        `'lasso_lars'`.

        .. versionadded:: 0.22

    callback : callable, default=None
        A callable that gets invoked at the end of each iteration.

        .. versionadded:: 1.1

    tol : float, default=1e-3
        Control early stopping based on the norm of the differences in the
        dictionary between 2 steps. Used only if `max_iter` is not None.

        To disable early stopping based on changes in the dictionary, set
        `tol` to 0.0.

        .. versionadded:: 1.1

    max_no_improvement : int, default=10
        Control early stopping based on the consecutive number of mini batches
        that does not yield an improvement on the smoothed cost function. Used only if
        `max_iter` is not None.

        To disable convergence detection based on cost function, set
        `max_no_improvement` to None.

        .. versionadded:: 1.1

    Attributes
    ----------
    components_ : ndarray of shape (n_components, n_features)
        Components extracted from the data.

    n_features_in_ : int
        Number of features seen during :term:`fit`.

        .. versionadded:: 0.24

    feature_names_in_ : ndarray of shape (`n_features_in_`,)
        Names of features seen during :term:`fit`. Defined only when `X`
        has feature names that are all strings.

        .. versionadded:: 1.0

    n_iter_ : int
        Number of iterations over the full dataset.

    n_steps_ : int
        Number of mini-batches processed.

        .. versionadded:: 1.1

    See Also
    --------
    DictionaryLearning : Find a dictionary that sparsely encodes data.
    MiniBatchSparsePCA : Mini-batch Sparse Principal Components Analysis.
    SparseCoder : Find a sparse representation of data from a fixed,
        precomputed dictionary.
    SparsePCA : Sparse Principal Components Analysis.

    References
    ----------

    J. Mairal, F. Bach, J. Ponce, G. Sapiro, 2009: Online dictionary learning
    for sparse coding (https://www.di.ens.fr/sierra/pdfs/icml09.pdf)

    Examples
    --------
    >>> import numpy as np
    >>> from sklearn.datasets import make_sparse_coded_signal
    >>> from sklearn.decomposition import MiniBatchDictionaryLearning
    >>> X, dictionary, code = make_sparse_coded_signal(
    ...     n_samples=30, n_components=15, n_features=20, n_nonzero_coefs=10,
    ...     random_state=42)
    >>> dict_learner = MiniBatchDictionaryLearning(
    ...     n_components=15, batch_size=3, transform_algorithm='lasso_lars',
    ...     transform_alpha=0.1, max_iter=20, random_state=42)
    >>> X_transformed = dict_learner.fit_transform(X)

    We can check the level of sparsity of `X_transformed`:

    >>> np.mean(X_transformed == 0) > 0.5
    True

    We can compare the average squared euclidean norm of the reconstruction
    error of the sparse coded signal relative to the squared euclidean norm of
    the original signal:

    >>> X_hat = X_transformed @ dict_learner.components_
    >>> np.mean(np.sum((X_hat - X) ** 2, axis=1) / np.sum(X ** 2, axis=1))
    0.052...
    r^   rc   Nrd   re   r8   r   rÔ   rÇ   r3   rà   rå   r!   ri   rÖ   r×   rg   r¶   rá   >   r    r!   r=   rB   r*   r  râ   r4   r  r‘   r»   rº   )rã   r¸   rG   rÛ   r:  rÒ   Tr    Fr+   rÓ   rv   )r8   rÔ   r3   rà   ri   rÖ   r×   r¶   rá   r  râ   r4   r  r‘   r»   rº   rã   r¸   rG   rÛ   c          	      ó(  •— t          ¦   «                              |
||||||¦  «         || _        || _        || _        || _        || _        |	| _        || _        || _	        || _
        || _        || _        || _        || _        || _        || _        d S r  )r   r  r^   r8   rÔ   r3   rà   r¶   r4   r×   rÖ   r  r‘   rº   r¸   rÛ   rG   )r  r^   r8   rÔ   r3   rà   ri   rÖ   r×   r¶   rá   r  râ   r4   r  r‘   r»   rº   rã   r¸   rG   rÛ   r!  s                         €r'   r  z$MiniBatchDictionaryLearning.__init__C  sª   ø€ õ2 	‰Œ×ÒØØ%ØØØØØñ	
ô 	
ð 	
ð )ˆÔØˆŒ
ØˆŒØ ˆŒØ*ˆÔØ"ˆŒØˆŒØˆŒØ$ˆŒØ$ˆŒØ(ˆÔØ*ˆÔØ ˆŒØ"4ˆÔØˆŒˆˆr)   c                 óì   — | j         | _        | j        €|j        d         | _        t          | j        | j        ¦  «         d| j        z   | _        t          | j        |j        d         ¦  «        | _	        d S )Nrc   rß   r   )
r^   Ú_n_componentsrK   r(   rà   r»   Ú_fit_algorithmr{   rÖ   Ú_batch_sizer  s     r'   Ú_check_paramsz)MiniBatchDictionaryLearning._check_paramsu  sn   € à!Ô.ˆÔØÔÐ%Ø!"¤¨¤ˆDÔõ 	˜tÔ1°4Ô3EÑFÔFÐFØ&¨Ô);Ñ;ˆÔõ ˜tœ°´¸´
Ñ;Ô;ˆÔÐÐr)   c           	      óâ  — | j         �| j         }n4t          || j        |¬¦  «        \  }}}|dd…t          j        f         |z  }| j        t          |¦  «        k    r|d| j        …dd…f         }nQt          j        |t          j        | j        t          |¦  «        z
  |j        d         f|j	        ¬¦  «        f¦  «        }t          |d|j	        d¬¦  «        }t          j        |d¬	¦  «        }|S )
z!Initialization of the dictionary.Nræ   rc   rç   r™   Frè   rê   rë   )r¶   r   rP  rM   r©   r‹   Úconcatenater«   rK   ro   r   rò   )r  rZ   r‘   r[   r÷   r¾   s         r'   Ú_initialize_dictz,MiniBatchDictionaryLearning._initialize_dict‚  s  € àŒ>Ð%ØœˆJˆJõ  .Ø�4Ô%°Lð ñ  ô  ÑˆAˆq�*ð ˜1˜1˜1�bœj˜=Ô)¨JÑ6ˆJàÔ¥ Z¡¤Ò0Ð0Ø#Ð$8 dÔ&8Ð$8¸!¸!¸!Ð$;Ô<ˆJˆJåœàÝ”HØÔ+­c°*©o¬oÑ=¸zÔ?OÐPQÔ?RÐSØ(Ô.ðñ ô ðñô ˆJõ ! °3¸a¼gÈEÐRÑRÔRˆ
Ý”Z 
¸Ð=Ñ=Ô=ˆ
àÐr)   c                 ó  — ||dz
  k     r	|dz   |z  }n|dz  |z   dz   |z
  }|dz   |z
  |dz   z  }| xj         |z  c_         | xj         |j        |z  |z  z  c_         | xj        |z  c_        | xj        |j        |z  |z  z  c_        dS )zUpdate the inner stats inplace.rc   r   N)Ú_ArP   Ú_B)r  rZ   r�   rÖ   Ústeprý   rþ   s          r'   Ú_update_inner_statsz/MiniBatchDictionaryLearning._update_inner_statsŸ  s¨   € à�*˜q‘.Ò Ð Ø˜A‘X Ñ+ˆEˆEà ‘M DÑ(¨1Ñ,¨zÑ9ˆEØ˜‘	˜JÑ&¨5°1©9Ñ5ˆàˆŒ�4‰ˆŒØˆŒ�4”6˜D‘= :Ñ-Ñ-ˆŒØˆŒ�4‰ˆŒØˆŒ�1”3˜‘: 
Ñ*Ñ*ˆŒˆˆr)   c           
      ó´  — |j         d         }t          ||| j        | j        | j        | j        | j        | j        ¬¦  «        }d|||z  z
  dz                       ¦   «         z  | j        t          j        t          j
        |¦  «        ¦  «        z  z   |z  }|                      ||||¦  «         t          |||| j        | j        | j        || j        ¬¦  «         |S )z7Perform the update on the dictionary for one minibatch.r   )r/   r8   ri   r&   r3   r4   r£   r   r¢   )rK   rs   rQ  r8   ri   r»   rã   r4   r³   rM   rW   r[  r—   rX  rY  rº   )r  rZ   r[   r‘   rZ  rÖ   r�   Ú
batch_costs           r'   Ú_minibatch_stepz+MiniBatchDictionaryLearning._minibatch_step¬  sø   € à”W˜Q”Zˆ
õ ØØØÔ)Ø”*Ø”;ØÔ'ØÔ,Ø”Lð	
ñ 	
ô 	
ˆð �A˜˜zÑ)Ñ)¨aÑ/×4Ò4Ñ6Ô6Ñ6ØŒj�2œ6¥"¤&¨¡,¤,Ñ/Ô/Ñ/ñ0àñˆ
ð 	× Ò   D¨*°dÑ;Ô;Ð;õ 	ØØØØŒGØŒGØ”LØ%ØÔ'ð		
ñ 		
ô 		
ð 		
ð Ðr)   c           
      óì  — |j         d         }|dz   }|t          d||z  ¦  «        k    r!| j        rt          d|› d|› d|› �¦  «         dS | j        €|| _        n0||dz   z  }	t          |	d¦  «        }	| j        d|	z
  z  ||	z  z   | _        | j        r t          d|› d|› d|› d	| j        › �¦  «         t          j        ||z
  ¦  «        | j        z  }
| j        dk    r)|
| j        k    r| j        rt          d
|› d|› �¦  «         dS | j	        �| j        | j	        k     rd| _
        | j        | _	        n| xj
        dz  c_
        | j        �.| j
        | j        k    r| j        rt          d|› d|› �¦  «         dS dS )aÃ  Helper function to encapsulate the early stopping logic.

        Early stopping is based on two factors:
        - A small change of the dictionary between two minibatch updates. This is
          controlled by the tol parameter.
        - No more improvement on a smoothed estimate of the objective function for a
          a certain number of consecutive minibatch updates. This is controlled by
          the max_no_improvement parameter.
        r   rc   rä   zMinibatch step ú/z: mean batch cost: FNz, ewa cost: z,Converged (small dictionary change) at step Tz>Converged (lack of improvement in objective function) at step )rK   r{   r4   r�   Ú	_ewa_costr   rŒ   rP  rG   Ú_ewa_cost_minÚ_no_improvementrÛ   )r  rZ   r]  Únew_dictÚold_dictr\   rZ  Ún_stepsrÖ   r8   Ú	dict_diffs              r'   Ú_check_convergencez.MiniBatchDictionaryLearning._check_convergenceÒ  s  € ð ”W˜Q”Zˆ
ð �a‰xˆð •3�s˜I¨
Ñ2Ñ3Ô3Ò3Ð3ØŒ|ð YÝÐW¨ÐWÐW¨wÐWÐWÈ:ÐWÐWÑXÔXÐXØ�5ð
 Œ>Ð!Ø'ˆDŒNˆNà )¨a¡-Ñ0ˆEÝ˜˜q‘M”MˆEØ!œ^¨q°5©yÑ9¸JÈÑ<NÑNˆDŒNàŒ<ð 	Ýð< $ð <ð <¨ð <ð <Øð<ð <Ø+/¬>ð<ð <ñô ð õ ”K ¨8Ñ 3Ñ4Ô4°tÔ7IÑIˆ	ØŒ8�aŠ<ˆ<˜I¨¬Ò1Ð1ØŒ|ð WÝÐUÀTÐUÐUÈGÐUÐUÑVÔVÐVØ�4ð ÔÐ%¨¬¸$Ô:LÒ)LÐ)LØ#$ˆDÔ Ø!%¤ˆDÔÐàÐ Ô  AÑ%Ð Ô ð Ô#Ð/ØÔ$¨Ô(?Ò?Ð?àŒ|ð Ýð0Ø#ð0ð 0Ø&-ð0ð 0ñô ð ð �4àˆur)   rj   c           
      óÄ  — |                       |t          j        t          j        gdd¬¦  «        }|                      |¦  «         | j        dk    r!t          j        dt          ¦  «         | j        }t          | j
        ¦  «        | _        |                      || j        ¦  «        }|                     ¦   «         }| j        r/|                     ¦   «         }| j                             |¦  «         n|}|j        \  }}| j        rt#          d¦  «         t          j        | j        | j        f|j        ¬¦  «        | _        t          j        || j        f|j        ¬¦  «        | _        | j        ��4d| _        d| _        d	| _        t7          || j        ¦  «        }	t;          j        |	¦  «        }	t?          t          j         || j        z  ¦  «        ¦  «        }
| j        |
z  }d
}tC          tE          |¦  «        |	¦  «        D ]v\  }}||         }|  #                    ||| j        |¦  «        }|  $                    |||||||¦  «        r n0| j%        �!|  %                    tM          ¦   «         ¦  «         ||dd…<   Œw|dz   | _'        t          j         | j'        |
z  ¦  «        | _(        �n9| j        dk    rdn| j        }t7          || j        ¦  «        }	t;          j        |	¦  «        }	tC          tE          |¦  «        |	¦  «        D ]”\  }}|  #                    ||         || j        |¦  «         | j        o|tA          d| j        z  ¦  «        z  d	k    }| j        dk    s|rt#          |› d�¦  «         | j%        �!|  %                    tM          ¦   «         ¦  «         Œ•|| _'        t          j         |t?          t          j         || j        z  ¦  «        ¦  «        z  ¦  «        | _(        || _)        | S )r=  rm   F)ro   rn   ré   rÇ   z¼'n_iter' is deprecated in version 1.1 and will be removed in version 1.4. Use 'max_iter' and let 'n_iter' to its default value instead. 'n_iter' is also ignored if 'max_iter' is specified.r›   rç   Nr   rŸ   rc   r+   rí   rv   z batches processed.)*r  rM   rq   rr   rS  rÔ   rÉ   rÊ   rË   r   r‘   Ú_random_staterV  ré   r×   rK   r4   r�   r«   rP  ro   rX  rY  r3   ra  rb  rc  r   rR  ró   rô   rT   r   r€   r‡   r^  rh  r¸   rµ   Ún_steps_r  rð   )r  rZ   r$  rÔ   r[   re  rø   r\   r]   rù   Ún_steps_per_iterrf  Úirú   ÚX_batchr]  Útrigger_verboses                    r'   rO   zMiniBatchDictionaryLearning.fit	  sÒ  € ð$ ×ÒØ•b”j¥"¤*Ð-°S¸uð  ñ 
ô 
ˆð 	×Ò˜1ÑÔÐàŒ;˜,Ò&Ð&ÝŒMð!õ
 ñô ð ð ”[ˆFå/°Ô0AÑBÔBˆÔà×*Ò*¨1¨dÔ.@ÑAÔAˆ
Ø—?’?Ñ$Ô$ˆàŒ<ð 	Ø—f’f‘h”hˆGØÔ×&Ò& wÑ/Ô/Ð/Ð/àˆGà '¤Ñˆ	�:àŒ<ð 	%ÝÐ#Ñ$Ô$Ð$õ ”(ØÔ Ô!3Ð4¸G¼Mð
ñ 
ô 
ˆŒõ ”(˜J¨Ô(:Ð;À7Ä=ÐQÑQÔQˆŒàŒ=Ñ$à!ˆDŒNØ!%ˆDÔØ#$ˆDÔ å! )¨TÔ-=Ñ>Ô>ˆGÝ”o gÑ.Ô.ˆGÝ"¥2¤7¨9°tÔ7GÑ+GÑ#HÔ#HÑIÔIÐØ”mÐ&6Ñ6ˆGàˆAå¥ g¡¤°Ñ8Ô8ð )ð )‘��5Ø! %œ.�à!×1Ò1Ø˜Z¨Ô);¸Qñô �
ð ×*Ò*Ø˜Z¨°X¸yÈ!ÈWñô ð ð �Eð ”=Ð,Ø—M’M¥&¡(¤(Ñ+Ô+Ð+à(�˜˜˜‘�à ™EˆDŒMÝœ7 4¤=Ð3CÑ#CÑDÔDˆDŒL‰Lð "œ[¨LÒ8Ð8�T�T¸d¼kˆFå! )¨TÔ-=Ñ>Ô>ˆGÝ”o gÑ.Ô.ˆGå¥ f¡¤¨wÑ7Ô7ð ,ð ,‘��5Ø×$Ò$ W¨U¤^°ZÀÔASÐUVÑWÔWÐWà"&¤,Ð"V°1µt¸EÀDÄLÑ<PÑ7QÔ7QÑ3QÐUVÒ3V�Ø”< "Ò$Ð$¨Ð$Ý˜QÐ3Ð3Ð3Ñ4Ô4Ð4à”=Ð,Ø—M’M¥&¡(¤(Ñ+Ô+Ð+øà"ˆDŒMÝœ7 6­Cµ´¸	ÀDÔDTÑ8TÑ0UÔ0UÑ,VÔ,VÑ#VÑWÔWˆDŒLà%ˆÔàˆr)   c                 óh  — t          | d¦  «        }|                      |t          j        t          j        gd| ¬¦  «        }|s¯|                      |¦  «         t          | j        ¦  «        | _        |  	                    || j        ¦  «        }d| _
        t          j        | j        | j        f|j        ¬¦  «        | _        t          j        |j        d         | j        f|j        ¬¦  «        | _        n| j        }|                      ||| j        | j
        ¦  «         || _        | xj
        dz  c_
        | S )aÒ  Update the model using the data in X as a mini-batch.

        Parameters
        ----------
        X : array-like of shape (n_samples, n_features)
            Training vector, where `n_samples` is the number of samples
            and `n_features` is the number of features.

        y : Ignored
            Not used, present for API consistency by convention.

        Returns
        -------
        self : object
            Return the instance itself.
        rð   rm   )ro   rn   r  r   rç   rc   )r  r  rM   rq   rr   rS  r   r‘   rj  rV  rk  r«   rP  ro   rX  rK   rY  rð   r^  )r  rZ   r$  Úhas_componentsr[   s        r'   Úpartial_fitz'MiniBatchDictionaryLearning.partial_fitŠ	  s!  € õ$ !  }Ñ5Ô5ˆà×ÒØ•b”j¥"¤*Ð-°SÀNÐ@Rð  ñ 
ô 
ˆð ð 	*à×Ò˜qÑ!Ô!Ð!Ý!3°DÔ4EÑ!FÔ!FˆDÔà×.Ò.¨q°$Ô2DÑEÔEˆJàˆDŒMå”h Ô 2°DÔ4FÐGÈqÌwÐWÑWÔWˆDŒGÝ”h ¤¨¤
¨DÔ,>Ð?ÀqÄwÐOÑOÔOˆDŒGˆGàÔ)ˆJà×Ò˜Q 
¨DÔ,>ÀÄÑNÔNÐNà%ˆÔØˆŒ˜ÑˆŒàˆr)   c                 ó&   — | j         j        d         S rC  rD  r*  s    r'   r4  z+MiniBatchDictionaryLearning._n_features_out·	  rE  r)   c                 ó6   — dt           j        t           j        giS rG  r)  r*  s    r'   r+  z&MiniBatchDictionaryLearning._more_tags¼	  rH  r)   r  )r  r  r  r  r   r   r   r   r   rM   rI  rJ  r:  rK  rL  r  rS  rV  r[  r^  rh  r   rO   rr  r6  r4  r+  r7  r8  s   @r'   rï   rï   L  s½  ø€ € € € € € ðWð Wðr$Ø˜˜ (¨A¨t¸FÐCÑCÔCÀTÐJð$à�(�(˜4  D°Ð8Ñ8Ô8Ð9ð$ð 	ØˆH�X˜q $¨vÐ6Ñ6Ô6ØˆF�:�:˜|˜nÑ-Ô-Ñ.Ô.ð
ð$ð 	�X�X˜h¨¨4¸Ð?Ñ?Ô?ÀÐFð$ð 	˜*˜* d¨F ^Ñ4Ô4Ð5ð$ð 	�4˜Ð"ð$ð 	�x�x ¨!¨T¸&ÐAÑAÔAÐBð$ð 	�I�;ð$ð 	�d˜BœJÐ'ð$ð 	ØˆJÐMÐMÐMÑNÔNð 
ð$ð  	$ h h¨x¸¸DÈÐ&PÑ&PÔ&PÐRVÐ%Wð!$ð" 	˜H˜H T¨1¨d¸6ÐBÑBÔBÀDÐIð#$ð$ 	�I�;ð%$ð& 	�y�kð'$ð( 	˜Ð(ð)$ð* 	˜)˜ð+$ð, 	˜)˜ð-$ð.  (˜x¨°!°TÀ&ÐIÑIÔIÐJØ˜8Ð$Ø�˜˜q $¨vÐ6Ñ6Ô6Ð7Ø'˜x¨°!°TÀ&ÐIÑIÔIÈ4ÐPð5$ð $ð $Ð˜Dð ð ñ ð> ð0ð ØØØØØØØØ!Ø"&ØØØØØØØØØØð/0ð 0ð 0ð 0ð 0ð 0ð 0ðd<ð <ð <ðð ð ð:+ð +ð +ð$ð $ð $ðLBð Bð BðH €\°Ð5Ñ5Ô5ðqð qð qñ 6Ô5ðqðf €\°Ð5Ñ5Ô5ð*ð *ð *ñ 6Ô5ð*ðX ð)ð )ñ „Xð)ð
ð 
ð 
ð 
ð 
ð 
ð 
r)   rï   )NNFNFr  )r   ):r  ró   r¯   r§   rÉ   Úmathr   Únumbersr   r   ÚnumpyrM   Újoblibr   Úscipyr   Úbaser	   r
   r   r   Úlinear_modelr   r   r   r   Úutilsr   r   r   r   Úutils._param_validationr   r   r   r   Úutils.extmathr   r   r   Úutils.parallelr   r   Úutils.validationr   r(   rb   rt   rs   r—   rÅ   rÑ   rÿ   r  r	  r  r  rï   rJ   r)   r'   ú<module>r�     s|  ððð ð
 Ð Ð Ð Ø 
€
€
€
Ø €€€Ø €€€Ø Ð Ð Ð Ð Ð Ø "Ð "Ð "Ð "Ð "Ð "Ð "Ð "à Ð Ð Ð Ø #Ð #Ð #Ð #Ð #Ð #Ø Ð Ð Ð Ð Ð ðð ð ð ð ð ð ð ð ð ð ð ð FÐ EÐ EÐ EÐ EÐ EÐ EÐ EÐ EÐ EÐ EÐ EØ QÐ QÐ QÐ QÐ QÐ QÐ QÐ QÐ QÐ QÐ QÐ QØ SÐ SÐ SÐ SÐ SÐ SÐ SÐ SÐ SÐ SÐ SÐ SØ ?Ð ?Ð ?Ð ?Ð ?Ð ?Ð ?Ð ?Ð ?Ð ?Ø .Ð .Ð .Ð .Ð .Ð .Ð .Ð .Ø .Ð .Ð .Ð .Ð .Ð .ð
ð 
ð 
ð 
ØØØØØ	ØØØðd5ð d5ð d5ð d5ð d5ðN €àˆ^Ø#�nØ˜tÐ$Ø˜dÐ#àˆJÐMÐMÐMÑNÔNð
ð %˜H X¨q°$¸vÐFÑFÔFÈÐMØ�(˜4  D°Ð8Ñ8Ô8¸$Ð?Ø�KØ˜tÐ$Ø�X˜h¨¨4¸Ð?Ñ?Ô?Ð@Ø˜TÐ"Ø!�{Ø�;Ø�Kð!ð ð$ #'ð'ñ ô ð4 
ØØØØ
ØØ	ØØØØØðTð Tð Tð Tñ-ô ð,Tðv 
ØØØØ
ØØ	ØØØØðMð Mð Mð Mð Mðh Ø
ØØØðM5ð M5ð M5ð M5ð`n(ð n(ð n(ðb
ð 
ð 
ð 
ð ð[ð ØØØØØØØØØØØØØ#ØØØØØØØð1[ð [ð [ð [ð [ð| €àˆ^Ø�:˜v t˜nÑ-Ô-Ð.Ø#˜Ø$˜H X¨q°$¸vÐFÑFÔFÐGð	ð ð #(ðñ ô ð ØØØØØØØØØØØØð#X9ð X9ð X9ð X9ñô ðX9ðvF4ð F4ð F4ð F4ð F4Ð7Ð9Iñ F4ô F4ð F4ðRO"ð O"ð O"ð O"ð O"Ð# ]ñ O"ô O"ð O"ðdT
ð T
ð T
ð T
ð T
Ð*¨Mñ T
ô T
ð T
ðn
s	
ð s	
ð s	
ð s	
ð s	
Ð"3°]ñ s	
ô s	
ð s	
ð s	
ð s	
r)   