Skip to content

zoo.sota

[source]

QuickNet

larq_zoo.sota.QuickNet(
    *,
    input_shape=None,
    input_tensor=None,
    weights="imagenet",
    include_top=True,
    num_classes=1000
)

Instantiates the QuickNet architecture.

Optionally loads weights pre-trained on ImageNet.

Model Summary
+quicknet stats----------------------------------------------------------------------------------------------------+
| Layer                   Input prec.                 Outputs  # 1-bit  # 32-bit   Memory  1-bit MACs  32-bit MACs |
|                               (bit)                              x 1       x 1     (kB)                          |
+------------------------------------------------------------------------------------------------------------------+
| input_1                           -  ((None, 224, 224, 3),)        0         0        0           ?            ? |
| conv2d                            -       (-1, 112, 112, 8)        0       216     0.84           0      2709504 |
| depthwise_conv2d                  -        (-1, 56, 56, 64)        0       576     2.25           0      1806336 |
| batch_normalization               -        (-1, 56, 56, 64)        0       128     0.50           0            0 |
| quant_conv2d                      1        (-1, 56, 56, 64)    36864         0     4.50   115605504            0 |
| batch_normalization_1             -        (-1, 56, 56, 64)        0       128     0.50           0            0 |
| add                               -        (-1, 56, 56, 64)        0         0        0           ?            ? |
| quant_conv2d_1                    1        (-1, 56, 56, 64)    36864         0     4.50   115605504            0 |
| batch_normalization_2             -        (-1, 56, 56, 64)        0       128     0.50           0            0 |
| add_1                             -        (-1, 56, 56, 64)        0         0        0           ?            ? |
| max_pooling2d                     -        (-1, 28, 28, 64)        0         0        0           0            0 |
| quant_conv2d_2                    1        (-1, 28, 28, 64)    36864         0     4.50    28901376            0 |
| batch_normalization_3             -        (-1, 28, 28, 64)        0       128     0.50           0            0 |
| batch_normalization_4             -        (-1, 28, 28, 64)        0       128     0.50           0            0 |
| add_2                             -        (-1, 28, 28, 64)        0         0        0           ?            ? |
| concatenate                       -       (-1, 28, 28, 128)        0         0        0           ?            ? |
| quant_conv2d_3                    1       (-1, 28, 28, 128)   147456         0    18.00   115605504            0 |
| batch_normalization_5             -       (-1, 28, 28, 128)        0       256     1.00           0            0 |
| add_3                             -       (-1, 28, 28, 128)        0         0        0           ?            ? |
| quant_conv2d_4                    1       (-1, 28, 28, 128)   147456         0    18.00   115605504            0 |
| batch_normalization_6             -       (-1, 28, 28, 128)        0       256     1.00           0            0 |
| add_4                             -       (-1, 28, 28, 128)        0         0        0           ?            ? |
| max_pooling2d_1                   -       (-1, 14, 14, 128)        0         0        0           0            0 |
| quant_conv2d_5                    1       (-1, 14, 14, 128)   147456         0    18.00    28901376            0 |
| batch_normalization_7             -       (-1, 14, 14, 128)        0       256     1.00           0            0 |
| batch_normalization_8             -       (-1, 14, 14, 128)        0       256     1.00           0            0 |
| add_5                             -       (-1, 14, 14, 128)        0         0        0           ?            ? |
| concatenate_1                     -       (-1, 14, 14, 256)        0         0        0           ?            ? |
| quant_conv2d_6                    1       (-1, 14, 14, 256)   589824         0    72.00   115605504            0 |
| batch_normalization_9             -       (-1, 14, 14, 256)        0       512     2.00           0            0 |
| add_6                             -       (-1, 14, 14, 256)        0         0        0           ?            ? |
| quant_conv2d_7                    1       (-1, 14, 14, 256)   589824         0    72.00   115605504            0 |
| batch_normalization_10            -       (-1, 14, 14, 256)        0       512     2.00           0            0 |
| add_7                             -       (-1, 14, 14, 256)        0         0        0           ?            ? |
| quant_conv2d_8                    1       (-1, 14, 14, 256)   589824         0    72.00   115605504            0 |
| batch_normalization_11            -       (-1, 14, 14, 256)        0       512     2.00           0            0 |
| add_8                             -       (-1, 14, 14, 256)        0         0        0           ?            ? |
| max_pooling2d_2                   -         (-1, 7, 7, 256)        0         0        0           0            0 |
| quant_conv2d_9                    1         (-1, 7, 7, 256)   589824         0    72.00    28901376            0 |
| batch_normalization_12            -         (-1, 7, 7, 256)        0       512     2.00           0            0 |
| batch_normalization_13            -         (-1, 7, 7, 256)        0       512     2.00           0            0 |
| add_9                             -         (-1, 7, 7, 256)        0         0        0           ?            ? |
| concatenate_2                     -         (-1, 7, 7, 512)        0         0        0           ?            ? |
| quant_conv2d_10                   1         (-1, 7, 7, 512)  2359296         0   288.00   115605504            0 |
| batch_normalization_14            -         (-1, 7, 7, 512)        0      1024     4.00           0            0 |
| add_10                            -         (-1, 7, 7, 512)        0         0        0           ?            ? |
| quant_conv2d_11                   1         (-1, 7, 7, 512)  2359296         0   288.00   115605504            0 |
| batch_normalization_15            -         (-1, 7, 7, 512)        0      1024     4.00           0            0 |
| add_11                            -         (-1, 7, 7, 512)        0         0        0           ?            ? |
| quant_conv2d_12                   1         (-1, 7, 7, 512)  2359296         0   288.00   115605504            0 |
| batch_normalization_16            -         (-1, 7, 7, 512)        0      1024     4.00           0            0 |
| add_12                            -         (-1, 7, 7, 512)        0         0        0           ?            ? |
| activation                        -         (-1, 7, 7, 512)        0         0        0           ?            ? |
| average_pooling2d                 -         (-1, 1, 1, 512)        0         0        0           0            0 |
| flatten                           -               (-1, 512)        0         0        0           0            0 |
| dense                             -              (-1, 1000)        0    513000  2003.91           0       512000 |
| activation_1                      -              (-1, 1000)        0         0        0           ?            ? |
+------------------------------------------------------------------------------------------------------------------+
| Total                                                        9990144    521088  3255.00  1242759168      5027840 |
+------------------------------------------------------------------------------------------------------------------+
+quicknet summary-----------------------------+
| Total params                      10.5 M    |
| Trainable params                  10.5 M    |
| Non-trainable params              7.3 k     |
| Model size                        3.18 MiB  |
| Model size (8-bit FP weights)     1.69 MiB  |
| Float-32 Equivalent               40.10 MiB |
| Compression Ratio of Memory       0.08      |
| Number of MACs                    1.25 B    |
| Ratio of MACs that are binarized  0.9960    |
+---------------------------------------------+

