fovi.arch.knnconvnextv2
- class fovi.arch.knnconvnextv2.GRN(dim)[source]
Bases:
ModuleGRN (Global Response Normalization) layer.
- Parameters:
dim (int) – Number of input channels.
- 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.
- class fovi.arch.knnconvnextv2.LayerNorm(normalized_shape, eps=1e-6, data_format='channels_last')[source]
Bases:
ModuleLayerNorm that supports two data formats: channels_last (default) or channels_first.
The ordering of the dimensions in the inputs. channels_last corresponds to inputs with shape (batch_size, locations, channels) while channels_first corresponds to inputs with shape (batch_size, channels, locations).
- Parameters:
- __init__(normalized_shape, eps=1e-6, data_format='channels_last')[source]
Initialize internal Module state, shared by both nn.Module and ScriptModule.
- 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.
- class fovi.arch.knnconvnextv2.Block(dim, coords, drop_path=0., **kwargs)[source]
Bases:
ModuleConvNeXtV2 Block.
- Parameters:
- Returns:
Output tensor with same shape as input.
- Return type:
- __init__(dim, coords, drop_path=0., **kwargs)[source]
Initialize internal Module state, shared by both nn.Module and ScriptModule.
- 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.
- class fovi.arch.knnconvnextv2.ConvNeXtV2(in_res, fov, cmf_a, style, auto_match_cart_resources=1, device='cuda', in_chans=3, num_classes=1000, first_stride=4, depths=[3, 3, 9, 3], dims=[96, 192, 384, 768], drop_path_rate=0., head_init_scale=1., **kwargs)[source]
Bases:
ModuleConvNeXt V2.
- Parameters:
in_res (int) – Input resolution.
fov (float) – Field of view parameter.
cmf_a (float) – CMF parameter.
style (str) – Style parameter.
auto_match_cart_resources (int) – Auto match cartesian resources. Default: 1
device (str) – Device to use. Default: ‘cuda’
in_chans (int) – Number of input image channels. Default: 3
num_classes (int) – Number of classes for classification head. Default: 1000
first_stride (int) – First stride value. Default: 4
depths (list) – Number of blocks at each stage. Default: [3, 3, 9, 3]
dims (list) – Feature dimension at each stage. Default: [96, 192, 384, 768]
drop_path_rate (float) – Stochastic depth rate. Default: 0.
head_init_scale (float) – Init scaling value for classifier weights and biases. Default: 1.
**kwargs – Additional keyword arguments.
- Returns:
Classification logits or features.
- Return type:
- __init__(in_res, fov, cmf_a, style, auto_match_cart_resources=1, device='cuda', in_chans=3, num_classes=1000, first_stride=4, depths=[3, 3, 9, 3], dims=[96, 192, 384, 768], drop_path_rate=0., head_init_scale=1., **kwargs)[source]
Initialize internal Module state, shared by both nn.Module and ScriptModule.
- 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.
- fovi.arch.knnconvnextv2.knnconvnextv2_atto(**kwargs)[source]
Create a KNN ConvNeXtV2 Atto model.
- Parameters:
**kwargs – Additional keyword arguments passed to ConvNeXtV2.
- Returns:
The model instance.
- Return type:
- fovi.arch.knnconvnextv2.knnconvnextv2_femto(**kwargs)[source]
Create a KNN ConvNeXtV2 Femto model.
- Parameters:
**kwargs – Additional keyword arguments passed to ConvNeXtV2.
- Returns:
The model instance.
- Return type:
- fovi.arch.knnconvnextv2.knnconvnextv2_pico(**kwargs)[source]
Create a KNN ConvNeXtV2 Pico model.
- Parameters:
**kwargs – Additional keyword arguments passed to ConvNeXtV2.
- Returns:
The model instance.
- Return type:
- fovi.arch.knnconvnextv2.knnconvnextv2_nano(**kwargs)[source]
Create a KNN ConvNeXtV2 Nano model.
- Parameters:
**kwargs – Additional keyword arguments passed to ConvNeXtV2.
- Returns:
The model instance.
- Return type:
- fovi.arch.knnconvnextv2.knnconvnextv2_tiny(**kwargs)[source]
Create a KNN ConvNeXtV2 Tiny model.
- Parameters:
**kwargs – Additional keyword arguments passed to ConvNeXtV2.
- Returns:
The model instance.
- Return type:
- fovi.arch.knnconvnextv2.knnconvnextv2_base(**kwargs)[source]
Create a KNN ConvNeXtV2 Base model.
- Parameters:
**kwargs – Additional keyword arguments passed to ConvNeXtV2.
- Returns:
The model instance.
- Return type:
- fovi.arch.knnconvnextv2.knnconvnextv2_large(**kwargs)[source]
Create a KNN ConvNeXtV2 Large model.
- Parameters:
**kwargs – Additional keyword arguments passed to ConvNeXtV2.
- Returns:
The model instance.
- Return type: