bitorch.models.lenet.LeNet

class bitorch.models.lenet.LeNet(input_shape: List[int], num_classes: int = 0, lenet_version: int = 0)[source]

LeNet model, both in quantized and full precision version

Methods

__init__

builds the model depending on mode in either quantized or full_precision mode

add_argparse_arguments

allows additions to the argument parser if required, e.g.

generate_quant_model

Attributes

name

num_channels_conv

num_fc

__init__(input_shape: List[int], num_classes: int = 0, lenet_version: int = 0) None[source]

builds the model depending on mode in either quantized or full_precision mode

Parameters:
  • input_shape (List[int]) – input shape of images

  • num_classes (int, optional) – number of output classes. Defaults to None.

  • lenet_version (int, optional) – lenet version. if version outside of [0, 3], the full precision version is used. Defaults to 0.

Raises:

ValueError – thrown if num classes is none

activation_function

alias of Tanh

static add_argparse_arguments(parser: ArgumentParser) None[source]

allows additions to the argument parser if required, e.g. to add layer count, etc.

! please note that the inferred variable names of additional cli arguments are passed as keyword arguments to the constructor of this class !

Parameters:

parser (ArgumentParser) – the argument parser