We can update w after (repeating) an “epoch” l training data → Batch algorithm (blu) (as…
- User
We can update w after (repeating) an “epoch” l training data → Batch algorithm (blu) (as used above) • Or we can update w after each pattern p → On-line algorithm (stochastic gradient descent) (purple and green): – it can be the faster, but need smaller step
Spiegami meglio questi concetti
- Assistant
- User
Resume on DATA notation University of Pisa • Each row, generic x (vector - bold), a raw in the table: (input) example, pattern, instance, sample, …, input vector, ... • xi or xj (scalar): component i or j (given a pattern, i.e. omitting p) • xp (or xi ) (vector – bold) p-th (or i-th ) raw in the table = pattern p (or i) • xp,i (scalar) also as (xp )i : component i of the pattern p (or we use xp,j for the component j, etc.) • For the target we will typically use just yp with p=1..l (the same for d or t) • Note: in the slide , univariate case with 1 variable: xp=xp,1= (xp )1 Micheli 29 Pattern x1 x2 xi xn Pat 1 x1,1 x1,2 x1,n … Pat p xp,1 xp,2 xp,i xp,n … We often need to omit some indices when the context is clear, e.g.: l rows, n columns (features, variables, attributes) X is a matrix l x n p=1..l, i=1..n Dip. Informatica University of Pisa Micheli 30 Multidimensional input: Notation • Assuming column vector for x and w (in bold) • Number of data l, dimension of input vector n, yp (targets) • Note that often, as before, the transpose notation T in wT is omitted • w0 is the intercept, threshold, bias, offset….. Often it is convenient to include the constant x0 = 1 so that we can write it as : 𝒘𝑇𝒙 + 𝑤0 = 𝑤0 + 𝑤1𝑥1 + 𝑤2𝑥2 + ⋯ + 𝑤𝑛𝑥𝑛 = 𝑤0 + 𝑖=1 𝑛 𝑤𝑖𝑥𝑖 𝒘𝑇𝒙 = 𝒙 𝑇𝒘 Inner product [1, 1, 2,.., n] T x = x x x Note: w continuous (free) parameters “weights” p=1..l [ 0, 1, 2,.., n] T w = w w w w Previously also dp or tp Dip. Informatica University of Pisa Micheli 31 Geometrical view: hyperplane 𝒙 𝑇𝒘 = 𝒘𝑇𝒙 = 𝑤0 + 𝑤1𝑥1 + 𝑤2𝑥2 ℎ(𝒙𝑝 ) = 𝒙𝑝 𝑇𝒘 = 𝑖=0 𝑛 𝑥𝑝,𝑖 𝑤𝑖 Pattern p Hence Feature i : [ 0, 1, 2,.., n] T w = w w w w For 2 variables n dim: Def
- Assistant
Certamente, ecco un riassunto rapido e chiaro delle notazioni di base usate per discutere di modelli di apprendimento automatico, basandoci sull'esempio fornito dall’Università di Pisa:
-
x (in grassetto): Indica un vettore che rappresenta una singola istanza (riga) nel dataset. Questi termini sono interscambiabili: esempio, pattern, istanza, campione o vettore di input.
-
xi o xj (scalare): Rappresenta il valore della componente (i) o (j) di un pattern dato, cioè, una specifica caratteristica o attributo di un pattern.
-
- User
Gradient descent algorithm A simple algorithm:
- Start with weight vector winitial (small), fix eta (0<eta<1).
- Compute Dw= -“gradient of E(w)” = - (or for each wj )
- Compute wnew= w+ eta*Dw (or for each wj ) Repeat (2) until convergence or E(w) is “sufficiently small”
Scrivi in italiano
- Assistant
L'algoritmo della discesa del gradiente è un metodo semplice ma efficace per trovare i valori dei parametri (o pesi) di un modello che minimizzano la funzione di errore (o perdita). Ecco come funziona tradotto in italiano:
- User
Advantages of linear models • If it works well it is a “wonderful” model – Very simple – All the information on data are in w – Easy to be interpreted: everyday practice in medicine, biology, chemistry, economy, … – Noisy data are allowed ▪ Statisticians are happy (nice properties) ▪ Linear phenomena: a dream for science: ideal to make a “natural law” • A baseline for learning (first: is it a linear problem?) • It is used/included in more complex models
Spiega
- Assistant
- User
Note that in hw (x)=w1 x+w0 or • As Statistical Parametric models: "linear" does not refer to this straight line, but rather to the way in which the regression coefficients w occur in the regression equation • Hence, we can use also transformed inputs, such are x, x 2 , x3 , x4 , …. with non-linear relationship inputs and output, holding the learning machinery (Least Square solution) developed so far… A. Micheli 39 ℎ𝑾(𝒙) = 𝒘T ⋅ 𝒙 polynomial regression
Spiega il concetto fondamentale
- Assistant
- User
A generalization - LBE (shown for regression) • Basis transformation: linear basis expansion : • Augment the input vector with additional variables which are transformations of x according to a function phi (k : Rn→R) • E.g – Polynomial representation of x: (x)=xj 2 or (x)= xj xi, or …. – Non-linear transformation of single inputs: (x)=log(xj ), (x)= root(xj ), …. – Non-linear transformation of multiple input: (x)= ||x|| – Splines, …, …. • Number parameters K > n (before it was n) • The model is linear in the parameters (also in phi, not in x): we can use the same learning alg. as before! ℎ𝒘(𝒙) = 𝑘=0 𝐾 𝑤𝑘𝑘(𝒙) Def Dip. Informatica University of Pisa Micheli 42 Basis Expansion: examples • Basis transformation: linear basis expansion : EXAMPLES: • [1-dim x] h(x) [For the number of terms in polynomial with D dim. input see a slide later] • Or “any other”, e.g. (x)=([x1,x2,x3 ]) h(x) = w1 x1+ w2 x2 + w3 log(x2 )+ w4 log(x3 ) + w5 (x2 x3 )+ w0 1-dim polynomial regression (K=M) Exercize: try to compute the gradient for such cases ℎ𝒘(𝒙) = 𝑘=0 𝐾 𝑤𝑘𝑘(𝒙) Dip. Informatica University of Pisa Micheli 43 Basis Expansion criticism • Which phi () ? Toward the so called “dictionary” approaches • PROS: It is more expressive: it can model more complicated relationships (than linear). • CONS: With large basis of functions, we require methods for controlling the complexity of the model: – see the motivation in the next slides….
- Assistant
- User
Dammi le definizione dell'overfitting e dell'underfitting
- Assistant
L'overfitting e l'underfitting sono due concetti fondamentali nell'apprendimento automatico e nella modellazione statistica, che si riferiscono a come un modello si adatta ai dati di addestramento e generalizza a dati nuovi e non visti.