最美情侣中文字幕电影,在线麻豆精品传媒,在线网站高清黄,久久黄色视频

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

馬蹄鏈智能合約開發(fā)詳情丨DAPP馬蹄鏈智能合約流動(dòng)性質(zhì)押挖礦系統(tǒng)開發(fā)技術(shù)方案及邏輯

2023-03-08 15:07 作者:bili_33032327742  | 我要投稿

  Web3.0技術(shù)可分為基礎(chǔ)層技術(shù)、平臺(tái)層技術(shù)、交互層技術(shù)。相較于Web2.0時(shí)代,Web3.0涉及細(xì)分技術(shù)類別更多、范圍更廣,其中區(qū)塊鏈技術(shù)由于其去中心化的特征,成為Web3.0核心底層基礎(chǔ)技術(shù)。


  int SymmetricQuantizeWeight(const float*weight,const int size,int8_t*quantizedWeight,float*scale,


  const int channels,float weightClampValue){


  /**對(duì)參數(shù)進(jìn)行量化


  *weight為乘上scale后的權(quán)重,


  *quantizedWeight用于存放量化后的參數(shù)


  ***/


  DCHECK((size%channels)==0)<<"weight size error!";


  const int channelStride=size/channels;


  const int quantizedMaxValue=weightClampValue;//127


  for(int c=0;c<channels;++c){//對(duì)每個(gè)channel分別量化


  const auto weightChannelStart=weight+c*channelStride;


  auto quantizedWeightChannelStart=quantizedWeight+c*channelStride;


  //獲取該channel內(nèi)最大最小值


  auto minmaxValue=std::minmax_element(weightChannelStart,weightChannelStart+channelStride);


  const float dataAbsMax=std::fmax(std::fabs(*minmaxValue.first),std::fabs(*minmaxValue.second));


  float scaleDataToInt8=1.0f;


  if(dataAbsMax==0){


  scale[c]=0.0f;


  }else{案例及詳解I59模式2OO7開發(fā)3O69


  //用于逆量化時(shí)對(duì)用的scale


  scale[c]=dataAbsMax/quantizedMaxValue;


  //映射到int8空間上的scale


  scaleDataToInt8=quantizedMaxValue/dataAbsMax;


  }


  for(int i=0;i<channelStride;++i){


  //將輸入權(quán)重乘上scale映射到int8上之后,對(duì)不在[-127,127]區(qū)間的都截?cái)嘣O(shè)置為-127或者127.


  const int32_t quantizedInt8Value=static_cast<int32_t>(roundf(weightChannelStart<i>*scaleDataToInt8));


  quantizedWeightChannelStart<i>=


  std::min(quantizedMaxValue,std::max(-quantizedMaxValue,quantizedInt8Value));


  }功能及開發(fā):yy625019


  }


  return 0;


  }


馬蹄鏈智能合約開發(fā)詳情丨DAPP馬蹄鏈智能合約流動(dòng)性質(zhì)押挖礦系統(tǒng)開發(fā)技術(shù)方案及邏輯的評(píng)論 (共 條)

分享到微博請(qǐng)遵守國家法律
祥云县| 嵊州市| 英吉沙县| 吉水县| 吴旗县| 闽侯县| 北川| 永济市| 阳新县| 张掖市| 华池县| 讷河市| 曲沃县| 盐边县| 长治市| 邵阳市| 武功县| 册亨县| 舒兰市| 雷州市| 时尚| 吴桥县| 常山县| 绥德县| 蓝田县| 丁青县| 深水埗区| 厦门市| 鄂温| 神木县| 宁晋县| 丰台区| 乌鲁木齐市| 南宁市| 军事| 门头沟区| 依安县| 凤山市| 潮州市| 灌云县| 房产|