Simple CNN
- class biapy.models.simple_cnn.simple_CNN(image_shape, activation='ReLU', n_classes=2)[source]
Bases:
Module
Create simple CNN.
- Parameters:
image_shape (2D tuple) – Dimensions of the input image.
activation (str, optional) – Activation layer to use in the model.
n_classes (int, optional) – Number of classes.
- Returns:
model – Model containing the simple CNN.
- Return type:
Torch model
- 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.