up lect 20

This commit is contained in:
Andreaierardi 2020-05-19 10:26:30 +02:00
parent be23cfd406
commit f78b9da0a8
14 changed files with 737 additions and 10 deletions

View File

@ -0,0 +1,13 @@
\relax
\@nameuse{bbl@beforestart}
\babel@aux{english}{}
\@writefile{toc}{\contentsline {chapter}{\numberline {1}Lecture 20 - 19-05-2020}{1}\protected@file@percent }
\@writefile{lof}{\addvspace {10\p@ }}
\@writefile{lot}{\addvspace {10\p@ }}
\@writefile{toc}{\contentsline {section}{\numberline {1.1}Support Vector Machine Analysis}{1}\protected@file@percent }
\@writefile{toc}{\contentsline {subsection}{\numberline {1.1.1}Fritz John Optimality Conditions}{1}\protected@file@percent }
\@writefile{toc}{\contentsline {subsection}{\numberline {1.1.2}Non-separable case}{2}\protected@file@percent }
\@writefile{lof}{\contentsline {figure}{\numberline {1.1}{\ignorespaces }}{2}\protected@file@percent }
\@writefile{lof}{\contentsline {figure}{\numberline {1.2}{\ignorespaces }}{3}\protected@file@percent }
\@writefile{lof}{\contentsline {figure}{\numberline {1.3}{\ignorespaces }}{3}\protected@file@percent }
\@writefile{toc}{\contentsline {section}{\numberline {1.2}Pegasos: OGD to solve SVM}{4}\protected@file@percent }

View File

