o
    )Îj¼  ã                   @   sL   d dl mZ d dlmZ G dd„ deƒZG dd„ deƒZG dd„ deƒZdS )	é    N)Ú	LayerBasec                       ó4   e Zd Z‡ fdd„Zdd„ Zdd„ Zdd„ Z‡  ZS )	ÚRectifiedLinearc                    s"   t t| ƒ ¡  || _t ¡ | _d S ©N)Úsuperr   Ú__init__ÚdimÚnnZReLUÚrelu©ÚselfZ	input_dimZ
output_dim©Ú	__class__© úo/var/www/html/Deteccion_Ine/venv/lib/python3.10/site-packages/modelscope/models/audio/ans/layers/activations.pyr   
   ó   zRectifiedLinear.__init__c                 C   ó
   |   |¡S r   )r
   ©r   Úinputr   r   r   Úforward   ó   
zRectifiedLinear.forwardc                 C   ó   d}|d| j | j f 7 }|S )NÚ z<RectifiedLinear> %d %d
©r   ©r   Zre_strr   r   r   Úto_kaldi_nnet   ó   zRectifiedLinear.to_kaldi_nnetc                 C   ó   |S r   r   ©r   Úinstrr   r   r   Úload_kaldi_nnet   ó   zRectifiedLinear.load_kaldi_nnet©Ú__name__Ú
__module__Ú__qualname__r   r   r   r    Ú__classcell__r   r   r   r   r      ó
    r   c                       r   )	Ú
LogSoftmaxc                    ó"   t t| ƒ ¡  || _t ¡ | _d S r   )r   r(   r   r   r	   Úlsr   r   r   r   r      r   zLogSoftmax.__init__c                 C   r   r   )r*   r   r   r   r   r   "   r   zLogSoftmax.forwardc                 C   r   )Nr   z<Softmax> %d %d
r   r   r   r   r   r   %   r   zLogSoftmax.to_kaldi_nnetc                 C   r   r   r   r   r   r   r   r    *   r!   zLogSoftmax.load_kaldi_nnetr"   r   r   r   r   r(      r'   r(   c                       r   )	ÚSigmoidc                    r)   r   )r   r+   r   r   r	   Úsigr   r   r   r   r   0   r   zSigmoid.__init__c                 C   r   r   )r,   r   r   r   r   r   5   r   zSigmoid.forwardc                 C   r   )Nr   z<Sigmoid> %d %d
r   r   r   r   r   r   8   r   zSigmoid.to_kaldi_nnetc                 C   r   r   r   r   r   r   r   r    =   r!   zSigmoid.load_kaldi_nnetr"   r   r   r   r   r+   .   r'   r+   )Ztorch.nnr	   Z-modelscope.models.audio.ans.layers.layer_baser   r   r(   r+   r   r   r   r   Ú<module>   s
   