brevitas.core.stats package#
Submodules#
brevitas.core.stats.stats_op module#
- class brevitas.core.stats.stats_op.AbsAve(stats_reduce_dim=None)[source]#
Bases:
Module
- 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.
- class brevitas.core.stats.stats_op.AbsMax(stats_reduce_dim=None)[source]#
Bases:
Module
- 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.
- class brevitas.core.stats.stats_op.AbsMaxAve(stats_reduce_dim)[source]#
Bases:
Module
- 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.
- class brevitas.core.stats.stats_op.AbsMaxL2(stats_reduce_dim)[source]#
Bases:
Module
- 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.
- class brevitas.core.stats.stats_op.AbsMinMax(stats_reduce_dim=None)[source]#
Bases:
Module
- 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.
- class brevitas.core.stats.stats_op.AbsPercentile(high_percentile_q, stats_reduce_dim, percentile_q=None)[source]#
Bases:
Module
- 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.
- class brevitas.core.stats.stats_op.KLMinimizerThreshold(signed, bit_width_impl, num_bins=1001, smoothing_eps=0.0001)[source]#
Bases:
Module
Based on: apache/incubator-mxnet
- 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.
- class brevitas.core.stats.stats_op.L1Norm(stats_reduce_dim=None)[source]#
Bases:
Module
ScriptModule implementation to collect per-channel L1 normalization stats for weight normalization-based quantization.
- 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.
- class brevitas.core.stats.stats_op.L2Norm(stats_reduce_dim=None)[source]#
Bases:
Module
ScriptModule implementation to collect per-channel L2 normalization stats for weight normalization-based quantization.
- 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.
- class brevitas.core.stats.stats_op.MeanLearnedSigmaStd(sigma, stats_output_shape, stats_reduce_dim=None, std_dev_epsilon=1e-08)[source]#
Bases:
Module
- 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.
- class brevitas.core.stats.stats_op.MeanSigmaStd(sigma, stats_reduce_dim=None, std_dev_epsilon=1e-08)[source]#
Bases:
Module
- 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.
- class brevitas.core.stats.stats_op.NegativeMinOrZero(stats_reduce_dim=None)[source]#
Bases:
Module
- 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.- Return type:
- class brevitas.core.stats.stats_op.NegativePercentileOrZero(low_percentile_q, stats_reduce_dim=None)[source]#
Bases:
Module
- 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.- Return type:
- class brevitas.core.stats.stats_op.PercentileInterval(low_percentile_q, high_percentile_q, stats_reduce_dim=None)[source]#
Bases:
Module
- 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.- Return type: