En l'aprenentatge automàtic , el nucli de la funció de base radial , o nucli RBF , és una funció real del nucli que s'utilitza en diversos algorismes d'aprenentatge kernelitzats . En particular, s'utilitza habitualment en la classificació de màquines de vectors de suport .[1]
El nucli RBF en dues mostres
x
∈
R
k
{\displaystyle \mathbf {x} \in \mathbb {R} ^{k}}
i x' , representat com a vectors de característiques en algun espai d'entrada , es defineix com [2]
K
(
x
,
x
′
)
=
exp
(
−
‖
x
−
x
′
‖
2
2
σ
2
)
{\displaystyle K(\mathbf {x} ,\mathbf {x'} )=\exp \left(-{\frac {\|\mathbf {x} -\mathbf {x'} \|^{2}}{2\sigma ^{2}}}\right)}
‖
x
−
x
′
‖
2
{\displaystyle \textstyle \|\mathbf {x} -\mathbf {x'} \|^{2}}
es pot reconèixer com la distància euclidiana al quadrat entre els dos vectors de característiques.
σ
{\displaystyle \sigma }
és un paràmetre lliure. Una definició equivalent implica un paràmetre
γ
=
1
2
σ
2
{\displaystyle \textstyle \gamma ={\tfrac {1}{2\sigma ^{2}}}}
:
K
(
x
,
x
′
)
=
exp
(
−
γ
‖
x
−
x
′
‖
2
)
{\displaystyle K(\mathbf {x} ,\mathbf {x'} )=\exp(-\gamma \|\mathbf {x} -\mathbf {x'} \|^{2})}
Com que el valor del nucli RBF disminueix amb la distància i oscil·la entre zero (al límit) i un (quan x = x' ), té una interpretació fàcil com a mesura de semblança . L'espai de característiques del nucli té un nombre infinit de dimensions; per
σ
=
1
{\displaystyle \sigma =1}
, la seva expansió utilitzant el teorema multinomial és:
exp
(
−
1
2
‖
x
−
x
′
‖
2
)
=
exp
(
2
2
x
⊤
x
′
−
1
2
‖
x
‖
2
−
1
2
‖
x
′
‖
2
)
=
exp
(
x
⊤
x
′
)
exp
(
−
1
2
‖
x
‖
2
)
exp
(
−
1
2
‖
x
′
‖
2
)
=
∑
j
=
0
∞
(
x
⊤
x
′
)
j
j
!
exp
(
−
1
2
‖
x
‖
2
)
exp
(
−
1
2
‖
x
′
‖
2
)
=
∑
j
=
0
∞
∑
n
1
+
n
2
+
⋯
+
n
k
=
j
exp
(
−
1
2
‖
x
‖
2
)
x
1
n
1
⋯
x
k
n
k
n
1
!
⋯
n
k
!
exp
(
−
1
2
‖
x
′
‖
2
)
x
′
1
n
1
⋯
x
′
k
n
k
n
1
!
⋯
n
k
!
=
⟨
φ
(
x
)
,
φ
(
x
′
)
⟩
{\displaystyle {\begin{alignedat}{2}\exp \left(-{\frac {1}{2}}\|\mathbf {x} -\mathbf {x'} \|^{2}\right)&=\exp({\frac {2}{2}}\mathbf {x} ^{\top }\mathbf {x'} -{\frac {1}{2}}\|\mathbf {x} \|^{2}-{\frac {1}{2}}\|\mathbf {x'} \|^{2})\\&=\exp(\mathbf {x} ^{\top }\mathbf {x'} )\exp(-{\frac {1}{2}}\|\mathbf {x} \|^{2})\exp(-{\frac {1}{2}}\|\mathbf {x'} \|^{2})\\&=\sum _{j=0}^{\infty }{\frac {(\mathbf {x} ^{\top }\mathbf {x'} )^{j}}{j!}}\exp \left(-{\frac {1}{2}}\|\mathbf {x} \|^{2}\right)\exp \left(-{\frac {1}{2}}\|\mathbf {x'} \|^{2}\right)\\&=\sum _{j=0}^{\infty }\quad \sum _{n_{1}+n_{2}+\dots +n_{k}=j}\exp \left(-{\frac {1}{2}}\|\mathbf {x} \|^{2}\right){\frac {x_{1}^{n_{1}}\cdots x_{k}^{n_{k}}}{\sqrt {n_{1}!\cdots n_{k}!}}}\exp \left(-{\frac {1}{2}}\|\mathbf {x'} \|^{2}\right){\frac {{x'}_{1}^{n_{1}}\cdots {x'}_{k}^{n_{k}}}{\sqrt {n_{1}!\cdots n_{k}!}}}\\&=\langle \varphi (\mathbf {x} ),\varphi (\mathbf {x'} )\rangle \end{alignedat}}}
φ
(
x
)
=
exp
(
−
1
2
‖
x
‖
2
)
(
a
l
0
(
0
)
,
a
1
(
1
)
,
…
,
a
l
1
(
1
)
,
…
,
a
1
(
j
)
,
…
,
a
l
j
(
j
)
,
…
)
{\displaystyle \varphi (\mathbf {x} )=\exp \left(-{\frac {1}{2}}\|\mathbf {x} \|^{2}\right)\left(a_{l_{0}}^{(0)},a_{1}^{(1)},\dots ,a_{l_{1}}^{(1)},\dots ,a_{1}^{(j)},\dots ,a_{l_{j}}^{(j)},\dots \right)}
on
l
j
=
(
k
+
j
−
1
j
)
{\displaystyle l_{j}={\tbinom {k+j-1}{j}}}
,
a
l
(
j
)
=
x
1
n
1
⋯
x
k
n
k
n
1
!
⋯
n
k
!
|
n
1
+
n
2
+
⋯
+
n
k
=
j
∧
1
≤
l
≤
l
j
{\displaystyle a_{l}^{(j)}={\frac {x_{1}^{n_{1}}\cdots x_{k}^{n_{k}}}{\sqrt {n_{1}!\cdots n_{k}!}}}\quad |\quad n_{1}+n_{2}+\dots +n_{k}=j\wedge 1\leq l\leq l_{j}}
Com que les màquines de vectors de suport i altres models que utilitzen el truc del nucli no s'escalen bé a un gran nombre de mostres d'entrenament o un gran nombre de funcions a l'espai d'entrada, s'han introduït diverses aproximacions al nucli RBF (i a nuclis similars). Normalment, aquests prenen la forma d'una funció z que mapeja un sol vector a un vector de dimensionalitat més alta, aproximant-se al nucli: [3]
⟨
z
(
x
)
,
z
(
x
′
)
⟩
≈
⟨
φ
(
x
)
,
φ
(
x
′
)
⟩
=
K
(
x
,
x
′
)
{\displaystyle \langle z(\mathbf {x} ),z(\mathbf {x'} )\rangle \approx \langle \varphi (\mathbf {x} ),\varphi (\mathbf {x'} )\rangle =K(\mathbf {x} ,\mathbf {x'} )}
on
φ
{\displaystyle \textstyle \varphi }
és el mapeig implícit incrustat al nucli RBF.[4]
↑ Chang , Yin-Wen; Hsieh , Cho-Jui; Chang , Kai-Wei; Ringgaard , Michael; Lin , Chih-Jen Journal of Machine Learning Research , 11, 2010, pàg. 1471–1490.
↑ «Radial Basis Function Kernel - Machine Learning » (en anglès americà). https://www.geeksforgeeks.org,+05-06-2020.+ [Consulta: 21 agost 2023].
↑ Sreenivasa , Sushanth. «Radial Basis Function (RBF) Kernel: The Go-To Kernel » (en anglès). https://towardsdatascience.com/,+12-10-2020.+ [Consulta: 21 agost 2023].
↑ «The Radial Basis Function Kernel » (en anglès). https://pages.cs.wisc.edu.+ [Consulta: 21 agost 2023].