20190821

20190821

わかったこと

なんか基礎的なこと

確率変数の概念を導入しよう.

(Ω,F,P)(\Omega, \mathcal{F}, P)を確率空間とし,X:Ω→XX: \Omega \to \mathcal{X}を確率変数とする.それでもって,述語f∘Xf \circ Xが成り立つ確率を考える.

これは,Bf={x∈X∣f(x)}B_f = \left\{x \in \mathcal{X} | f(x)\right\}と定義して,

P∘X−1(Bf)=P({ω∈Ω∣X(ω)∈Bf}) \begin{aligned} P \circ X^{-1} (B_f) = P(\left\{\omega \in \Omega | X(\omega) \in B_f\right\}) \end{aligned}

と表せる.

二変数の場合,Y:Ω→YY: \Omega \to \mathcal{Y}を用意して,(X,Y):ω↦(X(ω),Y(ω))(X, Y): \omega \mapsto (X(\omega), Y(\omega))とする.さらに,Bf={(x,y)∈X×Y∣f(x,y)}B_f = \left\{(x, y) \in \mathcal{X} \times \mathcal{Y} | f(x, y)\right\}とする.こうすると,ffが成り立つ確率が,

P∘(X,Y)−1(Bf)=P({ω∈Ω∣(X,Y)(ω)∈Bf}) \begin{aligned} P \circ (X, Y)^{-1} (B_f) = P (\left\{\omega \in \Omega | (X, Y)(\omega) \in B_f\right\}) \end{aligned}

と書ける.

昨日は,

P({y∈Y∣∃x∈X:f(x,y)}) \begin{aligned} P(\left\{y \in \mathcal{Y} | \exists x \in \mathcal{X}: f(x, y) \right\}) \end{aligned}

というのを考えたけど,これ,fy(x)f_y(x)を考えている.つまり,∣Y∣|\mathcal{Y}|の数だけ述語を考えている.関数の集合を考えるのではなくて,yyを使って関数を表している.この考え方はだいぶ使えそう.

述語の集合をF\mathcal{F}と書くと確率空間のσ\sigma-algebraと混同して紛らわしいので,述語をhhで表して,その集合をH\mathcal{H}と書くことにする.

ω\omegaを使って関数を表そう!

学習理論的なこと

裏にある,(Ω,F,P)(\Omega, \mathcal{F}, P)という確率空間を忘れないこと.
扱う問題が,ω\omegaの述語になっていることが多いが,それがほとんどの場合省略されている.

Bh,c={x∈X∣h(x)≠c(x)}B_{h, c} = \left\{x \in \mathcal{X} | h(x) \neq c(x)\right\}という集合を考える.

generalization errorはPX=P∘X−1P_X = P \circ X^{-1}でBh,cB_{h, c}を測ったもの.

R(h)=P({ω∈Ω∣X(ω)∈Bh,c})=P∘X−1(Bh,c) \begin{aligned} R(h) = P(\left\{\omega \in \Omega | X(\omega) \in B_{h, c}\right\}) = P \circ X^{-1} (B_{h, c}) \end{aligned}

empirical distribution

Dm=1m∑i=1mδxi \begin{aligned} D_m &= \frac{1}{m} \sum_{i=1}^m \delta_{x_i} \end{aligned}

empirical errorは,empirical distributionでBh,cB_{h, c}を測ったもの.

R^(h)=Dm(Bh,c) \begin{aligned} \hat{R}(h) &= D_m (B_{h, c}) \\ \end{aligned}

empirical distributionの値は確率変数(多分).なのでempirical errorも確率変数.

R^(h)(ω)=Dm(Bh,c)(ω)=1m∑i=1m1Bh,c∘Xi(ω) \begin{aligned} \hat{R}(h)(\omega) = D_m(B_{h, c})(\omega) &= \frac{1}{m}\sum_{i=1}^m 1_{B_{h, c}} \circ X_i (\omega) \end{aligned}

これはサンプルによるのだから,当たり前といえば当たり前.

一方で,generalization errorは定数.

R^(h)=0\hat{R}(h) = 0なるhhを,consistent hypothesisと呼ぶ.
これは常に存在するとは限らないので,存在確率を考えてみよう.

P({ω∈Ω∣∃h∈H:R^(h)(ω)=0})=P({ω∈Ω∣∨h∈HR^(h)(ω)=0})=P(∪h∈H{ω∈Ω∣R^(h)(ω)=0})≤∑h∈HP({ω∈Ω∣R^(h)(ω)=0}) \begin{aligned} P \left(\left\{\omega \in \Omega | \exists h \in \mathcal{H}: \hat{R}(h)(\omega) = 0\right\}\right) &= P \left(\left\{\omega \in \Omega | \vee_{h \in \mathcal{H}} \hat{R}(h)(\omega) = 0\right\}\right) \\ &= P \left(\cup_{h \in \mathcal{H}} \left\{\omega \in \Omega | \hat{R}(h)(\omega) = 0\right\}\right) \\ &\leq \sum_{h \in \mathcal{H}} P \left(\left\{\omega \in \Omega | \hat{R}(h)(\omega) = 0\right\}\right) \end{aligned}

