源码FDF互助循环游戏系统开发(逻辑)丨智能合约(开发详情)
人工智能是一门研究如何使机器能够智能地行动的学科,也是现代人工智能技术制造核心的技术之一。随着人工智能的发展,利用大数据和机器学习等技术,使制造过程更加智能化和自动化。例如,生产计划和调度等工作可以由机器自动完成,同时通过机器学习技术,制造过程中的一些异常情况也可以被及时识别和处理。void Calibration::_updateScale(){开发详情v;wwqqyy420
for(const auto&op:_originaleModel->oplists){
std::vector<std::string>::iterator iter=std::find(_skip_quant_ops.begin(),_skip_quant_ops.end(),op->name);
if(iter!=_skip_quant_ops.end()){
continue;
}
const auto opType=op->type;
if(opType!=MNN::OpType_Convolution&&opType!=MNN::OpType_ConvolutionDepthwise&&
opType!=MNN::OpType_Eltwise){
continue;
}
auto tensorsPair=_opInfo.find(op->name);
if(tensorsPair==_opInfo.end()){
MNN_ERROR("Can't find tensors for%sn",op->name.c_str());
if(opType==MNN::OpType_Eltwise){
auto param=op->main.AsEltwise();
//Now only support AddInt8
if(param->type!=MNN::EltwiseType_SUM){
continue;
}
const auto&inputScale0=_scales[tensorsPair->second.first[0]];
const auto&inputScale1=_scales[tensorsPair->second.first[1]];
const auto&outputScale=_scales[tensorsPair->second.second[0]];
const int outputScaleSize=outputScale.size();
std::vector<float>outputInvertScale(outputScaleSize);
Helper::invertData(outputInvertScale.data(),outputScale.data(),outputScaleSize);
op->type=MNN::OpType_EltwiseInt8;
op->main.Reset();
op->main.type=MNN::OpParameter_EltwiseInt8;
auto eltwiseInt8Param=new MNN::EltwiseInt8T;
auto input0ScaleParam=new MNN::QuantizedFloatParamT;
auto input1ScaleParam=new MNN::QuantizedFloatParamT;
auto outputScaleParam=new MNN::QuantizedFloatParamT;
input0ScaleParam->tensorScale=inputScale0;
input1ScaleParam->tensorScale=inputScale1;
outputScaleParam->tensorScale=outputInvertScale;
eltwiseInt8Param->inputQuan0=std::unique_ptr<MNN::QuantizedFloatParamT>(input0ScaleParam);
eltwiseInt8Param->inputQuan1=std::unique_ptr<MNN::QuantizedFloatParamT>(input1ScaleParam);
eltwiseInt8Param->outputQuan=std::unique_ptr<MNN::QuantizedFloatParamT>(outputScaleParam);
op->main.value=eltwiseInt8Param;
continue;
}开发模式及分析:wwqqyy420
//below is Conv/DepthwiseConv
const auto&inputScale=_scales[tensorsPair->second.first[0]];
const auto&outputScale=_scales[tensorsPair->second.second[0]];
auto param=op->main.AsConvolution2D();
const int channles=param->common->outputCount;
const int weightSize=param->weight.size();
param->symmetricQuan.reset(new MNN::QuantizedFloatParamT);
//quantizedParam是param->symmetricQuan的引用
auto&quantizedParam=param->symmetricQuan;
quantizedParam->scale.resize(channles);
quantizedParam->weight.resize(weightSize);
quantizedParam->bias.resize(channles);
if(opType==MNN::OpType_Convolution){
QuantizeConvPerChannel(param->weight.data(),param->weight.size(),param->bias.data(),
quantizedParam->weight.data(),quantizedParam->bias.data(),
quantizedParam->scale.data(),inputScale,outputScale,_weightQuantizeMethod,_weightClampValue);
op->type=MNN::OpType_ConvInt8;
}else if(opType==MNN::OpType_ConvolutionDepthwise){
QuantizeDepthwiseConv(param->weight.data(),param->weight.size(),param->bias.data(),
quantizedParam->weight.data(),quantizedParam->bias.data(),
quantizedParam->scale.data(),inputScale,outputScale,_weightQuantizeMethod,_weightClampValue);
op->type=MNN::OpType_DepthwiseConvInt8;
}
if(param->common->relu6){
param->common->relu=true;
param->common->relu6=false;
源码FDF互助循环游戏系统开发逻辑智能合约开发详情
广州网站/软件服务相关信息
3天前
1月6日
1月3日
1月2日
2024-12-31
2024-12-30
2024-12-27
2024-12-26
2024-12-25
2024-12-24