火幣/幣安/歐易OKEX交易所系統(tǒng)開(kāi)發(fā)詳細(xì)邏輯及方案
There are various trading modes in the exchange,and most of the various trading modes in the digital currency trading platform are used for matchmaking.To put it bluntly,matchmaking transaction usually refers to the transaction rules that the seller entrusts the sales order in the trading center and the buyer entrusts the purchase order in the trading center.The trading center confirms the transaction price of both parties according to the principle of price priority and time priority,and carries out physical delivery according to the delivery warehouse specified in the delivery order.
執(zhí)行量化
執(zhí)行的入口函數(shù)是runQuantizeModel
void Calibration::runQuantizeModel(){
if(_featureQuantizeMethod=="KL"){
_computeFeatureScaleKL();
}else if(_featureQuantizeMethod=="ADMM"){
_computeFeatureScaleADMM();
}
if(_debug){
_computeQuantError();
}開(kāi)發(fā)詳情I35源碼7O98開(kāi)發(fā)O7I8
_updateScale();
//對(duì)于不支持量化的算子,對(duì)其輸入進(jìn)行逆量化成float32數(shù)據(jù),對(duì)其輸出,如果下面的算子需要量化,則將輸出量化
_insertDequantize();
}
計(jì)算最有閾值
以KL量化方法為例,看_computeFeatureScaleKL函數(shù)。
void Calibration::_computeFeatureScaleKL(){
//統(tǒng)計(jì)每個(gè)通道上數(shù)據(jù)的分布直方圖
_computeFeatureMapsRange();
_collectFeatureMapsDistribution();
_scales.clear();源碼及案例:MrsFu123
for(auto&iter:_featureInfo){
AUTOTIME;
_scales[iter.first]=iter.second->finishAndCompute();
}
//_featureInfo.clear();//No need now
}