algorithm - 如何在使用随机梯度下降的约束优化问题中计算拉格朗日乘数?
问题描述
我正在尝试在以下论文https://downloads.hindawi.com/journals/jmath/2021/8892636.pdf中复制随机梯度下降算法
该算法在论文的第 4 页(算法 1)中进行了概述:
Data: given the initial value w(0)=w0, the number of samples n, the step size α, and the tolerance ε.
Set k = 0.
Step 1: evaluate the augmented objective function from (16).
Step 2: compute the stochastic gradient from (20).
Step 3: set the random index j.
Step 4: update the vector w(k) from (21).
If ‖w(k+1) − w(k)‖ < ε, then stop the iteration. Otherwise, set k = k + 1, and repeat from Step 1.
Remark:
e tolerance is ε = 10− 6, and the learning rate is α = 0.001
我在第 1 步苦苦挣扎,评估增强的目标函数 (16) 并试图了解拉格朗日乘数是如何得出的。功能如下:
f(w) = 0.5wTEw + l1(R - wTu) + l2(1 - wT1) + l3
where:
wT = Transpose of the weights vector (initial value set at (0.3,0.3,0.4) in the paper)
E = Covariance matrix (set equal to the example in the paper)
w = weights vector
l1 = Lagrange multiplier one
R = Required rate of return (set equal to the paper example at 0.065)
u = vector of expected returns (set equal to the paper at (0.1073, 0.0737, 0.0627)
l2 = Lagrange multiplier two
l3 = Lagrange multiplier three which the paper states equals 0
除了拉格朗日乘数 1 和 2 之外,该方程中的所有变量在每次迭代中都是已知的,我无法理解这些变量是如何得出的。拉格朗日 3 我理解为 0。
我不相信会做出初步估计,因为我看不到调整 l1 和 l2 的阶段,即根据梯度调整权重,这使我认为这些值是从一些概述的目标函数中得出的方式,然后插入第 2 步计算梯度。
在示例中,该论文概述了它确实说明了最终基于最优解得出的 l1 和 l2 值。
仅供参考,我正在用 Rust 编写算法。
解决方案
推荐阅读
- javascript - 如何从 Create React App /build 文件夹制作 npm 包?
- ios - 如何在 UIImageView 中获取 UIImage 的 x 和 y 位置?
- angular - 在我的 Angular 项目中实现 webassembly
- kubernetes - 速率限制不限制任何东西
- x86 - 今天的 BIOS 怎么能大于 64KB?
- python - 从数据框中的列表中添加新列但列表的值多于数据框中的总行数
- c - displayStack 函数打印随机字母
- amazon-web-services - 从 dynamodb 复制到 s3
- delphi - Delphi Tokyo 10.2 需要从 repo 更新代码后重建整个项目
- git - 从 GitHub 克隆一个 Forked 项目