piscis.networks.efficientnetv2
==============================

.. py:module:: piscis.networks.efficientnetv2


Attributes
----------

.. autoapisummary::

   piscis.networks.efficientnetv2.ModuleDef
   piscis.networks.efficientnetv2.EfficientNetV2B0
   piscis.networks.efficientnetv2.EfficientNetV2B1
   piscis.networks.efficientnetv2.EfficientNetV2B2
   piscis.networks.efficientnetv2.EfficientNetV2B3
   piscis.networks.efficientnetv2.EfficientNetV2S
   piscis.networks.efficientnetv2.EfficientNetV2M
   piscis.networks.efficientnetv2.EfficientNetV2L


Classes
-------

.. autoapisummary::

   piscis.networks.efficientnetv2.EfficientNetV2


Functions
---------

.. autoapisummary::

   piscis.networks.efficientnetv2.round_features
   piscis.networks.efficientnetv2.round_repeats
   piscis.networks.efficientnetv2.build_efficientnetv2


Module Contents
---------------

.. py:data:: ModuleDef

.. py:function:: round_features(features: int, width_coefficient: float, min_depth: int, depth_divisor: int) -> int

   
   Round the number of features based on the depth multiplier.


   :Parameters:

       **features** : int
           Number of features.

       **width_coefficient** : float
           Scaling coefficient for network width.

       **min_depth** : int
           Minimum number of filters.

       **depth_divisor** : int
           Unit of network width.



   :Returns:

       **new_features** : int
           Rounded number of features.











   ..
       !! processed by numpydoc !!

.. py:function:: round_repeats(repeats: int, depth_coefficient: float) -> int

   
   Round number of repeats based on depth multiplier.


   :Parameters:

       **repeats** : int
           Number of repeats.

       **depth_coefficient** : float
           Scaling coefficient for network depth.



   :Returns:

       **new_repeats** : int
           Rounded number of repeats.











   ..
       !! processed by numpydoc !!

.. py:class:: EfficientNetV2(in_channels: int, stem_stride: int, blocks_args: Sequence, stochastic_depth_prob: float, bn_momentum: float, conv: ModuleDef = nn.Conv2d, bn: ModuleDef = nn.BatchNorm2d, act: ModuleDef = nn.SiLU)

   Bases: :py:obj:`torch.nn.Module`


   
   EfficientNetV2 architecture.


   :Parameters:

       **in_channels** : int
           Number of input channels.

       **stem_stride** : int
           Stride of the stem convolution.

       **blocks_args** : Sequence
           List of arguments to construct block modules.

       **stochastic_depth_prob** : float
           Stochastic depth probability.

       **bn_momentum** : float
           Momentum parameter for batch norm layers.

       **conv** : ModuleDef
           Convolution module.

       **bn** : ModuleDef
           Batch norm module.

       **act** : Callable
           Activation function.














   ..
       !! processed by numpydoc !!

   .. py:attribute:: stem


   .. py:attribute:: blocks


   .. py:attribute:: stage_sizes
      :value: []



   .. py:method:: forward(x: torch.Tensor, capture_list: Optional[Sequence[int]] = None) -> Union[torch.Tensor, Dict[int, torch.Tensor]]


.. py:function:: build_efficientnetv2(blocks_args: Sequence[Dict[str, Any]], width_coefficient: float, depth_coefficient: float, stem_stride: int = 2, stochastic_depth_prob: float = 0.2, bn_momentum: float = 0.1, depth_divisor: int = 8, min_depth: int = 8, conv: ModuleDef = nn.Conv2d, bn: ModuleDef = nn.BatchNorm2d, act: ModuleDef = nn.SiLU) -> functools.partial

   
   Build EfficientNetV2 architecture.


   :Parameters:

       **blocks_args** : Sequence[Dict[str, Any]]
           List of dictionaries of arguments to construct block modules.

       **width_coefficient** : float
           Scaling coefficient for network width.

       **depth_coefficient** : float
           Scaling coefficient for network depth.

       **stem_stride** : int, optional
           Stride of the stem convolution. Default is 2.

       **stochastic_depth_prob** : float, optional
           Stochastic depth probability. Default is 0.2.

       **bn_momentum** : float, optional
           Momentum parameter for batch norm layers. Default is 0.1.

       **depth_divisor** : int, optional
           Unit of network width. Default is 8.

       **min_depth** : int, optional
           Minimum number of filters. Default is 8.

       **conv** : ModuleDef, optional
           Convolution module. Default is nn.Conv2d.

       **bn** : ModuleDef, optional
           Batch norm module. Default is nn.BatchNorm2d.

       **act** : ModuleDef, optional
           Activation function. Default is nn.SiLU.



   :Returns:

       **model** : partial
           EfficientNetV2 architecture.











   ..
       !! processed by numpydoc !!

.. py:data:: EfficientNetV2B0

.. py:data:: EfficientNetV2B1

.. py:data:: EfficientNetV2B2

.. py:data:: EfficientNetV2B3

.. py:data:: EfficientNetV2S

.. py:data:: EfficientNetV2M

.. py:data:: EfficientNetV2L

