AI用語辞典

A comprehensive multilingual AI terminology dictionary

Definition

量子化は、高精度な浮動小数点数(例:FP32)を低精度フォーマット(例:INT8やFP16)に変換します。この精度の低下により、モデルのメモリ使用量と計算要件が減少し、推論速度が向上します。

Summary

ニューラルネットワーク計算で使用される数値の精度を下げ、モデルサイズを縮小し、速度を向上させるモデル最適化技術。

Key Concepts

Use Cases

Code Example

1
2
3
4
5
6
import torch.quantization as quant
# Example of converting a model to quantized format
model.eval()
model.qconfig = quant.get_default_qconfig('fbgemm')
quantized_model = quant.prepare(model, inplace=False)
quantized_model = quant.convert(quantized_model, inplace=False)