@ -0,0 +1,423 @@
This is pdfTeX, Version 3.14159265-2.6-1.40.21 (MiKTeX 2.9.7300 64-bit) (preloaded format=pdflatex 2020.4.13) 19 MAY 2020 10:24
entering extended mode
**./lecture20.tex
(lecture20.tex
LaTeX2e <2020-02-02> patch level 5
L3 programming layer <2020-03-06>
("C:\Program Files\MiKTeX 2.9\tex/latex/subfiles\subfiles.cls"
Document Class: subfiles 2020/02/14 v1.6 Multi-file projects (class)
Preamble taken from file `../main.tex'
("C:\Program Files\MiKTeX 2.9\tex/latex/tools\verbatim.sty"
Package: verbatim 2019/11/10 v1.5r LaTeX2e package for verbatim enhancements
\every@verbatim=\toks15
\verbatim@line=\toks16
\verbatim@in@stream=\read2
)
("C:\Program Files\MiKTeX 2.9\tex/latex/import\import.sty"
Package: import 2020/04/01 v 6.2
) (../main.tex
("C:\Program Files\MiKTeX 2.9\tex/latex/base\report.cls"
Document Class: report 2019/12/20 v1.4l Standard LaTeX document class
("C:\Program Files\MiKTeX 2.9\tex/latex/base\size12.clo"
File: size12.clo 2019/12/20 v1.4l Standard LaTeX file (size option)
)
\c@part=\count167
\c@chapter=\count168
\c@section=\count169
\c@subsection=\count170
\c@subsubsection=\count171
\c@paragraph=\count172
\c@subparagraph=\count173
\c@figure=\count174
\c@table=\count175
\abovecaptionskip=\skip47
\belowcaptionskip=\skip48
\bibindent=\dimen134
)
("C:\Program Files\MiKTeX 2.9\tex/latex/amsmath\amsmath.sty"
Package: amsmath 2020/01/20 v2.17e AMS math features
\@mathmargin=\skip49
For additional information on amsmath, use the `?' option.
("C:\Program Files\MiKTeX 2.9\tex/latex/amsmath\amstext.sty"
Package: amstext 2000/06/29 v2.01 AMS text
("C:\Program Files\MiKTeX 2.9\tex/latex/amsmath\amsgen.sty"
File: amsgen.sty 1999/11/30 v2.0 generic functions
\@emptytoks=\toks17
\ex@=\dimen135
))
("C:\Program Files\MiKTeX 2.9\tex/latex/amsmath\amsbsy.sty"
Package: amsbsy 1999/11/29 v1.2d Bold Symbols
\pmbraise@=\dimen136
)
("C:\Program Files\MiKTeX 2.9\tex/latex/amsmath\amsopn.sty"
Package: amsopn 2016/03/08 v2.02 operator names
)
\inf@bad=\count176
LaTeX Info: Redefining \frac on input line 227.
\uproot@=\count177
\leftroot@=\count178
LaTeX Info: Redefining \overline on input line 389.
\classnum@=\count179
\DOTSCASE@=\count180
LaTeX Info: Redefining \ldots on input line 486.
LaTeX Info: Redefining \dots on input line 489.
LaTeX Info: Redefining \cdots on input line 610.
\Mathstrutbox@=\box45
\strutbox@=\box46
\big@size=\dimen137
LaTeX Font Info: Redeclaring font encoding OML on input line 733.
LaTeX Font Info: Redeclaring font encoding OMS on input line 734.
\macc@depth=\count181
\c@MaxMatrixCols=\count182
\dotsspace@=\muskip16
\c@parentequation=\count183
\dspbrk@lvl=\count184
\tag@help=\toks18
\row@=\count185
\column@=\count186
\maxfields@=\count187
\andhelp@=\toks19
\eqnshift@=\dimen138
\alignsep@=\dimen139
\tagshift@=\dimen140
\tagwidth@=\dimen141
\totwidth@=\dimen142
\lineht@=\dimen143
\@envbody=\toks20
\multlinegap=\skip50
\multlinetaggap=\skip51
\mathdisplay@stack=\toks21
LaTeX Info: Redefining \[ on input line 2859.
LaTeX Info: Redefining \] on input line 2860.
)
("C:\Program Files\MiKTeX 2.9\tex/latex/systeme\systeme.sty"
("C:\Program Files\MiKTeX 2.9\tex/latex/xstring\xstring.sty"
("C:\Program Files\MiKTeX 2.9\tex/generic/xstring\xstring.tex"
\integerpart=\count188
\decimalpart=\count189
)
Package: xstring 2019/02/06 v1.83 String manipulations (CT)
)
("C:\Program Files\MiKTeX 2.9\tex/generic/systeme\systeme.tex"
\SYS_systemecode=\toks22
\SYS_systempreamble=\toks23
\SYSeqnum=\count190
)
Package: systeme 2019/01/13 v0.32 Mise en forme de systemes d'equations (CT)
)
("C:\Program Files\MiKTeX 2.9\tex/latex/amsfonts\amssymb.sty"
Package: amssymb 2013/01/14 v3.01 AMS font symbols
("C:\Program Files\MiKTeX 2.9\tex/latex/amsfonts\amsfonts.sty"
Package: amsfonts 2013/01/14 v3.01 Basic AMSFonts support
\symAMSa=\mathgroup4
\symAMSb=\mathgroup5
LaTeX Font Info: Redeclaring math symbol \hbar on input line 98.
LaTeX Font Info: Overwriting math alphabet `\mathfrak' in version `bold'
(Font) U/euf/m/n --> U/euf/b/n on input line 106.
))
("C:\Program Files\MiKTeX 2.9\tex/latex/subfiles\subfiles.sty"
Package: subfiles 2020/02/14 v1.6 Multi-file projects (package)
)
("C:\Program Files\MiKTeX 2.9\tex/generic/babel\babel.sty"
Package: babel 2020/02/28 3.41 The Babel package
("C:\Program Files\MiKTeX 2.9\tex/generic/babel\switch.def"
File: switch.def 2020/02/28 3.41 Babel switching mechanism
)
*************************************
* Local config file bblopts.cfg used
*
("C:\Program Files\MiKTeX 2.9\tex/latex/arabi\bblopts.cfg"
File: bblopts.cfg 2005/09/08 v0.1 add Arabic and Farsi to "declared" options of
babel
)
("C:\Program Files\MiKTeX 2.9\tex/latex/babel-english\english.ldf"
Language: english 2017/06/06 v3.3r English support from the babel system
("C:\Program Files\MiKTeX 2.9\tex/generic/babel\babel.def"
File: babel.def 2020/02/28 3.41 Babel common definitions
\babel@savecnt=\count191
\U@D=\dimen144
("C:\Program Files\MiKTeX 2.9\tex/generic/babel\txtbabel.def")
\bbl@readstream=\read3
\bbl@dirlevel=\count192
)
Package babel Info: \l@canadian = using hyphenrules for english
(babel) (\language0) on input line 102.
Package babel Info: \l@australian = using hyphenrules for ukenglish
(babel) (\language72) on input line 105.
Package babel Info: \l@newzealand = using hyphenrules for ukenglish
(babel) (\language72) on input line 108.
))
("C:\Program Files\MiKTeX 2.9\tex/latex/xcolor\xcolor.sty"
Package: xcolor 2016/05/11 v2.12 LaTeX color extensions (UK)
("C:\Program Files\MiKTeX 2.9\tex/latex/graphics-cfg\color.cfg"
File: color.cfg 2016/01/02 v1.6 sample color configuration
)
Package xcolor Info: Driver file: pdftex.def on input line 225.
("C:\Program Files\MiKTeX 2.9\tex/latex/graphics-def\pdftex.def"
File: pdftex.def 2018/01/08 v1.0l Graphics/color driver for pdftex
)
Package xcolor Info: Model `cmy' substituted by `cmy0' on input line 1348.
Package xcolor Info: Model `hsb' substituted by `rgb' on input line 1352.
Package xcolor Info: Model `RGB' extended on input line 1364.
Package xcolor Info: Model `HTML' substituted by `rgb' on input line 1366.
Package xcolor Info: Model `Hsb' substituted by `hsb' on input line 1367.
Package xcolor Info: Model `tHsb' substituted by `hsb' on input line 1368.
Package xcolor Info: Model `HSB' substituted by `hsb' on input line 1369.
Package xcolor Info: Model `Gray' substituted by `gray' on input line 1370.
Package xcolor Info: Model `wave' substituted by `hsb' on input line 1371.
("C:\Program Files\MiKTeX 2.9\tex/latex/graphics\dvipsnam.def"
File: dvipsnam.def 2016/06/17 v3.0m Driver-dependent file (DPC,SPQR)
))
("C:\Program Files\MiKTeX 2.9\tex/latex/graphics\graphicx.sty"
Package: graphicx 2019/11/30 v1.2a Enhanced LaTeX Graphics (DPC,SPQR)
("C:\Program Files\MiKTeX 2.9\tex/latex/graphics\keyval.sty"
Package: keyval 2014/10/28 v1.15 key=value parser (DPC)
\KV@toks@=\toks24
)
("C:\Program Files\MiKTeX 2.9\tex/latex/graphics\graphics.sty"
Package: graphics 2019/11/30 v1.4a Standard LaTeX Graphics (DPC,SPQR)
("C:\Program Files\MiKTeX 2.9\tex/latex/graphics\trig.sty"
Package: trig 2016/01/03 v1.10 sin cos tan (DPC)
)
("C:\Program Files\MiKTeX 2.9\tex/latex/graphics-cfg\graphics.cfg"
File: graphics.cfg 2016/06/04 v1.11 sample graphics configuration
)
Package graphics Info: Driver file: pdftex.def on input line 105.
)
\Gin@req@height=\dimen145
\Gin@req@width=\dimen146
)
("C:\Program Files\MiKTeX 2.9\tex/latex/sectsty\sectsty.sty"
Package: sectsty 2002/02/25 v2.0.2 Commands to change all sectional heading sty
les
LaTeX Warning: Command \underbar has changed.
Check if current package is valid.
LaTeX Warning: Command \underline has changed.
Check if current package is valid.
) ("C:\Program Files\MiKTeX 2.9\tex/latex/framed\framed.sty"
Package: framed 2011/10/22 v 0.96: framed or shaded text with page breaks
\OuterFrameSep=\skip52
\fb@frw=\dimen147
\fb@frh=\dimen148
\FrameRule=\dimen149
\FrameSep=\dimen150
)
("C:\Program Files\MiKTeX 2.9\tex/latex/titlesec\titlesec.sty"
Package: titlesec 2019/10/16 v2.13 Sectioning titles
\ttl@box=\box47
\beforetitleunit=\skip53
\aftertitleunit=\skip54
\ttl@plus=\dimen151
\ttl@minus=\dimen152
\ttl@toksa=\toks25
\titlewidth=\dimen153
\titlewidthlast=\dimen154
\titlewidthfirst=\dimen155
)
("C:\Program Files\MiKTeX 2.9\tex/latex/base\fontenc.sty"
Package: fontenc 2020/02/11 v2.0o Standard LaTeX package
)))
("C:\Program Files\MiKTeX 2.9\tex/latex/l3backend\l3backend-pdfmode.def"
File: l3backend-pdfmode.def 2020-03-12 L3 backend support: PDF mode
\l__kernel_color_stack_int=\count193
\l__pdf_internal_box=\box48
)
(lecture20.aux)
\openout1 = `lecture20.aux'.
LaTeX Font Info: Checking defaults for OML/cmm/m/it on input line 2.
LaTeX Font Info: ... okay on input line 2.
LaTeX Font Info: Checking defaults for OMS/cmsy/m/n on input line 2.
LaTeX Font Info: ... okay on input line 2.
LaTeX Font Info: Checking defaults for OT1/cmr/m/n on input line 2.
LaTeX Font Info: ... okay on input line 2.
LaTeX Font Info: Checking defaults for T1/cmr/m/n on input line 2.
LaTeX Font Info: ... okay on input line 2.
LaTeX Font Info: Checking defaults for TS1/cmr/m/n on input line 2.
LaTeX Font Info: ... okay on input line 2.
LaTeX Font Info: Checking defaults for OMX/cmex/m/n on input line 2.
LaTeX Font Info: ... okay on input line 2.
LaTeX Font Info: Checking defaults for U/cmr/m/n on input line 2.
LaTeX Font Info: ... okay on input line 2.
("C:\Program Files\MiKTeX 2.9\tex/context/base/mkii\supp-pdf.mkii"
[Loading MPS to PDF converter (version 2006.09.02).]
\scratchcounter=\count194
\scratchdimen=\dimen156
\scratchbox=\box49
\nofMPsegments=\count195
\nofMParguments=\count196
\everyMPshowfont=\toks26
\MPscratchCnt=\count197
\MPscratchDim=\dimen157
\MPnumerator=\count198
\makeMPintoPDFobject=\count199
\everyMPtoPDFconversion=\toks27
) ("C:\Program Files\MiKTeX 2.9\tex/latex/epstopdf-pkg\epstopdf-base.sty"
Package: epstopdf-base 2020-01-24 v2.11 Base part for package epstopdf
("C:\Program Files\MiKTeX 2.9\tex/generic/infwarerr\infwarerr.sty"
Package: infwarerr 2019/12/03 v1.5 Providing info/warning/error messages (HO)
)
("C:\Program Files\MiKTeX 2.9\tex/latex/grfext\grfext.sty"
Package: grfext 2019/12/03 v1.3 Manage graphics extensions (HO)
("C:\Program Files\MiKTeX 2.9\tex/generic/kvdefinekeys\kvdefinekeys.sty"
Package: kvdefinekeys 2019-12-19 v1.6 Define keys (HO)
))
("C:\Program Files\MiKTeX 2.9\tex/latex/kvoptions\kvoptions.sty"
Package: kvoptions 2019/11/29 v3.13 Key value format for package options (HO)
("C:\Program Files\MiKTeX 2.9\tex/generic/ltxcmds\ltxcmds.sty"
Package: ltxcmds 2019/12/15 v1.24 LaTeX kernel commands for general use (HO)
)
("C:\Program Files\MiKTeX 2.9\tex/generic/kvsetkeys\kvsetkeys.sty"
Package: kvsetkeys 2019/12/15 v1.18 Key value parser (HO)
))
("C:\Program Files\MiKTeX 2.9\tex/latex/pdftexcmds\pdftexcmds.sty"
Package: pdftexcmds 2019/11/24 v0.31 Utility functions of pdfTeX for LuaTeX (HO
)
("C:\Program Files\MiKTeX 2.9\tex/generic/iftex\iftex.sty"
Package: iftex 2020/03/06 v1.0d TeX engine tests
)
Package pdftexcmds Info: \pdf@primitive is available.
Package pdftexcmds Info: \pdf@ifprimitive is available.
Package pdftexcmds Info: \pdfdraftmode found.
)
Package epstopdf-base Info: Redefining graphics rule for `.eps' on input line 4
85.
Package grfext Info: Graphics extension search list:
(grfext) [.pdf,.png,.jpg,.mps,.jpeg,.jbig2,.jb2,.PDF,.PNG,.JPG,.JPE
G,.JBIG2,.JB2,.eps]
(grfext) \AppendGraphicsExtensions on input line 504.
)
Chapter 1.
LaTeX Font Info: Trying to load font information for U+msa on input line 8.
("C:\Program Files\MiKTeX 2.9\tex/latex/amsfonts\umsa.fd"
File: umsa.fd 2013/01/14 v3.01 AMS symbols A
)
LaTeX Font Info: Trying to load font information for U+msb on input line 8.
("C:\Program Files\MiKTeX 2.9\tex/latex/amsfonts\umsb.fd"
File: umsb.fd 2013/01/14 v3.01 AMS symbols B
)
Underfull \hbox (badness 10000) in paragraph at lines 23--26
[]
Underfull \hbox (badness 10000) in paragraph at lines 29--32
[]
Underfull \hbox (badness 10000) in paragraph at lines 45--48
[]
[1
{C:/Users/AndreDany/AppData/Local/MiKTeX/2.9/pdftex/config/pdftex.map}]
Overfull \hbox (33.66243pt too wide) detected at line 66
\OML/cmm/m/it/12 [] \OT1/cmr/m/n/12 = [] \OML/cmm/m/it/12 [] \OT1/cmr/m/n/12
= [] = \OML/cmm/m/it/12 h[]\OT1/cmr/m/n/12 (\OML/cmm/m/it/12 w\OT1/cmr/m/n/12
) []
[]
Underfull \hbox (badness 10000) in paragraph at lines 70--76
[]
<../img/lez20-img1.JPG, id=21, 110.66344pt x 67.0003pt>
File: ../img/lez20-img1.JPG Graphic file (type jpg)
<use ../img/lez20-img1.JPG>
Package pdftex.def Info: ../img/lez20-img1.JPG used on input line 88.
(pdftex.def) Requested size: 117.00119pt x 70.84105pt.
Underfull \hbox (badness 10000) in paragraph at lines 85--94
[]
[2 <../img/lez20-img1.JPG>]
<../img/lez20-img2.JPG, id=25, 98.61844pt x 79.04532pt>
File: ../img/lez20-img2.JPG Graphic file (type jpg)
<use ../img/lez20-img2.JPG>
Package pdftex.def Info: ../img/lez20-img2.JPG used on input line 107.
(pdftex.def) Requested size: 77.99881pt x 62.51866pt.
<../img/lez20-img3.JPG, id=26, 210.03468pt x 101.62968pt>
File: ../img/lez20-img3.JPG Graphic file (type jpg)
<use ../img/lez20-img3.JPG>
Package pdftex.def Info: ../img/lez20-img3.JPG used on input line 115.
(pdftex.def) Requested size: 195.0pt x 94.35489pt.
Underfull \hbox (badness 10000) in paragraph at lines 103--120
[]
Underfull \hbox (badness 10000) in paragraph at lines 103--120
[]
Underfull \hbox (badness 10000) in paragraph at lines 103--120
[]
Underfull \hbox (badness 10000) in paragraph at lines 126--139
[]
[3 <../img/lez20-img2.JPG> <../img/lez20-img3.JPG>] [4] [5] (lecture20.aux) )
Here is how much of TeX's memory you used:
5126 strings out of 480934
69269 string characters out of 2909670
335085 words of memory out of 3000000
20872 multiletter control sequences out of 15000+200000
548174 words of font info for 59 fonts, out of 3000000 for 9000
1141 hyphenation exceptions out of 8191
42i,7n,50p,333b,236s stack positions out of 5000i,500n,10000p,200000b,50000s
<
C:\Users\AndreDany\AppData\Local\MiKTeX\2.9\fonts/pk/ljfour/jknappen/ec/dpi600\
ecbx1200.pk> <C:\Users\AndreDany\AppData\Local\MiKTeX\2.9\fonts/pk/ljfour/jknap
pen/ec/dpi600\ecbx1440.pk> <C:\Users\AndreDany\AppData\Local\MiKTeX\2.9\fonts/p
k/ljfour/jknappen/ec/dpi600\ecti1200.pk> <C:\Users\AndreDany\AppData\Local\MiKT
eX\2.9\fonts/pk/ljfour/jknappen/ec/dpi600\ecrm1200.pk> <C:\Users\AndreDany\AppD
ata\Local\MiKTeX\2.9\fonts/pk/ljfour/jknappen/ec/dpi600\ecbx1728.pk> <C:\Users\
AndreDany\AppData\Local\MiKTeX\2.9\fonts/pk/ljfour/jknappen/ec/dpi600\ecbx2488.
pk><C:/Program Files/MiKTeX 2.9/fonts/type1/public/amsfonts/cm/cmex10.pfb><C:/P
rogram Files/MiKTeX 2.9/fonts/type1/public/amsfonts/cm/cmmi12.pfb><C:/Program F
iles/MiKTeX 2.9/fonts/type1/public/amsfonts/cm/cmmi6.pfb><C:/Program Files/MiKT
eX 2.9/fonts/type1/public/amsfonts/cm/cmmi8.pfb><C:/Program Files/MiKTeX 2.9/fo
nts/type1/public/amsfonts/cm/cmr12.pfb><C:/Program Files/MiKTeX 2.9/fonts/type1
/public/amsfonts/cm/cmr8.pfb><C:/Program Files/MiKTeX 2.9/fonts/type1/public/am
sfonts/cm/cmsy10.pfb><C:/Program Files/MiKTeX 2.9/fonts/type1/public/amsfonts/c
m/cmsy6.pfb><C:/Program Files/MiKTeX 2.9/fonts/type1/public/amsfonts/cm/cmsy8.p
fb><C:/Program Files/MiKTeX 2.9/fonts/type1/public/amsfonts/symbols/msam10.pfb>
<C:/Program Files/MiKTeX 2.9/fonts/type1/public/amsfonts/symbols/msbm10.pfb>
Output written on lecture20.pdf (5 pages, 206546 bytes).
PDF statistics:
235 PDF objects out of 1000 (max. 8388607)
0 named destinations out of 1000 (max. 500000)
16 words of extra memory for PDF output out of 10000 (max. 10000000)

