summary(model, print_fn=None, include_macs=True)
The summary includes the following information per layer:
- input precision,
- output dimension,
- weight count (broken down by bidtwidth),
- memory footprint in kilobytes (
8*10241-bit weights = 1 kB),
- number of multiply-accumulate (MAC) operations broken down by precision (optional & expermental).
A single MAC operation contains both a multiplication and an addition. The precision of a MAC operation is defined as the maximum bitwidth of its inputs.
Additionally, the following overall statistics for the model are supplied:
- total number of weights,
- total number of trainable weights,
- total number of non-trainable weights,
- model size,
- float-32 equivalent size: memory footprint if all weights were 32 bit,
- compression ratio achieved by quantizing weights,
- total number of MAC operations,
- ratio of MAC operations that is binarized and can be accelated with XNOR-gates.
print_fn: Print function to use. Defaults to
include_macs: whether or not to include the number of MAC-operations in the summary.
- ValueError: if called before the model is built.