広島大学 先進理工系科学研究科 情報科学プログラム 2022年8月実施 専門科目II 問題6
Author
祭音Myyura
Description
Let the sigmoid function be
σ(x)=1+exp(−x)1.
(1) Show that the following equation holds:
1−σ(x)=σ(−x).
(2) Show that the derivative of the sigmoid function can be written as
dxdσ(x)=σ(x)(1−σ(x)).
(3) The inverse function of the sigmoid function σ is called the logit function.
Show that the logit function σ−1 can be written as
σ−1(p)=log(1−pp),
where 0≤p≤1.
题目描述
定义 sigmoid 函数
σ(x)=1+exp(−x)1.
-
证明
1−σ(x)=σ(−x).
-
证明其导数可写为
dxdσ(x)=σ(x)(1−σ(x)).
-
sigmoid 函数 σ 的反函数称为 logit 函数。证明
σ−1(p)=log(1−pp),
其中题面给定 0≤p≤1。
- Sigmoid 函数:由定义推导其对称恒等式、导数的自表达形式,并通过代数反解得到 logit 反函数。
Kai
Throughout, log denotes the natural logarithm.
(1)
Start from the definition:
σ(x)=1+e−x1.
Then
1−σ(x)=1−1+e−x1=1+e−x1+e−x−1=1+e−xe−x.
Multiply numerator and denominator by ex:
1−σ(x)=(1+e−x)exe−xex=1+ex1=σ(−x).
(2)
Differentiate the definition:
σ(x)=1+e−x1.
Using the chain rule:
dxdσ(x)=dxd(1+e−x)−1=−1⋅(1+e−x)−2⋅dxd(1+e−x)=−(1+e−x)−2⋅(−e−x)=(1+e−x)2e−x.
Now compute σ(x)(1−σ(x)), from (1), we have
1−σ(x)=1+e−xe−x.
hence
σ(x)(1−σ(x))=1+e−x1⋅1+e−xe−x=(1+e−x)2e−x.
(3)
Let p=σ(x). Then
p=1+e−x1.
We want to solve for x in terms of p.
First invert the fraction:
p1=1+e−x.
So
e−x=p1−1=p1−p.
Take the natural logarithm of both sides:
−x=log(p1−p),
so
x=−log(p1−p)=log(1−pp).
Therefore the inverse function of σ is
σ−1(p)=log(1−pp),
which is defined for 0<p<1 (and extends to ±∞ at the endpoints p=0,1).