View File

@ -3,4 +3,209 @@
\chapter{Lecture 20 - 19-05-2020}
\section{Support Vector Machine Analysis}
$$
\min_{w \in \barra{R}} \frac{1}{2}
\| w\|^2 \qquad s.t \quad y_t \, w^T \, x_t \geq 1 \ t =1 ,...,m$$
$$
\max_{\gamma >0} \gamma^2 \qquad s.t. \quad \|u\|^2 < 1 (?) \quad y_t \, u^T \, x_t \geq \gamma \ t = 1,...,m
$$
The two are kinda equivalent
$$
y_t \left( \frac{u}{\gamma}^2 \right) x_t \geq 1 \ t=1,...,m \qquad w = \frac{u}{\gamma} \qquad \|u\|^2 = \|w\|^2 \gamma^2 = 1, \ \gamma^2 = \frac{1}{\|w\|^2}
$$
$$
\max \frac{1}{\|w\|^2} \rightsquigarrow \min \|w\|^2 \qquad w^* = \frac{u^*}{\gamma^*}
$$
$$
\gamma^2 \| w\|^2 = 1 \textit{ is redundant!} \qquad y_t w^T x_t \geq 1 \ t=1,...,m
$$
What we do with $w^*$?
\\
\subsection{Fritz John Optimality Conditions}
$$
\min_{w \in \barra{R}^d} f(w) \quad s.t \quad g_t(w) \leq 0 \ t=1,...,m \qquad \textit{ $f,g_1,..,g_m$ all differentiable}
$$
If $w_0$ is optimal solution, then $\exists \alpha = (\alpha_1,...,\alpha_m) \in \barra{R}^m$
\\
$$
\nabla f(w_0) + \sum_{t \in I} \alpha_t \nabla g_t (w_0) = 0 \qquad I = \{ t : g_t(w_0) = 0 \}
$$
$$
f(n) = \frac{1}{2} \| w \|^2 \qquad g_t(w)= 1 - y_t \, w^T \, x_t, \ \nabla g_t(w^*) = - y_t \, x_t
$$
$w^*$ SVM solution
$$
w^* - \sum_{t \in I} \alpha_t y_t x_t = 0 \ \ \Leftrightarrow \ \ w^* = \sum_{t \in I} \alpha_t y_t x_t
$$
where $f(n) = \nabla f(w^*)$
$$
I = \{ \, t : y_t(w^*)^T \, x_t = 1 \} \textbf{ support vectors}
$$
We want a generalisation of this two non separable training set.
\\
\subsection{Non-separable case}
$$
\min_{w \in \barra{R}^d} \frac{1}{2}
\| w\|^2 \qquad s.t \quad y_t\, w^T \, x_t \ \geq 1$$
We cannot satisfy all the constraints since are inconsistent. Maybe we can try to satisfy the most possible constrain so:
$$
\min_{w \in \barra{R}^d} \frac{1}{2}
\| w\|^2 + \frac{1}{2} \sum_{t=1}^m \xi_t \qquad
y_t\, w^T \, x_t \ \geq 1- \xi_t
$$
where $\xi_t$ slack variables and $ \xi > 0$
We want $\xi_t$ given $w$:
$$
\xi_t = \begin{cases}
1- y_t \, w^T \, x_t \qquad if \ y_t \, w^T x_t < 1
\\
0 \qquad otherwise
\end{cases} \qquad \xi_t = \left[ 1- y_t \, w^T \, x_t \right] = h_t(w) \ \textit{ hinge loss}
$$
We replate this in the first equation and we get a convex function plus $\lambda$-SC function:
$$
\min_{w \in \barra{R}^d} F(w) \qquad F(w) = \frac{1}{m} \sum_{t = 1}^m h_t(w) + \frac{1}{2}
\| w\|^2 $$
And this is unconstrained and $F(W)$ is $\lambda$-S.C.
\\\\
I also want to check my shape of the function is not changing.
\\
Assume I can write the solution as:
$$
w^* = \sum_{t=1}^m \alpha_t \, y_t \, x_t + u
$$
where $u$ is orthogonal to each of $x_1,...,x_m$
$
\sum_{t=1}^m \alpha_t \, y_t \, x_t \ = \ v
$
$$
w^* = v + u \qquad v = w^* - u \quad \|v \| \leq \| w^*\|
$$
\begin{figure}[h]
\centering
\includegraphics[width=0.3\linewidth]{../img/lez20-img1.JPG}
\caption{}
%\label{fig:}
\end{figure}\\
\\
Now I can check the hinge loss:
$$
h_t(v) = \left[ 1- y_t(w^*)^* x_t+ \red{y_t \, u^T \, x_t} \right]_+ = h_t(w^*)
$$
Since $y_t \, u^T \, x_t = 0$ this cancel out and we get the hinge loss.
$$
F(v) = \frac{1}{m} \sum_t h_t(w^*) + \frac{1}{2} \| w\|^2 \leq F(w^*)
$$
$$
w^* = \sum_{t=1}^m \alpha_t y_t x_t \qquad \alpha_t \neq 0 \ \Leftrightarrow \ h_t(w^*) > 0
$$
Including $t : y_t(w^*)^T x_t = 1$\\
\begin{figure}[h]
\centering
\includegraphics[width=0.2\linewidth]{../img/lez20-img2.JPG}
\caption{}
%\label{fig:}
\end{figure}\\
\\
Support vector are those in which I need slack variables in order to be satisfied.
\begin{figure}[h]
\centering
\includegraphics[width=0.5\linewidth]{../img/lez20-img3.JPG}
\caption{}
%\label{fig:}
\end{figure}\\
\\
$$
F(w) = \frac{1}{m} \sum_{t=1}^m h_t(w) + \frac{1}{2} \| w\|^2 = \frac{1}{m} \sum_{t=1}^m \ell_t(w)
$$
MANCA FORMULAA\\
We need to minimise the hinge loss and we use Pegasos.
\section{Pegasos: OGD to solve SVM}
Stochastic gradiant descent.
\\\\
Parameters: $ \lambda > 0$, $T$ number of rounds
\\
Set $w_1 =(0,...,0)$
\\
For $t = 1,...,T$
\\
1) Draw $(x_{zt}, y_{zt})$ at random from training set
\\
2) $w_{t+1} = w_t - \eta_t \nabla \ell_{zt}(w_t)$
\\
Output $\bar{w} = \frac{1}{T} \sum_t w_t$
$$
\ell_{zt}(w) = h_{zt} (w) + \frac{1}{2} \| w\|^2 \qquad w^* = arg \min_{w \in \barra{R}^*} \left( \frac{1}{m} \sum_{t=1}^m h_t(w) + \frac{\lambda}{2} \| w\|^2\right)
$$
$\forall s_1,...,s_T$ realisation of $z_1,...,z_T$
$$
\frac{1}{T} \sum_{t=1}^m \ell_{st}(w_t) \leq \frac{1}{T}\sum_{t=1}^m \ell_{st} (w^*) + \frac{G^2}{2 \, \lambda \, T} \ln (T+1) \quad OGD\ Analysis
$$
$$
G = \max_t \| \nabla \ell_{st}(w_t) \|
$$
In general $G$ is random.
$$
F(\bar{w}) \leq F(w^*) + \varepsilon \qquad \| \bar{w}- w^*\| \ \leq^? \ | F(\bar{w}) - F(w^*) | \ \leq \ L \| \bar{w} - w^* \|
$$
where $F$ is the average of the losses: $F(w_t) = \frac{1}{m} \sum_{s=1}^m \ell_s(w_t)$ \\
So we use Liptstik solution.
$$
\barra{E} \, [\ell_{zt}(w_t) | z_1,...,z_{t-1}] = \frac{1}{m} \sum_{s=1}^m \ell_s(w_t) \qquad \barra{E} \left[ \, X \, \right] = \barra{E} \left[ \, \barra{E} \left[ \, X | Y \, \right] \, \right]
$$
Now we use Jensen inequality:
$$
\barra{E} \, [ F(\bar{w} ) ] \ \leq^{J} \barra{E} \, \left[ \frac{1}{T} \sum_{t=1}^T F(w_t) \right] \ = \ \barra{E} \, \left[ \frac{1}{T} \sum_{t=1}^T \barra{E} \, \left[ \, \ell_{zt}(w_t) \, | \, z_1,...,z_{t-1} \, \right] \, \right]
\ = $$
$$
\ = \ \barra{E} \left[ \frac{1}{T} \sum^T_{t=1} \ell_{zt} (w_t) \right] \ \leq \ \barra{E} \left[ \frac{1}{T} \sum_{t=1}^T \ell_{zt}(w^*) \right] + \frac{\barra{E}[G^2]}{2 \, \lambda \, T} \ln (T+1) =
$$
$$
= \barra{E} \left[ \frac{1}{T} \sum_{t=1}^T \barra{E} [\ell_{zt}(w^*) | z_1,...,z_{t-1} ]\right] + \frac{\barra{E} [G^2]}{2 \, \lambda \, T} \ \ln \, (T+1) =
$$
$$
= \barra{E} \left[ \frac{1}{T} \sum_{t=1}^T F(w^*) \right] + \frac{E[G^2]}{2 \, \lambda \, T} \ln (T+1) = \ = F(w^*) + \frac{\barra{E} [G^2]}{2 \, \lambda \, T} \ln (T+1)
$$
$\barra{E} [G^2] \leq ?
$
We are bounding $G^2 \ \forall s_1,..,s_T$
$$
\nabla \ell_{st}(w_t) = - y_{st} \, x_{st} \, I\{ h_{st}(w_t) >0\} + \lambda \, w\qquad \ell_s(w) = h_t(w) + \frac{1}{2} \|w\|^2
$$
$$
v_t = y_{st} \, x_{st} \, I \{ h_{st} (w_t) >0 \}, \quad \nabla \ell_{st}(w_t) = - v_t + \lambda w_t \quad \eta_t = \frac{1}{\lambda \, t}
$$
$$
w_{t+1} = w_t - \eta_t \nabla \ell_t(w_t) = w_t+ \eta_t \, v_t -\eta_t \, \lambda \, w_t = \left(1- \frac{1}{t} \right) w_t + \frac{1}{\lambda \, t} v_t=
$$
$$
\|\nabla \ell_{st}(w_t) \| \leq \| v_t \| + \lambda \| w_t \| \leq X + \lambda \|w_t\| \qquad X = \max_t \| x_t\|
$$
$$
w_{t+1} = \left( 1- \frac{1}{t} \right) w_t + \frac{1}{\lambda \, t} v_t \qquad w_1 = (0,...0) \quad w_t = \sum_t \beta_t v_t
$$
Fix $s <t$ \quad $\frac{1}{\lambda \, s} \sqrt[]{s} $
$$
\beta_s = \frac{1}{\lambda \, s} \prod^t_{r = s+1} \left( 1- \frac{1}{r} \right) = \frac{1}{\lambda \, s} \prod_{t = s+1}^t \frac{r-1}{r} = \frac{1}{\lambda \, s} \frac{s}{t}
$$
$$
\frac{s}{s+1} \frac{s+1}{s+2}... \frac{t-1}{t} \qquad w_{t+1} = \frac{1}{\lambda \, t} \sum_{s=1}^t \sqrt[]{s}
$$
I know now that:
$$
\| \nabla \ell_{st}(w_t) \| \leq X + \lambda \|w_t \| \leq X_t \| \frac{1}{t} \sum_{s=1}^t \sqrt[]{s}\| \leq X + \frac{1}{t} \sum_{s=1}^t \| v_s \|
$$
$$
\| \nabla \ell_{st} (w_t) \| \leq 2 \, X \quad G^2 \leq 4\, x^2
$$
$$
\barra{E} [ F(\bar{w}] \leq F(w^*) + \frac{2 \, x^2}{\lambda \, T} \ln (T+1)
$$\\
General picture: Stochastic OGD, I can write my objective is an average of strongly convex function. I sample for w
$$
F(w) = \frac{1}{m} \sum_{t=1}^m \ell_t(w)
$$
Then i get the expectation to links OGD to minisation of the objective.
\end{document}

View File

@ -204,5 +204,12 @@
\@writefile{toc}{\contentsline {chapter}{\numberline {20}Lecture 20 - 19-05-2020}{121}\protected@file@percent }
\@writefile{lof}{\addvspace {10\p@ }}
\@writefile{lot}{\addvspace {10\p@ }}
\@writefile{toc}{\contentsline {section}{\numberline {20.1}Support Vector Machine Analysis}{121}\protected@file@percent }
\@writefile{toc}{\contentsline {subsection}{\numberline {20.1.1}Fritz John Optimality Conditions}{121}\protected@file@percent }
\@writefile{toc}{\contentsline {subsection}{\numberline {20.1.2}Non-separable case}{122}\protected@file@percent }
\@writefile{lof}{\contentsline {figure}{\numberline {20.1}{\ignorespaces }}{122}\protected@file@percent }
\@writefile{lof}{\contentsline {figure}{\numberline {20.2}{\ignorespaces }}{123}\protected@file@percent }
\@writefile{lof}{\contentsline {figure}{\numberline {20.3}{\ignorespaces }}{123}\protected@file@percent }
\@writefile{toc}{\contentsline {section}{\numberline {20.2}Pegasos: OGD to solve SVM}{124}\protected@file@percent }
\bibstyle{abbrv}
\bibdata{main}

View File

@ -95,3 +95,6 @@
\addvspace {10\p@ }
\contentsline {figure}{\numberline {19.1}{\ignorespaces Draw of SVG}}{120}%
\addvspace {10\p@ }
\contentsline {figure}{\numberline {20.1}{\ignorespaces }}{122}%
\contentsline {figure}{\numberline {20.2}{\ignorespaces }}{123}%
\contentsline {figure}{\numberline {20.3}{\ignorespaces }}{123}%

View File

@ -1,4 +1,4 @@
This is pdfTeX, Version 3.14159265-2.6-1.40.21 (MiKTeX 2.9.7300 64-bit) (preloaded format=pdflatex 2020.4.13) 18 MAY 2020 10:21
This is pdfTeX, Version 3.14159265-2.6-1.40.21 (MiKTeX 2.9.7300 64-bit) (preloaded format=pdflatex 2020.4.13) 19 MAY 2020 10:25
entering extended mode
**./main.tex
(main.tex
@ -3018,20 +3018,92 @@ Underfull \hbox (badness 10000) in paragraph at lines 164--148
[120 <./lectures/../img/lez19-img1.JPG>] (lectures/lecture20.tex
Chapter 20.
) [121
] (main.bbl
Underfull \hbox (badness 10000) in paragraph at lines 23--26
[]
Underfull \hbox (badness 10000) in paragraph at lines 29--32
[]
Underfull \hbox (badness 10000) in paragraph at lines 45--48
[]
[121
]
Overfull \hbox (33.66243pt too wide) detected at line 66
\OML/cmm/m/it/12 [] \OT1/cmr/m/n/12 = [] \OML/cmm/m/it/12 [] \OT1/cmr/m/n/12
= [] = \OML/cmm/m/it/12 h[]\OT1/cmr/m/n/12 (\OML/cmm/m/it/12 w\OT1/cmr/m/n/12
) []
[]
Underfull \hbox (badness 10000) in paragraph at lines 70--76
[]
<lectures/../img/lez20-img1.JPG, id=495, 110.66344pt x 67.0003pt>
File: lectures/../img/lez20-img1.JPG Graphic file (type jpg)
<use lectures/../img/lez20-img1.JPG>
Package pdftex.def Info: lectures/../img/lez20-img1.JPG used on input line 88.
(pdftex.def) Requested size: 117.00119pt x 70.84105pt.
Underfull \hbox (badness 10000) in paragraph at lines 85--94
[]
[122 <./lectures/../img/lez20-img1.JPG>]
<lectures/../img/lez20-img2.JPG, id=499, 98.61844pt x 79.04532pt>
File: lectures/../img/lez20-img2.JPG Graphic file (type jpg)
<use lectures/../img/lez20-img2.JPG>
Package pdftex.def Info: lectures/../img/lez20-img2.JPG used on input line 107
.
(pdftex.def) Requested size: 77.99881pt x 62.51866pt.
<lectures/../img/lez20-img3.JPG, id=500, 210.03468pt x 101.62968pt>
File: lectures/../img/lez20-img3.JPG Graphic file (type jpg)
<use lectures/../img/lez20-img3.JPG>
Package pdftex.def Info: lectures/../img/lez20-img3.JPG used on input line 115
.
(pdftex.def) Requested size: 195.0pt x 94.35489pt.
Underfull \hbox (badness 10000) in paragraph at lines 103--120
[]
Underfull \hbox (badness 10000) in paragraph at lines 103--120
[]
Underfull \hbox (badness 10000) in paragraph at lines 103--120
[]
Underfull \hbox (badness 10000) in paragraph at lines 126--139
[]
[123 <./lectures/../img/lez20-img2.JPG> <./lectures/../img/lez20-img3.JPG>]
[124]) [125] (main.bbl
LaTeX Warning: Empty `thebibliography' environment on input line 3.
) [122
) [126
] (main.aux) )
Here is how much of TeX's memory you used:
5696 strings out of 480934
87332 string characters out of 2909670
5714 strings out of 480934
87854 string characters out of 2909670
336249 words of memory out of 3000000
21286 multiletter control sequences out of 15000+200000
21301 multiletter control sequences out of 15000+200000
561784 words of font info for 96 fonts, out of 3000000 for 9000
1141 hyphenation exceptions out of 8191
34i,13n,42p,348b,361s stack positions out of 5000i,500n,10000p,200000b,50000s
@ -3063,9 +3135,9 @@ s/cm/cmr8.pfb><C:/Program Files/MiKTeX 2.9/fonts/type1/public/amsfonts/cm/cmsy1
/Program Files/MiKTeX 2.9/fonts/type1/public/amsfonts/cm/cmsy8.pfb><C:/Program
Files/MiKTeX 2.9/fonts/type1/public/amsfonts/symbols/msam10.pfb><C:/Program Fil
es/MiKTeX 2.9/fonts/type1/public/amsfonts/symbols/msbm10.pfb>
Output written on main.pdf (123 pages, 2630747 bytes).
Output written on main.pdf (127 pages, 2680957 bytes).
PDF statistics:
1008 PDF objects out of 1200 (max. 8388607)
1029 PDF objects out of 1200 (max. 8388607)
0 named destinations out of 1000 (max. 500000)
391 words of extra memory for PDF output out of 10000 (max. 10000000)
406 words of extra memory for PDF output out of 10000 (max. 10000000)

View File

@ -86,3 +86,7 @@
\contentsline {chapter}{\numberline {19}Lecture 19 - 18-05-2020}{117}%
\contentsline {section}{\numberline {19.1}Support Vector Machine (SVM)}{120}%
\contentsline {chapter}{\numberline {20}Lecture 20 - 19-05-2020}{121}%
\contentsline {section}{\numberline {20.1}Support Vector Machine Analysis}{121}%
\contentsline {subsection}{\numberline {20.1.1}Fritz John Optimality Conditions}{121}%
\contentsline {subsection}{\numberline {20.1.2}Non-separable case}{122}%
\contentsline {section}{\numberline {20.2}Pegasos: OGD to solve SVM}{124}%