量化合约跟单/交易所API跟单系统开发(开发案例)/详细策略/成熟方案/源码程序
人工智能技术是智能工业时代的核心技术之一。人工智能技术包括机器学习、深度学习、自然语言处理、计算机视觉等。这些技术的应用使得机器能够自主地学习、理解和判断,可以帮助工业企业实现自动化、智能化和高效化的生产和管理。
从本质上说,交易机器人是一种软件程序,它直接与金融交易所进行交互(通常使用API获取和解释相关信息),并根据市场数据的解释发出买卖订单。这些机器人通过监测市场价格走势,并根据一套预先设定和编程的规则做出反应,从而做出这些决定。
通常,一个交易机器人会分析市场行为,例如交易量、订单、价格和时间,它们通常可以根据您自己的喜好进行编程。
量化交易是在交易阶段由计算机自动进行的一种投资模式,它是对人类的投资理念进行规范化、变量化、模型化,形成一整套可量化的操作理念,并用历史数据进行分析和验证。
class Calibration{
public:
//参数原始模型,模型uint8_t buffer,size,json配置文件
Calibration(MNN::NetT*model,uint8_t*modelBuffer,const int bufferSize,const std::string&configPath);
void runQuantizeModel();
private:
Calibration();
MNN::NetT*_originaleModel;//需要量化的模型
std::shared_ptr<MNN::CV::ImageProcess>_process;//负责image到tensor的转化类
const int _binNums=2048;
int _imageNum=0;
int _width;
int _height;
std::vector<std::string>_imgaes;//图片,用于校正特征量化系数的
//Tensor and Info
//tensor到对应的TensorStatistic,TensorStatistic是描述tensor在量化过程中需要的统计数据,后面有解释
std::map<const MNN::Tensor*,std::shared_ptr<TensorStatistic>>_featureInfo;
//所有的tensor
std::map<int,const MNN::Tensor*>_tensorMap;
//Op's name,Inputs,Outputs
//op到input/output tensor的映射
std::map<std::string,std::pair<std::vector<MNN::Tensor*>,std::vector<MNN::Tensor*>>>_opInfo;
//The scale results
std::map<const MNN::Tensor*,std::vector<float>>_scales;
std::shared_ptr<MNN::Interpreter>_interpreter;
//keep mnn forward information
MNN::Session*_session;
MNN::Tensor*_inputTensor;
std::vector<int>_inputTensorDims;
std::string _featureQuantizeMethod="KL";
std::string _weightQuantizeMethod="MAX_ABS";
void _initMNNSession(const uint8_t*modelBuffer,const int bufferSize,const int channels);
void _initMaps();
void _computeFeatureMapsRange();
void _collectFeatureMapsDistribution();
void _computeFeatureScaleKL();
void _computeFeatureScaleADMM();
void _updateScale();
//insert the dequantization op before the not supported op(int8),and insert dequantization op
//after the output op,so that get original float data conveniently
void _insertDequantize();
};
#endif//CALIBRATION_HPP