ImageNet Metrics

Top-1 Accuracy Top-5 Accuracy Parameters Memory
58.6 % 81.0 % 10 518 528 3.21 MB

Arguments

  • input_shape Optional[Sequence[Optional[int]]]: Optional shape tuple, to be specified if you would like to use a model with an input image resolution that is not (224, 224, 3). It should have exactly 3 inputs channels.
  • input_tensor Optional[tf.Tensor]: optional Keras tensor (i.e. output of layers.Input()) to use as image input for the model.
  • weights Optional[str]: one of None (random initialization), "imagenet" (pre-training on ImageNet), or the path to the weights file to be loaded.
  • include_top bool: whether to include the fully-connected layer at the top of the network.
  • num_classes int: optional number of classes to classify images into, only to be specified if include_top is True, and if no weights argument is specified.

Returns

A Keras model instance.

Raises

  • ValueError: in case of invalid argument for weights, or invalid input shape.

[source]

QuickNetLarge

larq_zoo.sota.QuickNetLarge(
    *,
    input_shape=None,
    input_tensor=None,
    weights="imagenet",
    include_top=True,
    num_classes=1000
)

Instantiates the QuickNetLarge architecture.

Optionally loads weights pre-trained on ImageNet.

Model Summary
+quicknet_large stats-----------------------------------------------------------------------------------------------+
| Layer                   Input prec.                 Outputs   # 1-bit  # 32-bit   Memory  1-bit MACs  32-bit MACs |
|                               (bit)                               x 1       x 1     (kB)                          |
+-------------------------------------------------------------------------------------------------------------------+
| input_1                           -  ((None, 224, 224, 3),)         0         0        0           ?            ? |
| conv2d                            -       (-1, 112, 112, 8)         0       216     0.84           0      2709504 |
| depthwise_conv2d                  -        (-1, 56, 56, 64)         0       576     2.25           0      1806336 |
| batch_normalization               -        (-1, 56, 56, 64)         0       128     0.50           0            0 |
| quant_conv2d                      1        (-1, 56, 56, 64)     36864         0     4.50   115605504            0 |
| batch_normalization_1             -        (-1, 56, 56, 64)         0       128     0.50           0            0 |
| add                               -        (-1, 56, 56, 64)         0         0        0           ?            ? |
| quant_conv2d_1                    1        (-1, 56, 56, 64)     36864         0     4.50   115605504            0 |
| batch_normalization_2             -        (-1, 56, 56, 64)         0       128     0.50           0            0 |
| add_1                             -        (-1, 56, 56, 64)         0         0        0           ?            ? |
| quant_conv2d_2                    1        (-1, 56, 56, 64)     36864         0     4.50   115605504            0 |
| batch_normalization_3             -        (-1, 56, 56, 64)         0       128     0.50           0            0 |
| add_2                             -        (-1, 56, 56, 64)         0         0        0           ?            ? |
| quant_conv2d_3                    1        (-1, 56, 56, 64)     36864         0     4.50   115605504            0 |
| batch_normalization_4             -        (-1, 56, 56, 64)         0       128     0.50           0            0 |
| add_3                             -        (-1, 56, 56, 64)         0         0        0           ?            ? |
| max_pooling2d                     -        (-1, 28, 28, 64)         0         0        0           0            0 |
| quant_conv2d_4                    1       (-1, 28, 28, 128)     73728         0     9.00    57802752            0 |
| conv2d_1                          -       (-1, 28, 28, 128)         0      8192    32.00           0      6422528 |
| batch_normalization_6             -       (-1, 28, 28, 128)         0       256     1.00           0            0 |
| batch_normalization_5             -       (-1, 28, 28, 128)         0       256     1.00           0            0 |
| add_4                             -       (-1, 28, 28, 128)         0         0        0           ?            ? |
| quant_conv2d_5                    1       (-1, 28, 28, 128)    147456         0    18.00   115605504            0 |
| batch_normalization_7             -       (-1, 28, 28, 128)         0       256     1.00           0            0 |
| add_5                             -       (-1, 28, 28, 128)         0         0        0           ?            ? |
| quant_conv2d_6                    1       (-1, 28, 28, 128)    147456         0    18.00   115605504            0 |
| batch_normalization_8             -       (-1, 28, 28, 128)         0       256     1.00           0            0 |
| add_6                             -       (-1, 28, 28, 128)         0         0        0           ?            ? |
| quant_conv2d_7                    1       (-1, 28, 28, 128)    147456         0    18.00   115605504            0 |
| batch_normalization_9             -       (-1, 28, 28, 128)         0       256     1.00           0            0 |
| add_7                             -       (-1, 28, 28, 128)         0         0        0           ?            ? |
| average_pooling2d                 -         (-1, 1, 1, 128)         0         0        0           0            0 |
| flatten                           -               (-1, 128)         0         0        0           0            0 |
| dense                             -                 (-1, 8)         0      1024     4.00           0         1024 |
| quant_conv2d_8                    1       (-1, 14, 14, 256)    294912         0    36.00    57802752            0 |
| dense_1                           -               (-1, 256)         0      2048     8.00           0         2048 |
| max_pooling2d_1                   -       (-1, 14, 14, 128)         0         0        0           0            0 |
| batch_normalization_11            -       (-1, 14, 14, 256)         0       512     2.00           0            0 |
| tf_op_layer_Reshape               -    ((None, 1, 1, 256),)         0         0        0           ?            ? |
| conv2d_2                          -       (-1, 14, 14, 256)         0     32768   128.00           0      6422528 |
| tf_op_layer_Mul                   -  ((None, 14, 14, 256),)         0         0        0           ?            ? |
| batch_normalization_10            -       (-1, 14, 14, 256)         0       512     2.00           0            0 |
| add_8                             -       (-1, 14, 14, 256)         0         0        0           ?            ? |
| average_pooling2d_1               -         (-1, 1, 1, 256)         0         0        0           0            0 |
| flatten_1                         -               (-1, 256)         0         0        0           0            0 |
| dense_2                           -                (-1, 16)         0      4096    16.00           0         4096 |
| quant_conv2d_9                    1       (-1, 14, 14, 256)    589824         0    72.00   115605504            0 |
| dense_3                           -               (-1, 256)         0      4096    16.00           0         4096 |
| batch_normalization_12            -       (-1, 14, 14, 256)         0       512     2.00           0            0 |
| tf_op_layer_Reshape_1             -    ((None, 1, 1, 256),)         0         0        0           ?            ? |
| tf_op_layer_Mul_1                 -  ((None, 14, 14, 256),)         0         0        0           ?            ? |
| add_9                             -       (-1, 14, 14, 256)         0         0        0           ?            ? |
| average_pooling2d_2               -         (-1, 1, 1, 256)         0         0        0           0            0 |
| flatten_2                         -               (-1, 256)         0         0        0           0            0 |
| dense_4                           -                (-1, 16)         0      4096    16.00           0         4096 |
| quant_conv2d_10                   1       (-1, 14, 14, 256)    589824         0    72.00   115605504            0 |
| dense_5                           -               (-1, 256)         0      4096    16.00           0         4096 |
| batch_normalization_13            -       (-1, 14, 14, 256)         0       512     2.00           0            0 |
| tf_op_layer_Reshape_2             -    ((None, 1, 1, 256),)         0         0        0           ?            ? |
| tf_op_layer_Mul_2                 -  ((None, 14, 14, 256),)         0         0        0           ?            ? |
| add_10                            -       (-1, 14, 14, 256)         0         0        0           ?            ? |
| average_pooling2d_3               -         (-1, 1, 1, 256)         0         0        0           0            0 |
| flatten_3                         -               (-1, 256)         0         0        0           0            0 |
| dense_6                           -                (-1, 16)         0      4096    16.00           0         4096 |
| quant_conv2d_11                   1       (-1, 14, 14, 256)    589824         0    72.00   115605504            0 |
| dense_7                           -               (-1, 256)         0      4096    16.00           0         4096 |
| batch_normalization_14            -       (-1, 14, 14, 256)         0       512     2.00           0            0 |
| tf_op_layer_Reshape_3             -    ((None, 1, 1, 256),)         0         0        0           ?            ? |
| tf_op_layer_Mul_3                 -  ((None, 14, 14, 256),)         0         0        0           ?            ? |
| add_11                            -       (-1, 14, 14, 256)         0         0        0           ?            ? |
| average_pooling2d_4               -         (-1, 1, 1, 256)         0         0        0           0            0 |
| flatten_4                         -               (-1, 256)         0         0        0           0            0 |
| dense_8                           -                (-1, 16)         0      4096    16.00           0         4096 |
| quant_conv2d_12                   1         (-1, 7, 7, 512)   1179648         0   144.00    57802752            0 |
| dense_9                           -               (-1, 512)         0      8192    32.00           0         8192 |
| max_pooling2d_2                   -         (-1, 7, 7, 256)         0         0        0           0            0 |
| batch_normalization_16            -         (-1, 7, 7, 512)         0      1024     4.00           0            0 |
| tf_op_layer_Reshape_4             -    ((None, 1, 1, 512),)         0         0        0           ?            ? |
| conv2d_3                          -         (-1, 7, 7, 512)         0    131072   512.00           0      6422528 |
| tf_op_layer_Mul_4                 -    ((None, 7, 7, 512),)         0         0        0           ?            ? |
| batch_normalization_15            -         (-1, 7, 7, 512)         0      1024     4.00           0            0 |
| add_12                            -         (-1, 7, 7, 512)         0         0        0           ?            ? |
| average_pooling2d_5               -         (-1, 1, 1, 512)         0         0        0           0            0 |
| flatten_5                         -               (-1, 512)         0         0        0           0            0 |
| dense_10                          -                (-1, 32)         0     16384    64.00           0        16384 |
| quant_conv2d_13                   1         (-1, 7, 7, 512)   2359296         0   288.00   115605504            0 |
| dense_11                          -               (-1, 512)         0     16384    64.00           0        16384 |
| batch_normalization_17            -         (-1, 7, 7, 512)         0      1024     4.00           0            0 |
| tf_op_layer_Reshape_5             -    ((None, 1, 1, 512),)         0         0        0           ?            ? |
| tf_op_layer_Mul_5                 -    ((None, 7, 7, 512),)         0         0        0           ?            ? |
| add_13                            -         (-1, 7, 7, 512)         0         0        0           ?            ? |
| average_pooling2d_6               -         (-1, 1, 1, 512)         0         0        0           0            0 |
| flatten_6                         -               (-1, 512)         0         0        0           0            0 |
| dense_12                          -                (-1, 32)         0     16384    64.00           0        16384 |
| quant_conv2d_14                   1         (-1, 7, 7, 512)   2359296         0   288.00   115605504            0 |
| dense_13                          -               (-1, 512)         0     16384    64.00           0        16384 |
| batch_normalization_18            -         (-1, 7, 7, 512)         0      1024     4.00           0            0 |
| tf_op_layer_Reshape_6             -    ((None, 1, 1, 512),)         0         0        0           ?            ? |
| tf_op_layer_Mul_6                 -    ((None, 7, 7, 512),)         0         0        0           ?            ? |
| add_14                            -         (-1, 7, 7, 512)         0         0        0           ?            ? |
| average_pooling2d_7               -         (-1, 1, 1, 512)         0         0        0           0            0 |
| flatten_7                         -               (-1, 512)         0         0        0           0            0 |
| dense_14                          -                (-1, 32)         0     16384    64.00           0        16384 |
| quant_conv2d_15                   1         (-1, 7, 7, 512)   2359296         0   288.00   115605504            0 |
| dense_15                          -               (-1, 512)         0     16384    64.00           0        16384 |
| batch_normalization_19            -         (-1, 7, 7, 512)         0      1024     4.00           0            0 |
| tf_op_layer_Reshape_7             -    ((None, 1, 1, 512),)         0         0        0           ?            ? |
| tf_op_layer_Mul_7                 -    ((None, 7, 7, 512),)         0         0        0           ?            ? |
| add_15                            -         (-1, 7, 7, 512)         0         0        0           ?            ? |
| activation                        -         (-1, 7, 7, 512)         0         0        0           ?            ? |
| average_pooling2d_8               -         (-1, 1, 1, 512)         0         0        0           0            0 |
| flatten_8                         -               (-1, 512)         0         0        0           0            0 |
| dense_16                          -              (-1, 1000)         0    513000  2003.91           0       512000 |
| activation_1                      -              (-1, 1000)         0         0        0           ?            ? |
+-------------------------------------------------------------------------------------------------------------------+
| Total                                                        10985472    833664  4597.50  1676279808     24433664 |
+-------------------------------------------------------------------------------------------------------------------+
+quicknet_large summary-----------------------+
| Total params                      11.8 M    |
| Trainable params                  11.8 M    |
| Non-trainable params              9.6 k     |
| Model size                        4.49 MiB  |
| Model size (8-bit FP weights)     2.10 MiB  |
| Float-32 Equivalent               45.09 MiB |
| Compression Ratio of Memory       0.10      |
| Number of MACs                    1.7 B     |
| Ratio of MACs that are binarized  0.9856    |
+---------------------------------------------+

