brails.processors.nfloors_detector.lib.efficientnet.model module
- class brails.processors.nfloors_detector.lib.efficientnet.model.EfficientNet(blocks_args=None, global_params=None)
Bases:
Module
An EfficientNet model. Most easily loaded with the .from_name or .from_pretrained methods
- Args:
blocks_args (list): A list of BlockArgs to construct blocks global_params (namedtuple): A set of GlobalParams shared between blocks
- Example:
model = EfficientNet.from_pretrained(‘efficientnet-b0’)
- extract_features(inputs)
Returns output of the final convolution layer
- forward(inputs)
Calls extract_features to extract features, applies final linear layer, and returns logits.
- classmethod from_name(model_name, override_params=None)
- classmethod from_pretrained(model_name, load_weights=True, advprop=False, num_classes=1000, in_channels=3)
- classmethod get_image_size(model_name)
- set_swish(memory_efficient=True)
Sets swish function as memory efficient (for training) or standard (for export)
- class brails.processors.nfloors_detector.lib.efficientnet.model.MBConvBlock(block_args, global_params)
Bases:
Module
Mobile Inverted Residual Bottleneck Block
- Args:
block_args (namedtuple): BlockArgs, see above global_params (namedtuple): GlobalParam, see above
- Attributes:
has_se (bool): Whether the block contains a Squeeze and Excitation layer.
- forward(inputs, drop_connect_rate=None)
- Parameters:
inputs – input tensor
drop_connect_rate – drop connect rate (float, between 0 and 1)
- Returns:
output of block
- set_swish(memory_efficient=True)
Sets swish function as memory efficient (for training) or standard (for export)