compileml.compile

quantize_model

def quantize_model(extracted: compileml.compile.extract.ExtractedModel, *, micro_scale: int = 1000000) -> dict

from compileml.compile import quantize_model

Quantize an extracted float model into the integer artifact model.

Parameters#

NameTypeDefaultKind
extractedcompileml.compile.extract.ExtractedModelrequiredpositional
micro_scaleint1000000keyword-only

Returns#

dict

Example#

python
from compileml.compile import extract_trees, quantize_model
 
model = quantize_model(extract_trees(whitebox))

Worked example: quantize_model →