参考Princeton在2021的论文《End-to-End Risk Budgeting Portfolio Optimization with Neural Networks》,实现基于FactorModel的组合优化:人工构建大类资产因子,然后输入神经网络映射为风险预算,再对接CvxpyLayers 优化得到资产权重。模型整合了因子合成和组合优化两个步骤。模型构建流程如: 选取5个大类资产如指数,国债指数,...
问如何构造一个SOCP问题并使用cvxpy和cvxpylayers来解决ENTRIZ基础 现代TRIZ 经典的TRIZ方法对专利进行分析...
Source File: cvxpy_examples.py From cvxpylayers with Apache License 2.0 5 votes def full_qp(): # print(f'--- {sys._getframe().f_code.co_name} ---') print('full qp') npr.seed(0) nx, ncon_eq, ncon_ineq = 5, 2, 3 Q = cp.Parameter((nx, nx)) p = cp.Parameter((...
Source File: test_cvxpylayer.py From cvxpylayers with Apache License 2.0 6 votes def test_lml(self): tf.random.set_seed(0) k = 2 x = cp.Parameter(4) y = cp.Variable(4) obj = -x * y - cp.sum(cp.entr(y)) - cp.sum(cp.entr(1. - y)) cons = [cp.sum(y) == k] ...
Differentiable convex optimization layers. Contribute to cvxgrp/cvxpylayers development by creating an account on GitHub.