国产精品天干天干,亚洲毛片在线,日韩gay小鲜肉啪啪18禁,女同Gay自慰喷水

歡迎光臨散文網(wǎng) 會(huì)員登陸 & 注冊(cè)

量化合約交易機(jī)器人系統(tǒng)開發(fā)(項(xiàng)目開發(fā))丨合約量化交易機(jī)器人系統(tǒng)開發(fā)(成熟案例)

2023-06-15 10:12 作者:bili_36625761919  | 我要投稿

數(shù)據(jù)層我們可以理解成數(shù)據(jù)庫(kù),只不過對(duì)于區(qū)塊鏈來講,這個(gè)數(shù)據(jù)庫(kù)是不可篡改的、分布式的數(shù)據(jù)庫(kù),也就是我們所謂的“分布式賬本”在數(shù)據(jù)層上,也就是在這個(gè)“分布式賬本”上,存放著區(qū)塊鏈上的數(shù)據(jù)信息,封裝著區(qū)塊的塊鏈?zhǔn)浇Y(jié)構(gòu)、非對(duì)稱加密技術(shù)、哈希算法等技術(shù)手段,來保證數(shù)據(jù)在全網(wǎng)公開的情況下的安全性問題。


區(qū)塊鏈最常見的數(shù)據(jù)結(jié)構(gòu)當(dāng)然就是單鏈?zhǔn)浇Y(jié)構(gòu),像一條鐵鏈一樣,一個(gè)節(jié)點(diǎn)只有一個(gè)前序節(jié)點(diǎn)和一個(gè)后續(xù)節(jié)點(diǎn)。


  int main(int argc,const char*argv[]){


  if(argc<4){


  DLOG(INFO)<<"Usage:./quantized.out src.mnn dst.mnn preTreatConfig.jsonn";


  return 0;


  }


  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;


  {


  std::ifstream input(modelFile);


  std::ostringstream outputOs;


  outputOs<<input.rdbuf();


  netT=MNN::UnPackNet(outputOs.str().c_str());


  }


  //temp build net for inference


  flatbuffers::FlatBufferBuilder builder(1024);


  auto offset=MNN::Net::Pack(builder,netT.get());


  builder.Finish(offset);


  int size=builder.GetSize();


  auto ocontent=builder.GetBufferPointer();


  //model buffer for creating mnn Interpreter


  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());


  //quantize model's weight


  DLOG(INFO)<<"Calibrate the feature and quantize model...";


  //構(gòu)建Calibration對(duì)象,負(fù)責(zé)量化


  std::shared_ptr<Calibration>calibration(


  new Calibration(netT.get(),modelForInference.get(),size,preTreatConfig));


  //執(zhí)行量化,更新參數(shù)為int8


  calibration->runQuantizeModel();


  //將量化的參數(shù)寫入json文件


  calibration->dumpTensorScales(dstFile);


  DLOG(INFO)<<"Quantize model done!";


  //保存量化后的模型


  flatbuffers::FlatBufferBuilder builderOutput(1024);


  builderOutput.ForceDefaults(true);


  auto len=MNN::Net::Pack(builderOutput,netT.get());


  builderOutput.Finish(len);


  {


  std::ofstream output(dstFile);


  output.write((const char*)builderOutput.GetBufferPointer(),builderOutput.GetSize());


  }


  return 0;


  }


量化合約交易機(jī)器人系統(tǒng)開發(fā)(項(xiàng)目開發(fā))丨合約量化交易機(jī)器人系統(tǒng)開發(fā)(成熟案例)的評(píng)論 (共 條)

分享到微博請(qǐng)遵守國(guó)家法律
宁夏| 长武县| 沾化县| 鄂托克前旗| 逊克县| 万安县| 镇原县| 太康县| 新营市| 广宁县| 樟树市| 南川市| 卢龙县| 台安县| 沙雅县| 安徽省| 许昌市| 聂荣县| 调兵山市| 邵阳县| 杭锦旗| 潍坊市| 庄浪县| 卢龙县| 郎溪县| 望城县| 保山市| 海口市| 伊宁县| 安乡县| 准格尔旗| 武汉市| 庆云县| 岳阳市| 玉田县| 金乡县| 龙井市| 习水县| 博野县| 通州市| 利川市|