优化-拉格朗日乘子法简述

简介: Lagrange Multipliers are used to solve the optimal value of multivariate functions under a group of constraints. By lagrange multipliers, we can convert an optimal problem with dd variables

Lagrange Multipliers are used to solve the optimal value of multivariate functions under a group of constraints. By lagrange multipliers, we can convert an optimal problem with d variables and k constraints to one with d+k variables without constraint.

  1. Equality Constraint
    Suppose xRd, we would like to solve some optimal value x s. t. minxf(x) and g(x)=0, i.e.
    minxf(x),s.t.g(x)=0

    For simplicity, we omit the geometric explanation of the optimal problem. Define the Lagrange multiplier λ0 s.t.
    f(x)+λg(x)=0

    Define the corresponding Lagrange funcntion as
    L(x,λ)=f(x)+λg(x)

    So
    xL(x,λ)=f(x)+λg(x)=0

    λL(x,λ)=g(x)=0

    Obviously, the original optimal problem is converted to the new optimal problem with no constraint.
  2. Inequality Constraint
    In the inequality constraint case, the optimal problem can be defined as
    minxf(x),s.t.g(x)0

    When g(x)<0, the constraint g(x)0 makes no sense which means that we can take f(x)=0 to solve the optimal problem. In addition, when g(x)=0, the inequality constraint degrades to the equality constraint.
    In summary, the KKT (Karush-Kuhn-Tucker) conditions are always satisfied:
    g(x)0;λ0;λg(x)=0

    With efficiency concerned, we show the solution of the optimal problem together with next problem. Go on.
  3. Multi-constraints
    Consider an optimal problem with m equality constraints and n inequality constraints. In addition there is a feasible region DRd:
    minxs.t.f(x)hi(x)=0,i=1,2,,m,gj(x)0,j=1,2,,n

    Define the lagrange function as
    L(x,λ,μ)=f(x)+i=1mλihi(x)+j=1nμjgj(x)

    Since there are inequality constraints, the KKT condition is followed:
    gj(x)0;μj0;μjgj(x)=0.

    Solving the original optimal problem, also known as primal problem, can be achieved by solving the corresponding dual problem. Then the Lagrange dual function Γ:Rm×RnR is defined as
    Γ(λ,μ)=infxDL(x,λ,μ)=infxDf(x)+i=1mλihi(x)+j=1nμjgj(x)

    Evidently, mi=1λihi(x)+nj=1μjgj(x)0. Let x~D, then
    Γ(λ,μ)=infxDL(x,λ,μ)L(x~,λ,μ)f(x~)
    That is to say, the dual function shows the lower bound of the value of the primal problem. Then the dual problem is given by
    maxλ,μΓ(λ,μ)s.t.μ0

    The dual problem is always a convex optimal problem, regardless of the convexity of the primal problem.

Let p be the optimal value of the primal problem, d be the optimal value of the dual problem. It has been shown that dp which is also known as weak duality. If d=p, then strong duality holds. Generally, the strong duality does not always hold. However, when the primal problem is a convex optimal problem, i.e. f(x),gj(x) are convex functions, hi(x) are affine functions and there exists a least one x~ making the inequality constraints strictly hold, the strong duality holds. In this case, take the derivative of the Lagrange function over x, λ and μ and set it to be zero. Then we can solve the dual problem as well as the primal problem.

相关文章
|
算法 数据挖掘 Go
文献速读|5分生信+免疫组化单细胞联合bulk转录组肿瘤预后模型
研究摘要: 在《Cancer Immunology Immunotherapy》上发表的一篇文章,通过整合Bulk和单细胞RNA-seq数据,探讨了非小细胞肺癌(NSCLC)中癌相关纤维细胞(CAF)的作用。研究者识别出CAF的预后标志物,构建了一个基于CAF的模型,该模型在四个独立队列中区分了预后良好的和较差的患者。WGCNA分析鉴定出CAF标记基因,而CAF分数与免疫微环境和免疫治疗反应相关。高CAF分数关联较差的免疫治疗反应,FBLIM1被发现为CAF的主要来源,其高表达预测了免疫疗法的不良反应。该研究揭示了CAF在NSCLC免疫抑制和治疗策略中的重要地位。
505 1
|
机器学习/深度学习 算法
大模型开发:什么是过拟合和欠拟合?你如何防止它们?
机器学习中,过拟合和欠拟合影响模型泛化能力。过拟合是模型对训练数据过度学习,测试集表现差,可通过正则化、降低模型复杂度或增加训练数据来缓解。欠拟合则是模型未能捕捉数据趋势,解决方案包括增加模型复杂度、添加特征或调整参数。平衡两者需通过实验、交叉验证和超参数调优。
2193 0
|
存储 缓存 监控
Vue.js 九个性能优化技巧
【10月更文挑战第16天】Vue.js 性能优化是一个持续的过程,需要我们不断地探索和实践。通过合理使用上述九个技巧,并结合具体的项目需求和性能指标,我们可以不断地提高 Vue.js 应用的性能和用户体验。
|
负载均衡 安全 Java
Java一分钟之-WebSocket:实时通信协议
【6月更文挑战第1天】WebSocket是实现客户端与服务器长连接、双向通信的协议,简化实时数据传输。Java中的WebSocket实现基于JSR 356。本文涵盖WebSocket基础(持久连接、双向通信、低延迟)、工作流程、常见问题(安全、连接管理、数据编码)及Java实现示例,强调错误处理、心跳机制和资源管理的最佳实践。
876 6
|
存储 缓存 安全
从原理到实践:掌握DPDK内存池技术(下)
从原理到实践:掌握DPDK内存池技术
|
Kubernetes Docker Python
如何在K8s中使用Python应用
一文带你了解如何在K8s中使用Python应用
477 4
|
Shell Linux Go
Go 语言入门很简单:Go 语言执行 Shell 命令(上)
Exec 是 os 包中的一个子包,它可用于使用 Go 运行外部命令。Go exec 命令教程展示了如何在 Golang 中执行 shell 命令和程序。
|
机器学习/深度学习 人工智能 搜索推荐
构建未来:基于AI的自适应学习系统
【4月更文挑战第28天】 随着人工智能技术的不断进步,其在教育领域的应用也日益广泛。本文将探讨如何利用AI技术构建一个自适应学习系统,以提供更加个性化的学习体验。我们将讨论AI在教育中的应用,包括智能教学系统的设计、学习内容的个性化推荐以及学习进度的自动调整等方面。此外,我们还将探讨如何通过数据分析来优化学习过程,以及如何保护学习者的隐私。
493 0
技术创新与个人成长的思考
技术创新是时代的推动力,而在不断迭代的科技领域中,个人成长也同样需要不断的探索和进步。本文将从个人角度出发,探讨技术创新对个人成长的影响,并分享在技术道路上的感悟与体会。
399 0
|
Docker Python Windows
Docker selenium 自动化 - 使用python操作docker,python运行、启用、停用和查询容器实例演示
Docker selenium 自动化 - 使用python操作docker,python运行、启用、停用和查询容器实例演示
1477 0
Docker selenium 自动化 - 使用python操作docker,python运行、启用、停用和查询容器实例演示