piscis.models.spots
===================

.. py:module:: piscis.models.spots


Attributes
----------

.. autoapisummary::

   piscis.models.spots.BLOCK_ARGS


Classes
-------

.. autoapisummary::

   piscis.models.spots.SpotsModel
   piscis.models.spots.Conv2d
   piscis.models.spots.Linear


Functions
---------

.. autoapisummary::

   piscis.models.spots.round_input_size


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

.. py:data:: BLOCK_ARGS

.. py:class:: SpotsModel(in_channels: int = 1, stochastic_depth_prob: float = 0.0, style: bool = True, pooling: str = 'max', kernel_size: Sequence[int] = (3, 3))

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


   
   Spot detection model.


   :Parameters:

       **in_channels** : int, optional
           Number of input channels. Default is 1.

       **style** : bool, optional
           Whether to use style transfer. Default is True.

       **pooling** : str, optional
           Pooling type applied to labels. Supported types are 'max' and 'sum'. Default is 'max'.

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

       **kernel_size** : Sequence[int], optional
           Kernel size or window size of the max pooling operation. Default is (3, 3).














   ..
       !! processed by numpydoc !!

   .. py:attribute:: fpn


   .. py:attribute:: sigmoid


   .. py:attribute:: kernel_size
      :value: (3, 3)



   .. py:method:: forward(x: torch.Tensor, return_style: bool = False) -> Union[Tuple[torch.Tensor, torch.Tensor], Tuple[torch.Tensor, torch.Tensor, torch.Tensor]]


.. py:class:: Conv2d(in_channels: int, out_channels: int, kernel_size: torch.nn.common_types._size_2_t, stride: torch.nn.common_types._size_2_t = 1, padding: Union[str, torch.nn.common_types._size_2_t] = 0, dilation: torch.nn.common_types._size_2_t = 1, groups: int = 1, bias: bool = True, padding_mode: Literal['zeros', 'reflect', 'replicate', 'circular'] = 'zeros', device=None, dtype=None)

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


   
   Base class for all neural network modules.

   Your models should also subclass this class.

   Modules can also contain other Modules, allowing them to be nested in
   a tree structure. You can assign the submodules as regular attributes::

       import torch.nn as nn
       import torch.nn.functional as F

       class Model(nn.Module):
           def __init__(self) -> None:
               super().__init__()
               self.conv1 = nn.Conv2d(1, 20, 5)
               self.conv2 = nn.Conv2d(20, 20, 5)

           def forward(self, x):
               x = F.relu(self.conv1(x))
               return F.relu(self.conv2(x))

   Submodules assigned in this way will be registered, and will also have their
   parameters converted when you call :meth:`to`, etc.

   .. note::
       As per the example above, an ``__init__()`` call to the parent class
       must be made before assignment on the child.

   :ivar training: Boolean represents whether this module is in training or
                   evaluation mode.
   :vartype training: bool















   ..
       !! processed by numpydoc !!

   .. py:method:: reset_parameters() -> None


.. py:class:: Linear(in_features: int, out_features: int, bias: bool = True, device=None, dtype=None)

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


   
   Applies an affine linear transformation to the incoming data: :math:`y = xA^T + b`.

   This module supports :ref:`TensorFloat32<tf32_on_ampere>`.

   On certain ROCm devices, when using float16 inputs this module will use :ref:`different precision<fp16_on_mi200>` for backward.

   Args:
       in_features: size of each input sample
       out_features: size of each output sample
       bias: If set to ``False``, the layer will not learn an additive bias.
           Default: ``True``

   Shape:
       - Input: :math:`(*, H_\text{in})` where :math:`*` means any number of
         dimensions including none and :math:`H_\text{in} = \text{in\_features}`.
       - Output: :math:`(*, H_\text{out})` where all but the last dimension
         are the same shape as the input and :math:`H_\text{out} = \text{out\_features}`.

   Attributes:
       weight: the learnable weights of the module of shape
           :math:`(\text{out\_features}, \text{in\_features})`. The values are
           initialized from :math:`\mathcal{U}(-\sqrt{k}, \sqrt{k})`, where
           :math:`k = \frac{1}{\text{in\_features}}`
       bias:   the learnable bias of the module of shape :math:`(\text{out\_features})`.
               If :attr:`bias` is ``True``, the values are initialized from
               :math:`\mathcal{U}(-\sqrt{k}, \sqrt{k})` where
               :math:`k = \frac{1}{\text{in\_features}}`

   Examples::

       >>> m = nn.Linear(20, 30)
       >>> input = torch.randn(128, 20)
       >>> output = m(input)
       >>> print(output.size())
       torch.Size([128, 30])















   ..
       !! processed by numpydoc !!

   .. py:method:: reset_parameters() -> None

      
      Resets parameters based on their initialization used in ``__init__``.
















      ..
          !! processed by numpydoc !!


.. py:function:: round_input_size(input_size: Tuple[int, int]) -> Tuple[int, int]

   
   Round SpotsModel input size.


   :Parameters:

       **input_size** : Tuple[int, int]
           Input size.



   :Returns:

       **rounded_input_size** : Tuple[int, int]
           Rounded input size.











   ..
       !! processed by numpydoc !!

