claf.modules.conv package¶
Submodules¶
-
class
claf.modules.conv.depthwise_separable_conv.
DepSepConv
(input_size=None, num_filters=None, kernel_size=None)[source]¶ Bases:
torch.nn.modules.module.Module
- Depthwise Separable Convolutions
in Xception: Deep Learning with Depthwise Separable Convolutions (https://arxiv.org/abs/1610.02357)
depthwise -> pointwise (1x1 conv)
- Args:
input_size: the number of input tensor’s dimension num_filters: the number of convolution filter kernel_size: the number of convolution kernel size
-
forward
(x)[source]¶ Defines the computation performed at every call.
Should be overridden by all subclasses.
Note
Although the recipe for forward pass needs to be defined within this function, one should call the
Module
instance afterwards instead of this since the former takes care of running the registered hooks while the latter silently ignores them.
-
class
claf.modules.conv.pointwise_conv.
PointwiseConv
(input_size, num_filters)[source]¶ Bases:
torch.nn.modules.module.Module
Pointwise Convolution (1x1 Conv)
Convolution 1 Dimension (Faster version) (cf. https://github.com/huggingface/pytorch-openai-transformer-lm/blob/ eafc28abdfadfa0732f03a0fc65805c5bfb2ffe7/model_pytorch.py#L45)
- Args:
input_size: the number of input tensor’s dimension num_filters: the number of convolution filter
-
forward
(x)[source]¶ Defines the computation performed at every call.
Should be overridden by all subclasses.
Note
Although the recipe for forward pass needs to be defined within this function, one should call the
Module
instance afterwards instead of this since the former takes care of running the registered hooks while the latter silently ignores them.
Module contents¶
-
class
claf.modules.conv.
DepSepConv
(input_size=None, num_filters=None, kernel_size=None)[source]¶ Bases:
torch.nn.modules.module.Module
- Depthwise Separable Convolutions
in Xception: Deep Learning with Depthwise Separable Convolutions (https://arxiv.org/abs/1610.02357)
depthwise -> pointwise (1x1 conv)
- Args:
input_size: the number of input tensor’s dimension num_filters: the number of convolution filter kernel_size: the number of convolution kernel size
-
forward
(x)[source]¶ Defines the computation performed at every call.
Should be overridden by all subclasses.
Note
Although the recipe for forward pass needs to be defined within this function, one should call the
Module
instance afterwards instead of this since the former takes care of running the registered hooks while the latter silently ignores them.
-
class
claf.modules.conv.
PointwiseConv
(input_size, num_filters)[source]¶ Bases:
torch.nn.modules.module.Module
Pointwise Convolution (1x1 Conv)
Convolution 1 Dimension (Faster version) (cf. https://github.com/huggingface/pytorch-openai-transformer-lm/blob/ eafc28abdfadfa0732f03a0fc65805c5bfb2ffe7/model_pytorch.py#L45)
- Args:
input_size: the number of input tensor’s dimension num_filters: the number of convolution filter
-
forward
(x)[source]¶ Defines the computation performed at every call.
Should be overridden by all subclasses.
Note
Although the recipe for forward pass needs to be defined within this function, one should call the
Module
instance afterwards instead of this since the former takes care of running the registered hooks while the latter silently ignores them.