direct.nn.mobilenet package#
Submodules#
direct.nn.mobilenet.config module#
- class direct.nn.mobilenet.config.MobileNetV2Config(model_name='???', engine_name=None, num_channels=2, num_classes=1000, width_mult=1.0, inverted_residual_setting=None, round_nearest=8, norm_layer=None)[source]#
Bases:
ModelConfig- num_channels = 2#
- num_classes = 1000#
- width_mult = 1.0#
- inverted_residual_setting = None#
- round_nearest = 8#
- norm_layer = None#
- __init__(model_name='???', engine_name=None, num_channels=2, num_classes=1000, width_mult=1.0, inverted_residual_setting=None, round_nearest=8, norm_layer=None)#
direct.nn.mobilenet.mobilenet module#
- class direct.nn.mobilenet.mobilenet.MobileNetV2(num_channels=2, num_classes=1000, width_mult=1.0, inverted_residual_setting=None, round_nearest=8, block=None, norm_layer=None)[source]#
Bases:
Module- __init__(num_channels=2, num_classes=1000, width_mult=1.0, inverted_residual_setting=None, round_nearest=8, block=None, norm_layer=None)[source]#
MobileNet V2 main class.
- Parameters:
num_channels – Number of channels. Default:
2.num_classes – Number of classes. Default:
1000.width_mult – Width multiplier - adjusts number of channels in each layer by this amount. Default:
1.0.inverted_residual_setting – Network structure. Default:
None.round_nearest – Round the number of channels in each layer to be a multiple of this number. Set to
1to turn off rounding. Default:8.block – Module specifying inverted residual building block for mobilenet. Default:
None.norm_layer (
Callable[...,Any]) – Module specifying the normalization layer to use. Default:None.
- forward(x)[source]#
Define 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
Moduleinstance afterwards instead of this since the former takes care of running the registered hooks while the latter silently ignores them.