Ë
    –\;j‹  ã                   óF   — d dl Z d dl mZ g Z G d„ dej                  «      Zy)é    N)Únnc                   ó*   ‡ — e Zd ZdZdˆ fd„	Zd„ Zˆ xZS )ÚLeNetaœ  LeNet model from
    `"Gradient-based learning applied to document recognition" <https://ieeexplore.ieee.org/document/726791>`_.

    Args:
        num_classes (int, optional): Output dim of last fc layer. If num_classes <= 0, last fc layer
            will not be defined. Default: 10.

    Returns:
        :ref:`api_paddle_nn_Layer`. An instance of LeNet model.

    Examples:
        .. code-block:: python

            >>> import paddle
            >>> from paddle.vision.models import LeNet

            >>> model = LeNet()

            >>> x = paddle.rand([1, 1, 28, 28])
            >>> out = model(x)

            >>> print(out.shape)
            [1, 10]
    c                 ó"  •— t         ‰| �  «        || _        t        j                  t        j
                  ddddd¬«      t        j                  «       t        j                  dd«      t        j
                  ddddd¬«      t        j                  «       t        j                  dd«      «      | _        |dkD  rYt        j                  t        j                  d	d
«      t        j                  d
d«      t        j                  d|«      «      | _
        y y )Né   é   é   )ÚstrideÚpaddingé   é   é   r   i�  éx   éT   )ÚsuperÚ__init__Únum_classesr   Ú
SequentialÚConv2DÚReLUÚ	MaxPool2DÚfeaturesÚLinearÚfc)Úselfr   Ú	__class__s     €úcG:\00. PROJECTS\API\Inventory\templateJSON\kerjaOCR\Lib\site-packages\paddle/vision/models/lenet.pyr   zLeNet.__init__/   sÄ   ø€ Ü‰ÑÔØ&ˆÔÜŸ™Ü�I‰I�a˜˜A a°Ô3Ü�G‰G‹IÜ�L‰L˜˜AÓÜ�I‰I�a˜˜Q q°!Ô4Ü�G‰G‹IÜ�L‰L˜˜AÓó
ˆŒð ˜Š?Ü—m‘mÜ—	‘	˜#˜sÓ#Ü—	‘	˜#˜rÓ"Ü—	‘	˜"˜kÓ*óˆD�Gð ó    c                 ó”   — | j                  |«      }| j                  dkD  r't        j                  |d«      }| j	                  |«      }|S )Nr   r   )r   r   ÚpaddleÚflattenr   )r   ÚinputsÚxs      r   ÚforwardzLeNet.forwardB   s@   € Ø�M‰M˜&Ó!ˆà×Ñ˜aÒÜ—‘˜q !Ó$ˆAØ—‘˜“
ˆAØˆr   )é
   )Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   r$   Ú__classcell__)r   s   @r   r   r      s   ø„ ñõ2ö&r   r   )r    r   Ú__all__ÚLayerr   © r   r   Ú<module>r.      s"   ðó Ý à
€ô3ˆB�H‰Hõ 3r   