ImageNet Metrics

Top-1 Accuracy Top-5 Accuracy Parameters Memory
62.7 % 84.0 % 11 837 696 4.56 MB

Arguments

  • input_shape Optional[Sequence[Optional[int]]]: Optional shape tuple, to be specified if you would like to use a model with an input image resolution that is not (224, 224, 3). It should have exactly 3 inputs channels.
  • input_tensor Optional[tf.Tensor]: optional Keras tensor (i.e. output of layers.Input()) to use as image input for the model.
  • weights Optional[str]: one of None (random initialization), "imagenet" (pre-training on ImageNet), or the path to the weights file to be loaded.
  • include_top bool: whether to include the fully-connected layer at the top of the network.
  • num_classes int: optional number of classes to classify images into, only to be specified if include_top is True, and if no weights argument is specified.

Returns

A Keras model instance.

Raises

  • ValueError: in case of invalid argument for weights, or invalid input shape.

[source]

QuickNetXL

larq_zoo.sota.QuickNetXL(
    *,
    input_shape=None,
    input_tensor=None,
    weights="imagenet",
    include_top=True,
    num_classes=1000
)

Instantiates the QuickNetXL architecture.

Optionally loads weights pre-trained on ImageNet.

Model Summary
+quicknet_xl stats--------------------------------------------------------------------------------------------------+
| Layer                   Input prec.                 Outputs   # 1-bit  # 32-bit   Memory  1-bit MACs  32-bit MACs |
|                               (bit)                               x 1       x 1     (kB)                          |
+-------------------------------------------------------------------------------------------------------------------+
| input_1                           -  ((None, 224, 224, 3),)         0         0        0           ?            ? |
| conv2d                            -       (-1, 112, 112, 8)         0       216     0.84           0      2709504 |
| depthwise_conv2d                  -        (-1, 56, 56, 64)         0       576     2.25           0      1806336 |
| batch_normalization               -        (-1, 56, 56, 64)         0       128     0.50           0            0 |
| quant_conv2d                      1        (-1, 56, 56, 64)     36864         0     4.50   115605504            0 |
| batch_normalization_1             -        (-1, 56, 56, 64)         0       128     0.50           0            0 |
| add                               -        (-1, 56, 56, 64)         0         0        0           ?            ? |
| quant_conv2d_1                    1        (-1, 56, 56, 64)     36864         0     4.50   115605504            0 |
| batch_normalization_2             -        (-1, 56, 56, 64)         0       128     0.50           0            0 |
| add_1                             -        (-1, 56, 56, 64)         0         0        0           ?            ? |
| quant_conv2d_2                    1        (-1, 56, 56, 64)     36864         0     4.50   115605504            0 |
| batch_normalization_3             -        (-1, 56, 56, 64)         0       128     0.50           0            0 |
| add_2                             -        (-1, 56, 56, 64)         0         0        0           ?            ? |
| quant_conv2d_3                    1        (-1, 56, 56, 64)     36864         0     4.50   115605504            0 |
| batch_normalization_4             -        (-1, 56, 56, 64)         0       128     0.50           0            0 |
| add_3                             -        (-1, 56, 56, 64)         0         0        0           ?            ? |
| quant_conv2d_4                    1        (-1, 56, 56, 64)     36864         0     4.50   115605504            0 |
| batch_normalization_5             -        (-1, 56, 56, 64)         0       128     0.50           0            0 |
| add_4                             -        (-1, 56, 56, 64)         0         0        0           ?            ? |
| quant_conv2d_5                    1        (-1, 56, 56, 64)     36864         0     4.50   115605504            0 |
| batch_normalization_6             -        (-1, 56, 56, 64)         0       128     0.50           0            0 |
| add_5                             -        (-1, 56, 56, 64)         0         0        0           ?            ? |
| max_pooling2d                     -        (-1, 28, 28, 64)         0         0        0           0            0 |
| quant_conv2d_6                    1       (-1, 28, 28, 128)     73728         0     9.00    57802752            0 |
| conv2d_1                          -       (-1, 28, 28, 128)         0      8192    32.00           0      6422528 |
| batch_normalization_8             -       (-1, 28, 28, 128)         0       256     1.00           0            0 |
| batch_normalization_7             -       (-1, 28, 28, 128)         0       256     1.00           0            0 |
| add_6                             -       (-1, 28, 28, 128)         0         0        0           ?            ? |
| quant_conv2d_7                    1       (-1, 28, 28, 128)    147456         0    18.00   115605504            0 |
| batch_normalization_9             -       (-1, 28, 28, 128)         0       256     1.00           0            0 |
| add_7                             -       (-1, 28, 28, 128)         0         0        0           ?            ? |
| quant_conv2d_8                    1       (-1, 28, 28, 128)    147456         0    18.00   115605504            0 |
| batch_normalization_10            -       (-1, 28, 28, 128)         0       256     1.00           0            0 |
| add_8                             -       (-1, 28, 28, 128)         0         0        0           ?            ? |
| quant_conv2d_9                    1       (-1, 28, 28, 128)    147456         0    18.00   115605504            0 |
| batch_normalization_11            -       (-1, 28, 28, 128)         0       256     1.00           0            0 |
| add_9                             -       (-1, 28, 28, 128)         0         0        0           ?            ? |
| quant_conv2d_10                   1       (-1, 28, 28, 128)    147456         0    18.00   115605504            0 |
| batch_normalization_12            -       (-1, 28, 28, 128)         0       256     1.00           0            0 |
| add_10                            -       (-1, 28, 28, 128)         0         0        0           ?            ? |
| quant_conv2d_11                   1       (-1, 28, 28, 128)    147456         0    18.00   115605504            0 |
| batch_normalization_13            -       (-1, 28, 28, 128)         0       256     1.00           0            0 |
| add_11                            -       (-1, 28, 28, 128)         0         0        0           ?            ? |
| quant_conv2d_12                   1       (-1, 28, 28, 128)    147456         0    18.00   115605504            0 |
| batch_normalization_14            -       (-1, 28, 28, 128)         0       256     1.00           0            0 |
| add_12                            -       (-1, 28, 28, 128)         0         0        0           ?            ? |
| quant_conv2d_13                   1       (-1, 28, 28, 128)    147456         0    18.00   115605504            0 |
| batch_normalization_15            -       (-1, 28, 28, 128)         0       256     1.00           0            0 |
| add_13                            -       (-1, 28, 28, 128)         0         0        0           ?            ? |
| average_pooling2d                 -         (-1, 1, 1, 128)         0         0        0           0            0 |
| flatten                           -               (-1, 128)         0         0        0           0            0 |
| dense                             -                 (-1, 8)         0      1024     4.00           0         1024 |
| quant_conv2d_14                   1       (-1, 14, 14, 256)    294912         0    36.00    57802752            0 |
| dense_1                           -               (-1, 256)         0      2048     8.00           0         2048 |
| max_pooling2d_1                   -       (-1, 14, 14, 128)         0         0        0           0            0 |
| batch_normalization_17            -       (-1, 14, 14, 256)         0       512     2.00           0            0 |
| tf_op_layer_Reshape               -    ((None, 1, 1, 256),)         0         0        0           ?            ? |
| conv2d_2                          -       (-1, 14, 14, 256)         0     32768   128.00           0      6422528 |
| tf_op_layer_Mul                   -  ((None, 14, 14, 256),)         0         0        0           ?            ? |
| batch_normalization_16            -       (-1, 14, 14, 256)         0       512     2.00           0            0 |
| add_14                            -       (-1, 14, 14, 256)         0         0        0           ?            ? |
| average_pooling2d_1               -         (-1, 1, 1, 256)         0         0        0           0            0 |
| flatten_1                         -               (-1, 256)         0         0        0           0            0 |
| dense_2                           -                (-1, 16)         0      4096    16.00           0         4096 |
| quant_conv2d_15                   1       (-1, 14, 14, 256)    589824         0    72.00   115605504            0 |
| dense_3                           -               (-1, 256)         0      4096    16.00           0         4096 |
| batch_normalization_18            -       (-1, 14, 14, 256)         0       512     2.00           0            0 |
| tf_op_layer_Reshape_1             -    ((None, 1, 1, 256),)         0         0        0           ?            ? |
| tf_op_layer_Mul_1                 -  ((None, 14, 14, 256),)         0         0        0           ?            ? |
| add_15                            -       (-1, 14, 14, 256)         0         0        0           ?            ? |
| average_pooling2d_2               -         (-1, 1, 1, 256)         0         0        0           0            0 |
| flatten_2                         -               (-1, 256)         0         0        0           0            0 |
| dense_4                           -                (-1, 16)         0      4096    16.00           0         4096 |
| quant_conv2d_16                   1       (-1, 14, 14, 256)    589824         0    72.00   115605504            0 |
| dense_5                           -               (-1, 256)         0      4096    16.00           0         4096 |
| batch_normalization_19            -       (-1, 14, 14, 256)         0       512     2.00           0            0 |
| tf_op_layer_Reshape_2             -    ((None, 1, 1, 256),)         0         0        0           ?            ? |
| tf_op_layer_Mul_2                 -  ((None, 14, 14, 256),)         0         0        0           ?            ? |
| add_16                            -       (-1, 14, 14, 256)         0         0        0           ?            ? |
| average_pooling2d_3               -         (-1, 1, 1, 256)         0         0        0           0            0 |
| flatten_3                         -               (-1, 256)         0         0        0           0            0 |
| dense_6                           -                (-1, 16)         0      4096    16.00           0         4096 |
| quant_conv2d_17                   1       (-1, 14, 14, 256)    589824         0    72.00   115605504            0 |
| dense_7                           -               (-1, 256)         0      4096    16.00           0         4096 |
| batch_normalization_20            -       (-1, 14, 14, 256)         0       512     2.00           0            0 |
| tf_op_layer_Reshape_3             -    ((None, 1, 1, 256),)         0         0        0           ?            ? |
| tf_op_layer_Mul_3                 -  ((None, 14, 14, 256),)         0         0        0           ?            ? |
| add_17                            -       (-1, 14, 14, 256)         0         0        0           ?            ? |
| average_pooling2d_4               -         (-1, 1, 1, 256)         0         0        0           0            0 |
| flatten_4                         -               (-1, 256)         0         0        0           0            0 |
| dense_8                           -                (-1, 16)         0      4096    16.00           0         4096 |
| quant_conv2d_18                   1       (-1, 14, 14, 256)    589824         0    72.00   115605504            0 |
| dense_9                           -               (-1, 256)         0      4096    16.00           0         4096 |
| batch_normalization_21            -       (-1, 14, 14, 256)         0       512     2.00           0            0 |
| tf_op_layer_Reshape_4             -    ((None, 1, 1, 256),)         0         0        0           ?            ? |
| tf_op_layer_Mul_4                 -  ((None, 14, 14, 256),)         0         0        0           ?            ? |
| add_18                            -       (-1, 14, 14, 256)         0         0        0           ?            ? |
| average_pooling2d_5               -         (-1, 1, 1, 256)         0         0        0           0            0 |
| flatten_5                         -               (-1, 256)         0         0        0           0            0 |
| dense_10                          -                (-1, 16)         0      4096    16.00           0         4096 |
| quant_conv2d_19                   1       (-1, 14, 14, 256)    589824         0    72.00   115605504            0 |
| dense_11                          -               (-1, 256)         0      4096    16.00           0         4096 |
| batch_normalization_22            -       (-1, 14, 14, 256)         0       512     2.00           0            0 |
| tf_op_layer_Reshape_5             -    ((None, 1, 1, 256),)         0         0        0           ?            ? |
| tf_op_layer_Mul_5                 -  ((None, 14, 14, 256),)         0         0        0           ?            ? |
| add_19                            -       (-1, 14, 14, 256)         0         0        0           ?            ? |
| average_pooling2d_6               -         (-1, 1, 1, 256)         0         0        0           0            0 |
| flatten_6                         -               (-1, 256)         0         0        0           0            0 |
| dense_12                          -                (-1, 16)         0      4096    16.00           0         4096 |
| quant_conv2d_20                   1       (-1, 14, 14, 256)    589824         0    72.00   115605504            0 |
| dense_13                          -               (-1, 256)         0      4096    16.00           0         4096 |
| batch_normalization_23            -       (-1, 14, 14, 256)         0       512     2.00           0            0 |
| tf_op_layer_Reshape_6             -    ((None, 1, 1, 256),)         0         0        0           ?            ? |
| tf_op_layer_Mul_6                 -  ((None, 14, 14, 256),)         0         0        0           ?            ? |
| add_20                            -       (-1, 14, 14, 256)         0         0        0           ?            ? |
| average_pooling2d_7               -         (-1, 1, 1, 256)         0         0        0           0            0 |
| flatten_7                         -               (-1, 256)         0         0        0           0            0 |
| dense_14                          -                (-1, 16)         0      4096    16.00           0         4096 |
| quant_conv2d_21                   1       (-1, 14, 14, 256)    589824         0    72.00   115605504            0 |
| dense_15                          -               (-1, 256)         0      4096    16.00           0         4096 |
| batch_normalization_24            -       (-1, 14, 14, 256)         0       512     2.00           0            0 |
| tf_op_layer_Reshape_7             -    ((None, 1, 1, 256),)         0         0        0           ?            ? |
| tf_op_layer_Mul_7                 -  ((None, 14, 14, 256),)         0         0        0           ?            ? |
| add_21                            -       (-1, 14, 14, 256)         0         0        0           ?            ? |
| average_pooling2d_8               -         (-1, 1, 1, 256)         0         0        0           0            0 |
| flatten_8                         -               (-1, 256)         0         0        0           0            0 |
| dense_16                          -                (-1, 16)         0      4096    16.00           0         4096 |
| quant_conv2d_22                   1       (-1, 14, 14, 256)    589824         0    72.00   115605504            0 |
| dense_17                          -               (-1, 256)         0      4096    16.00           0         4096 |
| batch_normalization_25            -       (-1, 14, 14, 256)         0       512     2.00           0            0 |
| tf_op_layer_Reshape_8             -    ((None, 1, 1, 256),)         0         0        0           ?            ? |
| tf_op_layer_Mul_8                 -  ((None, 14, 14, 256),)         0         0        0           ?            ? |
| add_22                            -       (-1, 14, 14, 256)         0         0        0           ?            ? |
| average_pooling2d_9               -         (-1, 1, 1, 256)         0         0        0           0            0 |
| flatten_9                         -               (-1, 256)         0         0        0           0            0 |
| dense_18                          -                (-1, 16)         0      4096    16.00           0         4096 |
| quant_conv2d_23                   1       (-1, 14, 14, 256)    589824         0    72.00   115605504            0 |
| dense_19                          -               (-1, 256)         0      4096    16.00           0         4096 |
| batch_normalization_26            -       (-1, 14, 14, 256)         0       512     2.00           0            0 |
| tf_op_layer_Reshape_9             -    ((None, 1, 1, 256),)         0         0        0           ?            ? |
| tf_op_layer_Mul_9                 -  ((None, 14, 14, 256),)         0         0        0           ?            ? |
| add_23                            -       (-1, 14, 14, 256)         0         0        0           ?            ? |
| average_pooling2d_10              -         (-1, 1, 1, 256)         0         0        0           0            0 |
| flatten_10                        -               (-1, 256)         0         0        0           0            0 |
| dense_20                          -                (-1, 16)         0      4096    16.00           0         4096 |
| quant_conv2d_24                   1       (-1, 14, 14, 256)    589824         0    72.00   115605504            0 |
| dense_21                          -               (-1, 256)         0      4096    16.00           0         4096 |
| batch_normalization_27            -       (-1, 14, 14, 256)         0       512     2.00           0            0 |
| tf_op_layer_Reshape_10            -    ((None, 1, 1, 256),)         0         0        0           ?            ? |
| tf_op_layer_Mul_10                -  ((None, 14, 14, 256),)         0         0        0           ?            ? |
| add_24                            -       (-1, 14, 14, 256)         0         0        0           ?            ? |
| average_pooling2d_11              -         (-1, 1, 1, 256)         0         0        0           0            0 |
| flatten_11                        -               (-1, 256)         0         0        0           0            0 |
| dense_22                          -                (-1, 16)         0      4096    16.00           0         4096 |
| quant_conv2d_25                   1       (-1, 14, 14, 256)    589824         0    72.00   115605504            0 |
| dense_23                          -               (-1, 256)         0      4096    16.00           0         4096 |
| batch_normalization_28            -       (-1, 14, 14, 256)         0       512     2.00           0            0 |
| tf_op_layer_Reshape_11            -    ((None, 1, 1, 256),)         0         0        0           ?            ? |
| tf_op_layer_Mul_11                -  ((None, 14, 14, 256),)         0         0        0           ?            ? |
| add_25                            -       (-1, 14, 14, 256)         0         0        0           ?            ? |
| average_pooling2d_12              -         (-1, 1, 1, 256)         0         0        0           0            0 |
| flatten_12                        -               (-1, 256)         0         0        0           0            0 |
| dense_24                          -                (-1, 16)         0      4096    16.00           0         4096 |
| quant_conv2d_26                   1         (-1, 7, 7, 512)   1179648         0   144.00    57802752            0 |
| dense_25                          -               (-1, 512)         0      8192    32.00           0         8192 |
| max_pooling2d_2                   -         (-1, 7, 7, 256)         0         0        0           0            0 |
| batch_normalization_30            -         (-1, 7, 7, 512)         0      1024     4.00           0            0 |
| tf_op_layer_Reshape_12            -    ((None, 1, 1, 512),)         0         0        0           ?            ? |
| conv2d_3                          -         (-1, 7, 7, 512)         0    131072   512.00           0      6422528 |
| tf_op_layer_Mul_12                -    ((None, 7, 7, 512),)         0         0        0           ?            ? |
| batch_normalization_29            -         (-1, 7, 7, 512)         0      1024     4.00           0            0 |
| add_26                            -         (-1, 7, 7, 512)         0         0        0           ?            ? |
| average_pooling2d_13              -         (-1, 1, 1, 512)         0         0        0           0            0 |
| flatten_13                        -               (-1, 512)         0         0        0           0            0 |
| dense_26                          -                (-1, 32)         0     16384    64.00           0        16384 |
| quant_conv2d_27                   1         (-1, 7, 7, 512)   2359296         0   288.00   115605504            0 |
| dense_27                          -               (-1, 512)         0     16384    64.00           0        16384 |
| batch_normalization_31            -         (-1, 7, 7, 512)         0      1024     4.00           0            0 |
| tf_op_layer_Reshape_13            -    ((None, 1, 1, 512),)         0         0        0           ?            ? |
| tf_op_layer_Mul_13                -    ((None, 7, 7, 512),)         0         0        0           ?            ? |
| add_27                            -         (-1, 7, 7, 512)         0         0        0           ?            ? |
| average_pooling2d_14              -         (-1, 1, 1, 512)         0         0        0           0            0 |
| flatten_14                        -               (-1, 512)         0         0        0           0            0 |
| dense_28                          -                (-1, 32)         0     16384    64.00           0        16384 |
| quant_conv2d_28                   1         (-1, 7, 7, 512)   2359296         0   288.00   115605504            0 |
| dense_29                          -               (-1, 512)         0     16384    64.00           0        16384 |
| batch_normalization_32            -         (-1, 7, 7, 512)         0      1024     4.00           0            0 |
| tf_op_layer_Reshape_14            -    ((None, 1, 1, 512),)         0         0        0           ?            ? |
| tf_op_layer_Mul_14                -    ((None, 7, 7, 512),)         0         0        0           ?            ? |
| add_28                            -         (-1, 7, 7, 512)         0         0        0           ?            ? |
| average_pooling2d_15              -         (-1, 1, 1, 512)         0         0        0           0            0 |
| flatten_15                        -               (-1, 512)         0         0        0           0            0 |
| dense_30                          -                (-1, 32)         0     16384    64.00           0        16384 |
| quant_conv2d_29                   1         (-1, 7, 7, 512)   2359296         0   288.00   115605504            0 |
| dense_31                          -               (-1, 512)         0     16384    64.00           0        16384 |
| batch_normalization_33            -         (-1, 7, 7, 512)         0      1024     4.00           0            0 |
| tf_op_layer_Reshape_15            -    ((None, 1, 1, 512),)         0         0        0           ?            ? |
| tf_op_layer_Mul_15                -    ((None, 7, 7, 512),)         0         0        0           ?            ? |
| add_29                            -         (-1, 7, 7, 512)         0         0        0           ?            ? |
| average_pooling2d_16              -         (-1, 1, 1, 512)         0         0        0           0            0 |
| flatten_16                        -               (-1, 512)         0         0        0           0            0 |
| dense_32                          -                (-1, 32)         0     16384    64.00           0        16384 |
| quant_conv2d_30                   1         (-1, 7, 7, 512)   2359296         0   288.00   115605504            0 |
| dense_33                          -               (-1, 512)         0     16384    64.00           0        16384 |
| batch_normalization_34            -         (-1, 7, 7, 512)         0      1024     4.00           0            0 |
| tf_op_layer_Reshape_16            -    ((None, 1, 1, 512),)         0         0        0           ?            ? |
| tf_op_layer_Mul_16                -    ((None, 7, 7, 512),)         0         0        0           ?            ? |
| add_30                            -         (-1, 7, 7, 512)         0         0        0           ?            ? |
| average_pooling2d_17              -         (-1, 1, 1, 512)         0         0        0           0            0 |
| flatten_17                        -               (-1, 512)         0         0        0           0            0 |
| dense_34                          -                (-1, 32)         0     16384    64.00           0        16384 |
| quant_conv2d_31                   1         (-1, 7, 7, 512)   2359296         0   288.00   115605504            0 |
| dense_35                          -               (-1, 512)         0     16384    64.00           0        16384 |
| batch_normalization_35            -         (-1, 7, 7, 512)         0      1024     4.00           0            0 |
| tf_op_layer_Reshape_17            -    ((None, 1, 1, 512),)         0         0        0           ?            ? |
| tf_op_layer_Mul_17                -    ((None, 7, 7, 512),)         0         0        0           ?            ? |
| add_31                            -         (-1, 7, 7, 512)         0         0        0           ?            ? |
| activation                        -         (-1, 7, 7, 512)         0         0        0           ?            ? |
| average_pooling2d_18              -         (-1, 1, 1, 512)         0         0        0           0            0 |
| flatten_18                        -               (-1, 512)         0         0        0           0            0 |
| dense_36                          -              (-1, 1000)         0    513000  2003.91           0       512000 |
| activation_1                      -              (-1, 1000)         0         0        0           ?            ? |
+-------------------------------------------------------------------------------------------------------------------+
| Total                                                        21086208    972160  6371.50  3525967872     24564736 |
+-------------------------------------------------------------------------------------------------------------------+
+quicknet_xl summary--------------------------+
| Total params                      22.1 M    |
| Trainable params                  22 M      |
| Non-trainable params              17 k      |
| Model size                        6.22 MiB  |
| Model size (8-bit FP weights)     3.44 MiB  |
| Float-32 Equivalent               84.15 MiB |
| Compression Ratio of Memory       0.07      |
| Number of MACs                    3.55 B    |
| Ratio of MACs that are binarized  0.9931    |
+---------------------------------------------+

ImageNet Metrics

Top-1 Accuracy Top-5 Accuracy Parameters Memory
67.0 % 87.3 % 22 058 368 6.22 MB

Arguments

  • input_shape Optional[Sequence[Optional[int]]]: Optional shape tuple, to be specified if you would like to use a model with an input image resolution that is not (224, 224, 3). It should have exactly 3 inputs channels.
  • input_tensor Optional[tf.Tensor]: optional Keras tensor (i.e. output of layers.Input()) to use as image input for the model.
  • weights Optional[str]: one of None (random initialization), "imagenet" (pre-training on ImageNet), or the path to the weights file to be loaded.
  • include_top bool: whether to include the fully-connected layer at the top of the network.
  • num_classes int: optional number of classes to classify images into, only to be specified if include_top is True, and if no weights argument is specified.

Returns

A Keras model instance.

Raises

  • ValueError: in case of invalid argument for weights, or invalid input shape.