秒合约开发(稳定版)丨秒合约系统开发(开发案例)丨秒合约系统源码详情

简介:  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 strategie。

  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;

  }

  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对象

  std::ifstream input(modelFile);

  std::ostringstream outputOs;

  outputOs<<input.rdbuf();

  netT=MNN::UnPackNet(outputOs.str().c_str());//获取Net对象

  }开发方案及项目:MrsFu123

  ​

  //temp build net for inference

  flatbuffers::FlatBufferBuilder builder(1024);

  auto offset=MNN::Net::Pack(builder,netT.get());//打包模型准备放入buffer中

  builder.Finish(offset);

  int size=builder.GetSize();

  auto ocontent=builder.GetBufferPointer();

  ​

  //创建两个buffer,两个都用来放模型数据

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

  ​

  //进行量化操作,主要这个靠的是Calibration类

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

  std::shared_ptr<Calibration>calibration(

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

  calibration->runQuantizeModel();

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

  //量化后的模型写入到FlatBufferBuilder

  flatbuffers::FlatBufferBuilder builderOutput(1024);

  builderOutput.ForceDefaults(true);

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

  builderOutput.Finish(len);

  //FlatBufferBuilder的内容写入文件,得到量化模型

  {

  std::ofstream output(dstFile);

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

  }

  }

相关文章
|
安全
公网IP和私网IP
公网IP和私网IP
2194 1
|
存储 前端开发 Java
一文理解什么是DTO、VO、BO、PO、DO,并推荐一款IDEA转换插件
一文理解什么是DTO、VO、BO、PO、DO,并推荐一款IDEA转换插件
2279 0
一文理解什么是DTO、VO、BO、PO、DO,并推荐一款IDEA转换插件
|
Web App开发
Web QQ自动强制加好友代码
也许见过强行聊天的代码:  tencent://Message/?Uin=574201314&websiteName=www.oicqzone.com&Menu=yes   但是你应该不知道,还有强行加好友的代码: tencent://AddContact/?fromId=45&f...
7217 0
|
3月前
|
存储 弹性计算 数据库
阿里云国内版和国际版有什么区别?账号、价格、备案与适用场景全面对比
聚合云www.juhecloud.online为您讲解两者的区别,聚合云可以一键上云,更低折扣。阿里云国内版(aliyun.com)与国际版(alibabacloud.com)是两个独立平台,核心差异在于账号体系、实名认证、支付币种(人民币vs美元)、税务发票、ICP备案支持及合同主体。国内版适配内地企业、人民币结算与备案需求;国际版面向境外主体,支持多币种、国际发票及全球部署。选错平台将影响合规与迁移成本。
|
Unix Linux iOS开发
Vulkan开发实战详解
Vulkan开发实战详解
767 4
|
人工智能 运维 监控
2025 AI 原生编程挑战赛 数据获取文档
本文介绍了参赛者如何配置阿里云服务以参加AI运维赛。首先开通阿里云日志服务,随后创建RAM用户并为其分配访问权限。接着为该用户授权,确保其具备读取数据的权限。最后,可选地创建或重新生成AccessKey以用于后续的数据查询操作。整个流程帮助选手完成基础环境配置,以便使用阿里云日志服务进行数据分析。
3040 2
|
机器学习/深度学习 人工智能 自然语言处理
AI 驱动:如何用AI直接生成矢量 Logo? 技术研究与工具选择
AI 技术革新品牌标志设计,通过深度学习分析数据,精准把握市场趋势,智能生成高辨识度 Logo。矢量格式(SVG)确保清晰不失真,适配各类展示场景。AI 工具高效便捷,支持个性化定制,助力品牌快速打造专业视觉形象,成为市场竞争中的有力武器。
924 0
|
机器学习/深度学习 PyTorch TensorFlow
DGL(0.8.x) 技术点分析
DGL是由Amazon发布的图神经网络开源库,支持TensorFlow、PyTorch和MXNet。DGL采用消息传递范式进行图计算,包括边上计算、消息函数、点上计算、聚合与更新函数等。其架构分为顶层业务抽象、Backend多后端适配、Platform高效计算适配以及C++性能敏感功能层,确保高效、灵活的图神经网络开发。
1186 21
|
XML JSON 算法
智能冰箱食材识别
本案例设计了一个囤菜系统原型,主要方法是利用冰箱内安装的摄像头,通过目标检测算法识别食材类别,判断存取动作,增加或者减少相应的食材的数量,并记录存取时间等相关数据,设计出了具备提示清理和补货等功能的智能化囤菜系统原型。
1417 8
|
Web App开发 弹性计算 安全
如何将自己的网站上传到阿里云服务器
部署,服务器,上传,阿里云,网站

热门文章

最新文章