-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit aee8215
Showing
96 changed files
with
5,750 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
.DS_Store | ||
Thumbs.db | ||
db.json | ||
debug.log | ||
node_modules/ | ||
public/ | ||
.deploy/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# !/bin/bash | ||
|
||
if [ $# = 0 ]; | ||
then | ||
cmd="Just another push" | ||
else | ||
cmd=$* | ||
fi | ||
|
||
git add -A | ||
git commit -m "$cmd" | ||
git pull | ||
git push origin master |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,99 @@ | ||
# Hexo Configuration | ||
## Docs: http://hexo.io/docs/configuration.html | ||
## Source: https://github.com/hexojs/hexo/ | ||
|
||
# Site | ||
title: Just follow your heart | ||
subtitle: Everything is possible if you have the real passion to what you do | ||
description: Just another blog | ||
author: Lijian | ||
email: [email protected] | ||
language: zh-Hans | ||
|
||
# URL | ||
## If your site is put in a subdirectory, set url as 'http://yoursite.com/child' and root as '/child/' | ||
url: http://lingdian618.github.io/ | ||
root: / | ||
permalink: :year/:month/:day/:title/ | ||
tag_dir: tags | ||
archive_dir: archives | ||
category_dir: categories | ||
code_dir: downloads/code | ||
permalink_defaults: | ||
|
||
# Directory | ||
source_dir: source | ||
public_dir: public | ||
|
||
# Writing | ||
# new_post_name: :year-:month-:day-:title.md # File name of new posts | ||
new_post_name: :title.md | ||
default_layout: post | ||
titlecase: false # Transform title into titlecase | ||
external_link: true # Open external links in new tab | ||
filename_case: 0 | ||
render_drafts: false | ||
post_asset_folder: false | ||
relative_link: false | ||
highlight: | ||
enable: true | ||
line_number: true | ||
tab_replace: | ||
|
||
# Category & Tag | ||
default_category: uncategorized | ||
category_map: | ||
tag_map: | ||
|
||
# Archives | ||
## 2: Enable pagination | ||
## 1: Disable pagination | ||
## 0: Fully Disable | ||
archive: 2 | ||
category: 2 | ||
tag: 2 | ||
|
||
# Server | ||
## Hexo uses Connect as a server | ||
## You can customize the logger format as defined in | ||
## http://www.senchalabs.org/connect/logger.html | ||
port: 4000 | ||
server_ip: localhost | ||
logger: false | ||
logger_format: dev | ||
|
||
# Date / Time format | ||
## Hexo uses Moment.js to parse and display date | ||
## You can customize the date format as defined in | ||
## http://momentjs.com/docs/#/displaying/format/ | ||
date_format: MMM D YYYY | ||
time_format: H:mm:ss | ||
|
||
# Pagination | ||
## Set per_page to 0 to disable pagination | ||
per_page: 10 | ||
pagination_dir: page | ||
|
||
# Disqus | ||
disqus_shortname: | ||
|
||
# Extensions | ||
## Plugins: https://github.com/hexojs/hexo/wiki/Plugins | ||
## Themes: https://github.com/hexojs/hexo/wiki/Themes | ||
plugins: | ||
- hexo-generator-feed | ||
- hexo-math | ||
theme: pacman | ||
exclude_generator: | ||
|
||
# Deployment | ||
## Docs: http://hexo.io/docs/deployment.html | ||
deploy: | ||
- type: git | ||
repo: | ||
gitcafe: [email protected]:lingdian618/lingdian618.git,gitcafe-pages | ||
github: [email protected]:lingdian618/lingdian618.github.io.git | ||
feed: | ||
type: atom | ||
path: atom.xml | ||
limit: 20 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
{ | ||
"name": "hexo-site", | ||
"version": "2.8.3", | ||
"private": true, | ||
"dependencies": { | ||
"hexo-generator-feed": "^0.2.1", | ||
"hexo-math": "^1.0.3", | ||
"hexo-renderer-ejs": "*", | ||
"hexo-renderer-marked": "*", | ||
"hexo-renderer-stylus": "*" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
title: {{ title }} | ||
tags: | ||
--- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
title: {{ title }} | ||
date: {{ date }} | ||
--- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
layout: {{ layout }} | ||
title: {{ title }} | ||
date: {{ date }} | ||
tags: | ||
--- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
title: {{ title }} | ||
date: {{ date }} | ||
tags: | ||
--- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
lijian.ml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
title: 离散余弦变换(DCT)与离散傅里叶变换(DFT)的关系 | ||
date: 2013/11/03 | ||
categories: | ||
- 学习笔记 | ||
tags: | ||
- DCT | ||
- DFT | ||
--- | ||
|
||
## 理解DCT与DFT之间关系的关键几点 | ||
|
||
- 偶函数的DFT结果只包含余弦项; | ||
- 对长度有限的数字信号,可以通过偶延拓和周期延拓,然后进行适当平移得到偶函数信号; | ||
- 偶延拓时使用不同的边界处理方法将得到不同的离散余弦变换;通常按以下方法处理边界:设原信号为{1 2 3 4},通过偶延拓处理得到{1 2 3 4 4 3 2 1},然后再进行周期延拓,x(n)=x(n-8),此时我们发现x(-1)=x(7)=1,将信号右移0.5个单位就得到了偶函数信号。 | ||
- 偶函数的DFT是奇函数,F(n)=0,F(k)=F(2n-k),因此,虽然DFT结果长度为2n,然而仅需保存前n个即可,这n个数也即DCT变换结果(相差一个常量因子)。 | ||
|
||
## 实验结果: | ||
|
||
{1 2 3 4}DCT结果为: | ||
|
||
{10.000 -3.154 0.000 -0.224} | ||
|
||
{1 2 3 4 4 3 2 1}先DFT再进行相位调整(时移0.5)的结果为: | ||
|
||
{10.000 -6.309 0.000 -0.448 0.000 0.448 0.000 6.309} | ||
|
||
|
||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
title: 最优间隔分类器建模 | ||
date: 2014/07/12 | ||
categories: | ||
- 学习笔记 | ||
tags: | ||
- SVM | ||
- classification | ||
- model | ||
--- | ||
|
||
|
||
针对任何分类问题,通过特征提取后,就能得到特征向量及对应的类别标签: | ||
|
||
$$ | ||
( {\vec x}_i, y_i ), \quad i=1,2,3 \cdots m | ||
$$ | ||
|
||
其中,$ {\vec x}_i $表示第i个样本的特征向量,$ y_i $表示第i个样本所属类别。 | ||
|
||
对于二分类问题,设线性分类器的判别函数为 $ d({\vec x})={\vec w} \cdot {\vec x}+b $,对于一个待分类样本,通过特征提取得到其特征向量,将特征向量代入分类器判别函数,若输出为正,则将样本判定为+1类,否则为-1类。从几何的观点来看,特征提取是将样本抽象为欧氏空间中的一个点,而判别函数是该空间中的一个超平面,超平面不同侧的点对应不同类别的样本。因此,如果样本线性可分的话,那么就存在无穷多个超平面将其分开,也即存在无穷多个线性分类器能将样本分开,既然是这样,那么哪一个最好呢?直观上看,应该使分类超平面离样本点越远越好,这样可以减小把新样本分错的概率。当然,此处的“越远越好”的前提是要正确分类。分类器的间隔定义为所有样本点到分类超平面的距离中的最小值。最优间隔分类器就是间隔最大的分类器。 | ||
|
||
样本点 $ {\vec x}_i $ 到超平面的距离为: | ||
|
||
$$ | ||
\frac{|\vec w \cdot {\vec x}_i + b|}{\Vert w \Vert} | ||
$$ | ||
|
||
最优间隔分类器的优化目标为: | ||
|
||
$$ | ||
\mathop{max}_{\vec w, b} \{ \mathop{min}_i \{ \frac{|\vec w \cdot {\vec x}_i + b|}{\Vert w \Vert} \} \} | ||
$$ | ||
|
||
要直接求解上述优化问题显然不易,然而,幸运的是可以将其转化为一个凸优化问题。 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
title: 一个有意思的概率问题 | ||
date: 2014/01/15 | ||
categories: | ||
- 学习笔记 | ||
tags: | ||
- probability | ||
- math | ||
--- | ||
|
||
|
||
在书上看到一个有意思的问题,不知从何说起,举个例子吧。话说临近期末,小明闲来无事,想起了炒股,但他对股市知之甚少,于是他打算请个专家来指导他,为了确保专家质量,他决定对50个“专家”进行考核,选取表现最好的,考核方式如下:让专家们在接下来的连续10天内对某只特定股的涨跌进行独立预测(只预测“涨”或“跌”),10天过后,如果表现最好的专家正确率高于80%,那么就选他,否则说明这批专家太水了,弃之不用。现在的问题是,小明精心选拔出来的表现最好的专家是否可靠? | ||
|
||
初看起来小明的选拔方案貌似很合理,首先,不盲从专家,即使是专家也得考核;其次,考核比较严格,连续10天预测,正确率高达80%才有机会,一般人恐怕难以做到;再者,人数众多,滥竽充数者难以胜出。 | ||
|
||
但事实总是残酷的:通过以上方式选出的专家那是相当的不靠谱!具体分析如下:由于每次预测结果只有2种,所以对一个普通人而已,可以合理假设他在一次预测中正确的概率是0.5,对于连续10次预测,要达到80%以上的正确率,概率大概在0.05左右,可以说是相当低,但是,50个普通人中正确率最高的要达到80%以上的正确率,概率就陡升至93.99%(不信的话自己算去吧),所以说,小明就是找来50个白痴,也很可能有人正确率高于80%(概率高达93.99%)。 | ||
|
||
这个例子可能有点极端,但确实说明了一定的问题,生活中还有很多类似的问题可以用上述分析过程来解释,比如说:三个臭皮匠赛过诸葛亮;数据挖掘中的Adaboosting方法。 | ||
|
||
话说小明看到这个后很恼怒(居然选了个白痴),你能帮助小明改进他的选拔方案吗?(小明炒股赢了后不会忘记你的) | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
title: 聚类中的关键问题--于剑老师讲座总结 | ||
date: 2014/06/18 | ||
categories: | ||
- 学习笔记 | ||
tags: | ||
- clustering | ||
- summary | ||
--- | ||
|
||
今天下午听了于剑老师关于聚类的讲座,下面简单总结下。 | ||
|
||
## 什么是聚类 | ||
|
||
物以类聚,人以群分。这句话比喻同类的东西常聚在一起,志同道合的人相聚成群。关于这个成语还有一个有趣的典故,有兴趣的可以看看[这里](http://baike.baidu.com/view/412596.htm)。“聚类”这个词应该是取自这个成语,在台湾,“聚类”也叫“分群”。现在的问题是,给你一堆人或者一堆东西,要你把相似的分到同一组,不相似的分到不同的组,这个过程就是聚类。与聚类非常相似的一个概念是分类,一般来说,聚类属于无监督学习,分类属于有监督学习,二者的区别在于是否事先知道类别信息,举个例子,假设对一群人分组,如果事先告诉你要分成2组,一组男的,一组女的,那么这个问题就是分类问题,如果没有相关信息,只要你把这群人分成若干个组就行,那么这个问题就是聚类问题。 | ||
|
||
## 为何要聚类 | ||
|
||
聚类能干什么呢?下面是于剑老师ppt上列出来的几点: | ||
|
||
- When studying complex network, people hopes to find the community | ||
with intrinsic relations(发现复杂网络中的社群结构) | ||
- In image analysis,people hopes to segment an image into | ||
homogeneous regions(将图像分割成同质区域) | ||
- In text processing, people hopes to find document subsets with the | ||
same topic(发现相同主题的文档) | ||
- In lossy coding,people hopes to find an code with minimum | ||
information loss(在有损编码中,寻找信息丢失最少的编码方式) | ||
- In customer behavior analysis, people hopes to find homogeneous | ||
customer groups in order to efficiently make an advertisement(对用户分层,从而更有效地打广告) | ||
|
||
|
||
## 聚类分析的一般流程 | ||
|
||
- 数据表示和数据预处理,包括数据清洗、特征提取、特征选择 | ||
- 定义相似性,把对象之间的相似性用提取的特征体现出来 | ||
- 聚类,选择某种聚类算法对数据进行划分 | ||
- 性能评估,对聚类结果的好坏进行评价 | ||
|
||
## 聚类中的关键问题 | ||
|
||
- 相似性的定义。上个世纪60年代,模式识别研究的鼻祖之一,美籍日本学者渡边慧证明了[“丑小鸭定理”](http://baike.baidu.com/view/815246.htm)。这个定理说的是“丑小鸭与白天鹅之间的区别和两只白天鹅之间的区别一样大”。丑小鸭是白天鹅的幼雏,在画家的眼里,丑小鸭和白天鹅的区别大于两只白天鹅的区别;但是在遗传学家的眼里,丑小鸭与其父亲或母亲的差别小于父母之间的差别。由此引出的一个问题是,事物有没有“本质”?一个苹果,牛顿看到的是它的质量,遗传学家看到的是它的染色体中的DNA序列,美食家关心的是它的味道,画家看到的是它的颜色和形状,孔融还可能关注其大小并从中看出道德因素。这里面没有谁对谁错的问题,所以不可能知道苹果的“本质”是什么。在说到“本质”的时候,充其量说的只是“我认为最重要的特征”,只代表个人的立场,他人并没有赞同的充分理由。所以任何使用“本质”这个词汇所进行的论证都是靠不住的。如果一个哲学家说:“思维是人的本质,计算机不具备这种本质,所以机器不能思维。”这种论证只相当于说:“我认为计算机不能思维,所以计算机不能思维。”这当然不能成为有效的论证。问题就在于世界上还不存在能够判断什么是事物的本质的公认的有效方法。所以没法判断事物之间本质上是否相似,一切相似性定义都是主观的,都是面向具体问题的。 | ||
- 聚类算法的设计。就目前而言,貌似没有什么放之四海皆准的聚类算法,大多数算法都得对数据的分布形式作出一定的假设。在设计聚类算法时,还存在另一个问题,数据在原空间的聚集形态可能跟实际不一致,可能需要将数据转换到另一个空间中,这个问题可以看成是特征处理的问题,也可以在设计聚类算法时考虑。听于老师说,现在很多人做聚类时把特征处理和聚类算法设计合成一个步骤,这样一来可以使特征与算法匹配得更好,从而得到更好的聚类效果。 | ||
- 聚类结果的评估。要对一个聚类结果进行评估,就得有一个所谓的“参考答案”,但是,如果我们已经知道来聚类结果,那么也就没必要再做聚类来,这一矛盾给聚类结果的评估带来不少麻烦。 | ||
- 如何建立聚类分析的公理化系统。这一问题貌似在机器学习中普遍存在,在机器学习中,我们做的很多事情都是基于“经验主义”,而非“理性主义”。要是在机器学习领域能够建立像牛顿力学中那样优美的三大定律公理化系统,那聚类分析的公理化系统应该也不是问题来。 | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
title: 对相关性的理解 | ||
date: 2013-10-14 | ||
categories: | ||
- 学习笔记 | ||
tags: | ||
- similarity | ||
- correlation | ||
- math | ||
--- | ||
|
||
|
||
何为相关性,根据我的理解,相关性就是某种联系,举几个具体例子,比如说人的身高与体重之间的联系、体重与性别之间的联系、物价与房价之间的联系等等。说到相关性,就不得不提到因果关系,根据我的理解,因果关系应该算是一种比较特殊的相关性,而相关的事物之间不一定具备因果联系。相关性又可以分为线性相关和非线性相关,在这里我要讨论的主要是线性相关。 | ||
|
||
为何要进行相关性分析?根据马克思主义的观点,事物之间的联系是普遍的,科学研究的主要目的就是发现事物之间的联系,进而达到认识世界、改造世界的目的。这样说有点太大太空了,说点具体的,在数据挖掘等相关研究中,往往需要从海量数据中发现某种规律,从而提取有用信息。在这个过程中,由于数据太多、太杂、还可能有错误,所以在data mining之前必须要进行前期处理,否则就是"garbage in, garbage out",而且数据量太大还会大大延长算法执行时间。在进行数据前期处理时,就可以对数据进行相关性分析,如果2组数据的相关性很高,就说明存在信息冗余,也许只要其中一组就行,按照这个思想,我们就能剔除很多重复的或者相似的数据。这个例子说明了相关性分析在处理海量数据中的一些应用。其他应用应该还有不少,只是我不知道,或者暂时没想到…… | ||
|
||
如何进行相关性分析?比如说如何分析人的身高与体重之间的相关性,首先,我们需要数据,数据哪里来,抽样,然后测量样本的身高与体重,这样的话我们就得到了样本数据,用h表示身高数据,w表示体重数据。然后,我们要做的就是分析数组h和w的相关性,那么该如何衡量两个数组之间的相关性呢(线性相关)?一个比较直观的想法是,当一个数组是另一个的常数倍时,这两个数组的相关性应是最高的,那什么时候相关性最低呢?貌似不太直观。嗯,如果我们把这两组数据看成是两个向量呢?oh,yes,I get it!向量平行时,数据相关性最高;向量垂直时相关性最低!数据之间的相关性可以用对应向量之间的夹角来衡量。至于具体的公式,那就去看统计学教程吧! | ||
|
||
PS:之前对计算相关系数的那个公式一直不明白怎么来的,为什么要这样定义呢?直到最近我才发现那个公式在形式上很像计算向量之间夹角余弦值……,然后就有了这篇博文。 | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
title: 对KKT条件的理解 | ||
date: 2014/07/05 | ||
categories: | ||
- 学习笔记 | ||
tags: | ||
- Numerical Optimization | ||
- Nonlinear Optimization | ||
- KKT | ||
--- | ||
|
||
## 带约束的数值优化问题 | ||
|
||
数值优化问题是在有限维实空间上求单值函数的极值。函数的自变量可能受限制于有限个等式或不等式约束。数值优化问题通常可以写成如下形式: | ||
|
||
{% math-block %} | ||
min f(x) \\ | ||
s.t. \quad g_i(x)\geq0, h_j(x)=0 | ||
{% endmath-block %} | ||
|
||
其中,f(x)是优化目标,x是变量,g(x)是不等式约束,h(x)是等式约束,通常来说,所有的优化问题都可以转化为以上形式。 | ||
|
||
## 无约束优化问题的一阶必要性条件 | ||
|
||
{% math-block %} | ||
\nabla f(x)=0 | ||
{% endmath-block %} | ||
|
||
|
||
## 只含等式约束的一阶必要性条件--lagrangian methond | ||
|
||
{% math-block %} | ||
\nabla f(x) = \sum\lambda_i\nabla h_i(x) | ||
{% endmath-block %} | ||
|
||
## 一般优化问题的一阶必要性条件--KKT condition | ||
|
||
{% math-block %} | ||
\nabla f(x) = \sum\lambda_i\nabla h_i(x) + \sum_{\mu_j \geq 0}\mu_j\nabla g_j(x) \\ | ||
\mu_j g_j(x) = 0,\quad \forall j | ||
{% endmath-block %} | ||
|
||
|
||
无论优化问题是否有约束,一阶必要性条件在本质上是一样的,如果某点是极值点,那么在该点处一定不存在一个可行的下降(上升)方向使函数值减小(增大),这就是极值点的一阶必要性条件,以下2种情况可以满足该条件: | ||
|
||
* 函数在该点的梯度为0,典型的例子是无约束优化问题的一阶必要性条件; | ||
* 函数在该点的梯度不为0,但由于约束条件的存在,无法沿梯度方向移动来使函数值发生变化。 | ||
|
||
先考虑只有一个等式约束的情况,此时自变量的可行域是一个约束面,假设$ x $最初位于$ x_0 $处,那么此时$ x $的移动方向肯定不能与约束面的法向量方向平行,也不能包含法向量方向的分量,否则沿该方向移动将使得$ x $跳出约束面。所以,当目标函数的梯度方向与约束面在该点的法向量方向平行时,就找不到一个可行的合法的下降方向了(沿梯度方向移动才能下降)。用数学公式表达出来就是$ \nabla f(x) = \lambda \nabla h(x) $,这正是只含一个等式约束条件的一阶必要性条件。 | ||
|
||
再考虑有多个等式约束的情况,此时自变量可行域为多个约束面的交集,如果目标函数的梯度恰好可以分解为约束面的法向量线性组合,那么,沿目标函数梯度方向的移动将会违背约束条件,所以,含多个等式约束的优化问题的一阶必要性条件为:$ \nabla f(x) = \sum \lambda_i \nabla h_i(x) $ | ||
|
||
最后考虑含不等式约束的情况,此时的可行域是由等式约束决定的约束面以及由不等式约束决定的区域的交集。要判定 $ x $是否是极值点,可分以下2种情况考虑: | ||
|
||
1. $ x $位于区域边界上,此时不等式约束的等号恰好成立,此时的情况可以与等式约束类比,只不过在分解梯度的时候,限定了法向量的方向; | ||
2. $ x $位于区域内部,此时的不等式约束对可行方向不具约束力,在分解梯度时无需考虑,因此对应的$ \mu_j=0 $,这也解释了为什么要满足互补条件。 | ||
|
||
总结,优化问题的一阶必要性条件的实质是考察梯度条件,这也是为什么叫“一阶”必要性条件的原因。对于带约束的优化问题,只要将约束条件转化为对可行方向的约束,就能够比较直观地理解一阶必要性条件。 | ||
|
Oops, something went wrong.