右辺の中身を少し調べると,

R^(h)(ω)=0⇔∧i=1m1Bh,c∘Xi(ω)=0⇔∧i=1mXi(ω)∉Bh,c \begin{aligned} \hat{R}(h)(\omega) = 0 &\Leftrightarrow \wedge_{i=1}^m 1_{B_{h, c}} \circ X_i (\omega) = 0 \\ &\Leftrightarrow \wedge_{i=1}^m X_i(\omega) \notin B_{h, c} \\ \end{aligned}

となるので,

P({ω∈Ω∣∃h∈H:R^(h)(ω)=0})≤∑h∈HP(∩i=1mXi−1(Bh,cc))=∑h∈H∏i=1mP∘Xi−1(Bh,cc)=∑h∈H∏i=1m(1−P∘Xi−1(Bh,c))=∑h∈H(1−P∘X−1(Bh,c))m=∑h∈H(1−R(h))m=∣H∣(1−R(h))m=:δ \begin{aligned} P \left(\left\{\omega \in \Omega | \exists h \in \mathcal{H}: \hat{R}(h)(\omega) = 0\right\}\right) &\leq \sum_{h \in \mathcal{H}} P \left(\cap_{i=1}^m X_i^{-1}(B^c_{h, c})\right) \\ &= \sum_{h \in \mathcal{H}} \prod_{i=1}^m P \circ X_i^{-1}(B^{c}_{h, c}) \\ &= \sum_{h \in \mathcal{H}} \prod_{i=1}^m (1 - P \circ X_i^{-1}(B_{h, c})) \\ &= \sum_{h \in \mathcal{H}} (1 - P \circ X^{-1}(B_{h, c}))^m \\ &= \sum_{h \in \mathcal{H}} (1 - R(h))^m \\ &= |\mathcal{H}| (1 - R(h))^m =: \delta\\ \end{aligned}

consistent hypothesisが存在する確率が,generalization errorを使って抑えられている.

ちょっとよくわからんけど,こんなバウンドを出せたのは初めてなので進歩したと思っておく.

sampleの話

S:ω↦(X1(ω),…,Xm(ω))S: \omega \mapsto (X_1(\omega), \ldots, X_m(\omega))という確率変数を考える.
B⊂XmB \subset \mathcal{X}^mに対して

P∘S−1(B)=P({ω∈Ω∣S(ω)∈B})P \circ S^{-1}(B) = P(\left\{\omega \in \Omega | S(\omega) \in B\right\})

を考える.これとempirical distributionとの関係は?

P∘S−1P \circ S^{-1}はXm\mathcal{X}^m上の測度っぽいけど,empirical distributionはX\mathcal{X}上の測度.で,多分これもいろいろなところで使う.

hSh_Sなんかはサンプルに依存してるので,R(hS)R(h_S)とかを扱う際にはこれで測ることになる.結構複雑だ.あれ,ちょっと思いついた.

学習理論的なこと part 2

サンプルを使って出したhS∈Hh_S \in \mathcal{H}がconsistentだとする.これは,SSに依存していて,確率変数とみなせる.

Bc={s∈Xm∣P∘X−1({x∈X∣hs(x)≠c(x)})} \begin{aligned} B_{c} = \left\{s \in \mathcal{X}^m | P \circ X^{-1}\left(\left\{x \in \mathcal{X} | h_s(x) \neq c(x)\right\}\right)\right\} \end{aligned}

これはまさに,hhをssで表している!P∘S−1P \circ S^{-1}で測れる.多分ssは無限個あるので,hsh_sも無限個ある.

20190820

20190820

わかったこと

なんか基礎的なこと

存在量化子と全称量化子の間を取るのが確率なのかも.
以下の二つはどちらもtrueかfalseである.

  • ∃x∈X:f(x)\exists x \in \mathcal{X}: f(x)
  • ∀x∈X:f(x)\forall x \in \mathcal{X}: f(x)

P({x∈X∣f(x)})P(\left\{x \in \mathcal{X} | f(x) \right\})のように確率を使って,この間を取ることができる.1なら下が成り立つと解釈してもいいし,0じゃないなら上が成り立つと解釈してもいいだろう.

二変数以上の場合を考えると,全称と存在を述語に入れなければならないケースが出てくる.以下の二つの述語を考える.

  • ∃x∈X:f(x,y)\exists x \in \mathcal{X}: f(x, y)
  • ∀x∈X:f(x,y)\forall x \in \mathcal{X}: f(x, y)

例えば,fx(y)=f(x,y)f_x(y) = f(x, y)という述語が成り立つ確率を知りたい場合は,

P({y∈Y∣∃x∈X:f(x,y)})=P({y∈Y∣∨x∈Xf(x,y)})=P(∪x∈X{y∈Y∣f(x,y)})≤∑x∈XP({y∈Y∣f(x,y)}) \begin{aligned} P(\left\{y \in \mathcal{Y} | \exists x \in \mathcal{X}: f(x, y) \right\}) &= P(\left\{y \in \mathcal{Y} | \vee_{x \in \mathcal{X}} f(x, y) \right\}) \\ &= P(\cup_{x \in \mathcal{X}} \left\{y \in \mathcal{Y} | f(x, y) \right\}) \\ &\leq \sum_{x \in \mathcal{X}} P(\left\{y \in \mathcal{Y} | f(x, y) \right\}) \end{aligned}

