量化合約開(kāi)發(fā)(詳情及規(guī)則),量化合約系統(tǒng)開(kāi)發(fā)(項(xiàng)目及方案)
First of all,we should clarify the basic concept of quantitative trading: Quantitative trading refers to an investment method that uses modern statistics and mathematical methods to trade through computer technology.Quantitative trading selects a variety of"high probability"events that can achieve excess returns from massive historical data to formulate strategies,uses quantitative models to verify and solidify these laws and strategies,and then strictly implements the solidified strategies to guide investment,in order to obtain sustained,stable and higher than average returns. int main(int argc,const char*argv[]){ if(argc<4){ DLOG(INFO)<<"Usage:./quantized.out src.mnn dst.mnn preTreatConfig.jsonn"; return 0; }需求及案例源碼I35設(shè)計(jì)7O98開(kāi)發(fā)O7I8? const char*modelFile=argv[1]; const char*preTreatConfig=argv[3]; const char*dstFile=argv[2]; DLOG(INFO)<<">>>modelFile:"<<modelFile; DLOG(INFO)<<">>>preTreatConfig:"<<preTreatConfig; DLOG(INFO)<<">>>dstFile:"<<dstFile std::unique_ptr<MNN::NetT>netT; {//讀取原始的model文件,借助于flattbuffer生成Net對(duì)象 std::ifstream input(modelFile); std::ostringstream outputOs; outputOs<<input.rdbuf(); netT=MNN::UnPackNet(outputOs.str().c_str());//獲取Net對(duì)象 }開(kāi)發(fā)方案及項(xiàng)目:MrsFu123 //temp build net for inference flatbuffers::FlatBufferBuilder builder(1024); auto offset=MNN::Net::Pack(builder,netT.get());//打包模型準(zhǔn)備放入buffer中 builder.Finish(offset); int size=builder.GetSize(); auto ocontent=builder.GetBufferPointer(); //創(chuàng)建兩個(gè)buffer,兩個(gè)都用來(lái)放模型數(shù)據(jù) std::unique_ptr<uint8_t>modelForInference(new uint8_t[size]); memcpy(modelForInference.get(),ocontent,size); std::unique_ptr<uint8_t>modelOriginal(new uint8_t[size]); memcpy(modelOriginal.get(),ocontent,size); netT.reset(); netT=MNN::UnPackNet(modelOriginal.get()); //進(jìn)行量化操作,主要這個(gè)靠的是Calibration類(lèi) DLOG(INFO)<<"Calibrate the feature and quantize model..."; std::shared_ptr