8.1.1.7.1.1.2.7. blueoil.networks.classification.quantize_example

8.1.1.7.1.1.2.7.1. Module Contents

8.1.1.7.1.1.2.7.1.1. Classes

SampleNetwork

Sample network with simple layer.

SampleNetworkQuantize

Quantize Sample Network.

class blueoil.networks.classification.quantize_example.SampleNetwork(*args, **kwargs)

Bases: blueoil.networks.classification.base.Base

Sample network with simple layer.

base(self, images, is_training)

Base function contains inference.

Parameters
  • images – Input images.

  • is_training – A flag for if is training.

Returns

Inference result.

Return type

tf.Tensor

class blueoil.networks.classification.quantize_example.SampleNetworkQuantize(quantize_first_convolution=True, quantize_last_convolution=True, activation_quantizer=None, activation_quantizer_kwargs={}, weight_quantizer=None, weight_quantizer_kwargs={}, *args, **kwargs)

Bases: blueoil.networks.classification.quantize_example.SampleNetwork

Quantize Sample Network.

static _quantized_variable_getter(weight_quantization, quantize_first_convolution, quantize_last_convolution, getter, name, *args, **kwargs)

Get the quantized variables.

Use if to choose or skip the target should be quantized.

Parameters
  • weight_quantization – Callable object which quantize variable.

  • quantize_first_convolution (bool) – Use quantization in first conv.

  • quantize_last_convolution (bool) – Use quantization in last conv.

  • getter – Default from tensorflow.

  • name – Default from tensorflow.

  • args – Args.

  • kwargs – Kwargs.

base(self, images, is_training)

Base function contains inference.

Parameters
  • images – Input images.

  • is_training – A flag for if is training.

Returns

Inference result.

Return type

tf.Tensor