跳到主要内容

広島大学 先進理工系科学研究科 情報科学プログラム 2022年8月実施 専門科目II 問題6

Author

祭音Myyura

Description

Let the sigmoid function be

σ(x)=11+exp(x).\sigma(x) = \frac{1}{1 + \exp(-x)}.

(1) Show that the following equation holds:

1σ(x)=σ(x). 1 - \sigma(x) = \sigma(-x).

(2) Show that the derivative of the sigmoid function can be written as

ddxσ(x)=σ(x)(1σ(x)). \frac{d}{dx}\sigma(x) = \sigma(x)(1-\sigma(x)).

(3) The inverse function of the sigmoid function σ\sigma is called the logit function. Show that the logit function σ1\sigma^{-1} can be written as

σ1(p)=log ⁣(p1p), \sigma^{-1}(p) = \log\!\left(\frac{p}{1-p}\right),

where 0p10 \le p \le 1.

题目描述

定义 sigmoid 函数

σ(x)=11+exp(x).\sigma(x)=\frac{1}{1+\exp(-x)}.
  1. 证明

    1σ(x)=σ(x).1-\sigma(x)=\sigma(-x).
  2. 证明其导数可写为

    ddxσ(x)=σ(x)(1σ(x)).\frac{d}{dx}\sigma(x)=\sigma(x)\bigl(1-\sigma(x)\bigr).
  3. sigmoid 函数 σ\sigma 的反函数称为 logit 函数。证明

    σ1(p)=log ⁣(p1p),\sigma^{-1}(p)=\log\!\left(\frac{p}{1-p}\right),

    其中题面给定 0p10\le p\le1

考点

  • Sigmoid 函数:由定义推导其对称恒等式、导数的自表达形式,并通过代数反解得到 logit 反函数。

Kai

Throughout, log\log denotes the natural logarithm.

(1)

Start from the definition:

σ(x)=11+ex.\sigma(x) = \frac{1}{1+e^{-x}}.

Then

1σ(x)=111+ex=1+ex11+ex=ex1+ex.1 - \sigma(x) = 1 - \frac{1}{1+e^{-x}} = \frac{1+e^{-x} - 1}{1+e^{-x}} = \frac{e^{-x}}{1+e^{-x}}.

Multiply numerator and denominator by exe^{x}:

1σ(x)=exex(1+ex)ex=11+ex=σ(x).1 - \sigma(x) = \frac{e^{-x}e^{x}}{(1+e^{-x})e^{x}} = \frac{1}{1+e^{x}} = \sigma(-x).

(2)

Differentiate the definition:

σ(x)=11+ex.\sigma(x) = \frac{1}{1+e^{-x}}.

Using the chain rule:

ddxσ(x)=ddx(1+ex)1=1(1+ex)2ddx(1+ex)=(1+ex)2(ex)=ex(1+ex)2.\begin{aligned} \frac{d}{dx}\sigma(x) &= \frac{d}{dx}\left(1+e^{-x}\right)^{-1} \\ &= -1\cdot\left(1+e^{-x}\right)^{-2}\cdot\frac{d}{dx}(1+e^{-x}) \\ &= -\left(1+e^{-x}\right)^{-2}\cdot(-e^{-x}) \\ &= \frac{e^{-x}}{\left(1+e^{-x}\right)^2}. \end{aligned}

Now compute σ(x)(1σ(x))\sigma(x)(1-\sigma(x)), from (1), we have

1σ(x)=ex1+ex.1-\sigma(x) = \frac{e^{-x}}{1+e^{-x}}.

hence

σ(x)(1σ(x))=11+exex1+ex=ex(1+ex)2.\sigma(x)(1-\sigma(x)) = \frac{1}{1+e^{-x}}\cdot\frac{e^{-x}}{1+e^{-x}} = \frac{e^{-x}}{\left(1+e^{-x}\right)^2}.

(3)

Let p=σ(x)p = \sigma(x). Then

p=11+ex.p = \frac{1}{1+e^{-x}}.

We want to solve for xx in terms of pp.

First invert the fraction:

1p=1+ex.\frac{1}{p} = 1 + e^{-x}.

So

ex=1p1=1pp.e^{-x} = \frac{1}{p} - 1 = \frac{1-p}{p}.

Take the natural logarithm of both sides:

x=log(1pp),-x = \log\left(\frac{1-p}{p}\right),

so

x=log(1pp)=log(p1p).x = -\log\left(\frac{1-p}{p}\right) = \log\left(\frac{p}{1-p}\right).

Therefore the inverse function of σ\sigma is

σ1(p)=log(p1p),\sigma^{-1}(p) = \log\left(\frac{p}{1-p}\right),

which is defined for 0<p<10 < p < 1 (and extends to ±\pm\infty at the endpoints p=0,1p=0,1).