と,上界を出すことができる.

全称の場合はこんなにうまく出せないので確率の性質P(Y)=1P(\mathcal{Y}) = 1を使う.

∀x∈X:f(x,y)\forall x \in \mathcal{X}: f(x, y)の否定は,∃x∈X:¬f(x,y)\exists x \in \mathcal{X}: \neg f(x, y)なので,上と同様にして,

P({y∈Y∣∃x∈X:¬f(x,y)})=P({y∈Y∣∨x∈X¬f(x,y)})=P(∪x∈X{y∈Y∣¬f(x,y)})≤∑x∈XP({y∈Y∣¬f(x,y)})=:δ \begin{aligned} P(\left\{y \in \mathcal{Y} | \exists x \in \mathcal{X}: \neg f(x, y)\right\}) &= P(\left\{y \in \mathcal{Y} | \vee_{x \in \mathcal{X}} \neg f(x, y)\right\}) \\ &= P(\cup_{x \in \mathcal{X}} \left\{y \in \mathcal{Y} | \neg f(x, y)\right\}) \\ &\leq \sum_{x \in \mathcal{X}} P(\left\{y \in \mathcal{Y} | \neg f(x, y)\right\}) =: \delta \end{aligned}

となるので,

1−P({y∈Y∣∀x∈X:f(x,y)})≤δ⇔P({y∈Y∣∀x∈X:f(x,y)})≥1−δ \begin{aligned} 1 - P(\left\{y \in \mathcal{Y} | \forall x \in \mathcal{X}: f(x, y)\right\}) \leq \delta \\ \Leftrightarrow P(\left\{y \in \mathcal{Y} | \forall x \in \mathcal{X}: f(x, y)\right\}) \geq 1 - \delta \end{aligned}

と書ける.これはめちゃめちゃ使うので理解しないといけない.

Written with StackEdit.

述語論理と集合

述語論理と集合

復習したのでメモ.

f:X→{0,1}f: \mathcal{X} \to \{0, 1\}を述語(条件)と言おう(0はfalse, 1はtrueを表す).{x∈X∣f(x)=1}\left\{x \in \mathcal{X} | f(x) = 1\right\}を,単に{x∈X∣f(x)}\left\{x \in \mathcal{X} | f(x)\right\}と書こう.述語は自然言語で書いてもいいので,かなり自由度が高い.

全称と存在を考える.以下は命題になる.

∀x∈X,f(x) \begin{aligned} \forall x \in \mathcal{X}, f(x) \\ \end{aligned}

ちょっと見方を変えると,これは,

∧x∈Xf(x) \begin{aligned} \wedge_{x \in \mathcal{X}} f(x) \end{aligned}

と同じ多分.X\mathcal{X}が有限じゃない時とかはよくわからんけど.

存在も以下のように似たように考えればいい.

∃x∈X,f(x)⇔∨x∈Xf(x) \begin{aligned} \exists x \in \mathcal{X}, f(x) \Leftrightarrow \vee_{x \in \mathcal{X}} f(x) \end{aligned}

f:X×Y→{0,1}f: \mathcal{X} \times \mathcal{Y} \to \{0, 1\}を考える.以下は述語.

∧x∈Xf(x,y) \begin{aligned} \wedge_{x \in \mathcal{X}} f(x, y) \end{aligned}

これが成り立つyyの集合を考える.

{y∈Y∣∧x∈Xf(x,y)} \begin{aligned} \left\{y \in \mathcal{Y} | \wedge_{x \in \mathcal{X}} f(x, y) \right\} \end{aligned}

おそらく,

{y∈Y∣∧x∈Xf(x,y)}=∩x∈X{y∈Y∣f(x,y)} \begin{aligned} \left\{y \in \mathcal{Y} | \wedge_{x \in \mathcal{X}} f(x, y) \right\} = \cap_{x \in \mathcal{X}} \left\{y \in \mathcal{Y} | f(x, y)\right\} \end{aligned}

となる.

存在の方も同様に,

{y∈Y∣∨x∈Xf(x,y)}⇔∪x∈X{y∈Y∣f(x,y)} \begin{aligned} \left\{y \in \mathcal{Y} | \vee_{x \in \mathcal{X}} f(x, y) \right\} \Leftrightarrow \cup_{x \in \mathcal{X}} \left\{y \in \mathcal{Y} | f(x, y)\right\} \end{aligned}

となると思う.

これは,確率を考える上でかなり大事になってくると思う.
何かが存在する確率を,和集合の確率で表すことができて,そのupper boundが簡単にでる.この辺はまた今度気が向いたら書こうと思う.

機械学習の問題設定

機械学習の問題設定 機械学習の問題設定を見直したのでメモ. ( Ω , F , P ) (\Omega, \mathcal{F}, P) ( Ω , F , P ) : ベースとなる確率空間 ( X , F X ) (\mathcal...