o
    ·2úh  ã                   @   s@   d dl mZ d dlmZ d dlmZ edƒG dd„ deƒƒZdS )é    )Úactivations)Úkeras_export)ÚLayerzkeras.layers.Activationc                       s<   e Zd ZdZ‡ fdd„Zdd„ Zdd„ Z‡ fdd	„Z‡  ZS )
Ú
Activationa+  Applies an activation function to an output.

    Args:
        activation: Activation function. It could be a callable, or the name of
            an activation from the `keras.activations` namespace.
        **kwargs: Base layer keyword arguments, such as `name` and `dtype`.

    Example:

    >>> layer = keras.layers.Activation('relu')
    >>> layer(np.array([-3.0, -1.0, 0.0, 2.0]))
    [0.0, 0.0, 0.0, 2.0]
    >>> layer = keras.layers.Activation(keras.activations.relu)
    >>> layer(np.array([-3.0, -1.0, 0.0, 2.0]))
    [0.0, 0.0, 0.0, 2.0]
    c                    s0   t ƒ jdi |¤Ž d| _t |¡| _|  ¡  d S )NT© )ÚsuperÚ__init__Úsupports_maskingr   ÚgetÚ
activationÚ_build_at_init)Úselfr   Úkwargs©Ú	__class__r   úb/var/www/html/chatgem/venv/lib/python3.10/site-packages/keras/src/layers/activations/activation.pyr      s   zActivation.__init__c                 C   s
   |   |¡S ©N)r   )r   Úinputsr   r   r   Úcall    s   
zActivation.callc                 C   s   |S r   r   )r   Úinput_shaper   r   r   Úcompute_output_shape#   s   zActivation.compute_output_shapec                    s&   dt  | j¡i}tƒ  ¡ }i |¥|¥S )Nr   )r   Ú	serializer   r   Ú
get_config)r   ÚconfigÚbase_configr   r   r   r   &   s   
zActivation.get_config)	Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   r   r   r   Ú__classcell__r   r   r   r   r      s    r   N)Ú	keras.srcr   Úkeras.src.api_exportr   Úkeras.src.layers.layerr   r   r   r   r   r   Ú<module>   s
    