nntoolbox.vision.components.structured module

class nntoolbox.vision.components.structured.BilinearPooling[source]

Bases: torch.nn.modules.module.Module

Bilinear pooling layer

References:

Lin et al. “Bilinear CNN Models for Fine-grained Visual Recognition”. http://vis-www.cs.umass.edu/bcnn/docs/bcnn_iccv15.pdf

forward(inputA: torch.Tensor, inputB: torch.Tensor) → torch.Tensor[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.

training: bool
class nntoolbox.vision.components.structured.O2PLayer[source]

Bases: torch.nn.modules.module.Module

forward(input: torch.Tensor) → torch.Tensor[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.

training: bool
class nntoolbox.vision.components.structured.O2PLayerV2[source]

Bases: torch.nn.modules.module.Module

Slightly more stable Recommended Use.

forward(input: torch.Tensor) → torch.Tensor[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.

training: bool