Skip to content

AutoNN.CNN.cnn_generator.CNN

class CNN(in_channels:int,numClasses:int,config: Optional[list[tuple]]=None):

Parameters:

  • in_channels : The number of channels in an image

  • numClass : Total number of classes in a classification problem

  • config : Generated configuration by AutoNN's CreateCNN.create_config() method required to create a CNN model

Methods:

  • summary() :

    Parameters:

    input_shape : Shape of the image torch.tensor [C, H, W]

        where,  C = number of channels
                H = height of the image
                W = width of the image
    

    border : bool datatype , default = True | It prints lines between layers while displaying the summary of a model if set to True

  • save()

    classes : List of classes

    image_shape : Tuple[int, int] (H,W) | dimension of the images

    path : Optional | path to the directory where the model is intended to be stored

    Note

    For the very first time path should be included, otherwise it will throw an InvalidPathError exception.

    filename : str | name of the model

  • load()

    Parameters:

    PATH : Path to the trained model.pth.

    printmodel : bool datatype, default = False | print the model if set to True

    loadmodel : bool datatype, default = True | loads all the stored weights if set to True

  • predict()

    paths : Union[list | tuple] | list of unknown images for testing or prediction