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

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

FDF互助游戲開發(fā)原理丨FDF互助智能合約游戲系統(tǒng)開發(fā)(開發(fā)規(guī)則及詳情)

2023-03-07 16:10 作者:bili_16249894763  | 我要投稿

  From Web1.0 to Web3.0,from user read-only to user owned.Web1.0 is a read-only network,a static and one-way network,representing browsers and e-commerce;Web 2.0 pays more attention to user interaction.Users are both browsers and content producers.


The mode of development is from"read"to"write",and the representative products are social media and short video platforms;Web3.0 is the Internet of Value,and Web3.0 is a set of inclusive protocols that provide building blocks for application manufacturers


  void Calibration::_fake_quant_weights(){


  //找到權(quán)重中最大值(絕對值)的lamda函數(shù)


  auto findAbsMax=[&](const float*weights,const int size){


  float absMax=0;


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


  if(std::fabs(weights<i>)>absMax){


  absMax=std::fabs(weights<i>);


  }


  }


  return absMax;


  };


  for(const auto&op:_originaleModel->oplists){


  //跳過指定不需要量化的op,以及非Convolution


  std::vector<std::string>::iterator iter=std::find(_skip_quant_ops.begin(),_skip_quant_ops.end(),op->name);


  if(iter!=_skip_quant_ops.end()){需求及詳情I35模式7O98開發(fā)O7I8


  continue;


  }


  const auto opType=op->type;


  if(opType!=MNN::OpType_Convolution&&opType!=MNN::OpType_ConvolutionDepthwise){


  continue;


  }開發(fā)功能及源碼:MrsFu123


  auto param=op->main.AsConvolution2D();


  const int kernelNum=param->common->outputCount;


  std::vector<float>weights=param->weight;


  const int weightSize=weights.size();


  const int kernelSize=weightSize/kernelNum;


  //對每個kernel進(jìn)行量化


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


  const int offset=i*kernelSize;


  float absMax=findAbsMax(weights.data()+offset,kernelSize);


  float scale=absMax/_weightClampValue;//根據(jù)最大值計算縮放因子


  if(absMax<1e-6f){


  scale=absMax;


  }


  for(int j=0;j<kernelSize;j++){


  float value=weights[offset+j];


  float quantValue=std::round(value/scale);//量化到int8的值


  float clampedValue=std::max(std::min(quantValue,_weightClampValue),-_weightClampValue);//小于-127的部分,映射到-127


  float dequantValue=scale*clampedValue;


  param->weight[offset+j]=dequantValue;//反量化


  }


  }


  }


  }


FDF互助游戲開發(fā)原理丨FDF互助智能合約游戲系統(tǒng)開發(fā)(開發(fā)規(guī)則及詳情)的評論 (共 條)

分享到微博請遵守國家法律
特克斯县| 邯郸县| 彰武县| 昌图县| 三台县| 东阳市| 洛浦县| 贵溪市| 拉孜县| 泰兴市| 上林县| 金湖县| 尼玛县| 金寨县| 环江| 新泰市| 淮北市| 通渭县| 桓台县| 微博| 博兴县| 吉木乃县| 宁明县| 翁牛特旗| 永善县| 馆陶县| 晋州市| 新建县| 理塘县| 新疆| 新竹市| 资溪县| 安龙县| 两当县| 泽州县| 旌德县| 多伦县| 仙游县| 鄂托克旗| 竹北市| 怀柔区|