Semirings

Semirings allow us to generalize many many common operations. One of the most powerful usages is the algebraic view of dynamic programming. Definition of a semiring A semiring is a 5-tuple $R = (A, \oplus, \otimes, \bar{0}, \bar{1})$ such that. $(A, \oplus, \bar{0})$ is a commutative monoid $(A, \otimes, \bar{1})$ is a monoid $\otimes$ distributes over $\oplus$. $\bar{0}$ is annihilator for $\otimes$. Monoid Let $K, \oplus$ be a set and a operation, then: ...

Reading Time: 3 minutes ·  By Xuanqiang 'Angelo' Huang

Sentiment Analysis

Sentiment analysis is one of the oldest tasks in natural language processing. In this note we will introduce some examples and terminology, some key problems in the field and a simple model that we can understand by just knowing Backpropagation Log Linear Models and the Softmax Function. We say: Polarity: the orientation of the sentiment. Subjectivity: if it expresses personal feelings. See demo Some applications: Businesses use sentiment analysis to understand if users are happy or not with their product. It’s linked to revenue: if the reviews are good, usually you make more money. But companies can’t read every review, so they want automatic methods. ...

Reading Time: 2 minutes ·  By Xuanqiang 'Angelo' Huang

The Exponential Family

This is the generalization of the family of function where Softmax Function belongs. Many many functions are part of this family, most of the distributions that are used in science are part of the exponential family, e.g. beta, Gaussian, Bernoulli, Categorical distribution, Gamma, Beta, Poisson, are all part of the exponential family. The useful thing is the generalization power of this set of functions: if you prove something about this family, you prove it for every distribution that is part of this family. This family of functions is also closely linked too Generalized Linear Models (GLMs). ...

Reading Time: 6 minutes ·  By Xuanqiang 'Angelo' Huang

Transliteration systems

This note is still a TODO. Transliteration is learning learning a function to map strings in one character set to strings in another character set. The basic example is in multilingual applications, where it is needed to have the same string written in different languages. The goal is to develop a probabilistic model that can map strings from input vocabulary $\Sigma$ to an output vocabulary $\Omega$. We will extend the concepts presented in Automi e Regexp for Finite state automata to a weighted version. You will also need knowledge from Descrizione linguaggio for definitions of alphabets and strings, Kleene Star operations. ...

Reading Time: 4 minutes ·  By Xuanqiang 'Angelo' Huang

Reti convoluzionali

Abbiamo trattato i modelli classici in Convolutional Neural Network. Con i vecchi files di notion Il Kernel I punti interessanti delle immagini sono solamente i punti di cambio solo che attualmente siamo in stato discreto, quindi ci è difficile usare una derivata, si usano kernel del tipo: $\left[ 1, 0, -1 \right]$, che sarà positivo se cresce verso sinistra, negativo se scende. feature map Sono delle mappe che rappresentano alcune informazioni interessanti della nostra immagine. ...

Reading Time: 1 minute ·  By Xuanqiang 'Angelo' Huang

Determinanti

Determinanti I determinanti sono un numero associato alle matrici quadrate. Più o meno ne sono il riassunto. Proprietà Le prime 3 sono quelle fondamentali per calcolare il tutto, i numeri dopo il 3 sono alcune conseguenze. det I = 1 Cambiare righe → cambiare il segno della determinante. (Importante) Se moltiplico una riga per una costante, il determinante è moltiplicato per questa costante. Se sommo una costante a una riga, allora il determinante è una somma strana… Immagine di esempio ...

Reading Time: 4 minutes ·  By Xuanqiang 'Angelo' Huang

Introduzione ad architettura

1.1 Il principio di astrazione/implementazione Astrazione per macchine livello n con linguaggi n. 1.2 I livelli principali di astrazione Livelli in breve 1.2.1 Livello 0 Qua è utile indagare la Porte Logiche in cui si indagano in un modo molto alto il funzionamento di porte È il livello fisico delle porte logiche e dell’ingegneria elettrica. 1.2.2 Livello 1 Link utili potrebbero essere la Central Processing Unit ...

Reading Time: 2 minutes ·  By Xuanqiang 'Angelo' Huang

Central Processing Unit

La struttura moderna degli elaboratori sono basati principalmente sull’architettura di Von Neuman, l’unica differenza è che gli elementi di questa architettura. Struttura e funzione della CPU La CPU si può dividere in tre parti principali: Una unità di controllo che coordina i processi Registri che immagazzinano temporaneamente piccole quantità di informazioni ALU che fa i calcoli ordinategli dalla CPU Registri Principali Program Counter o Instruction Pointer Contiene un pointer all’istruzione da eseguire così lo prende dalla memoria Instruction Register Contiene l’istruzione da eseguire Memory Address Register Prende l’indirizzo del contenuto interessante dalla memoria Memory Data Register Prende il contenuto dalla memoria Program Status Word Raccoglie lo stato di esecuzione del programma, se fallisce se tutto ok oppure se ci sono errori ALU Aritmetic Logic Unit, è la componente che fa i calcoli. Per sapere cosa deve fare, è la Control Unit che collega certe vie dai registri all’ALU. A seconda del genere di architettura può collegarsi direttamente in memoria (CISC) oppure sempre passando per i registri (solitamente RISC) ...

Reading Time: 7 minutes ·  By Xuanqiang 'Angelo' Huang

Message Passing

ora abbiamo alcune primitive per passarci i messaggi, vogliamo creare metodo in modo che i processi si possano sincronizzare mandando messaggi. la memoria è sempre privata. Primitive Send e receive Send Spedizione del messaggio input deve avere un identificato al processo su cui spedire. Se si vuole espandere si possono avere multicast e broadcasting ma non li studieremo in questo corso. Receive Ricevi messaggi Tassonomia dei message passing (!) Slide ...

Reading Time: 2 minutes ·  By Xuanqiang 'Angelo' Huang

Livello applicazione e socket

Livello trasporto Protocolli classici Introduzione a TCP e UPD Il quarto livello dei protocolli dell’architettura di Internet è il livello trasporto (transport), ed è basato su due protocolli in particolare: il Transmission Control Protocol (TCP) e lo User Data Protocol (UDP), che possono essere usati in alternativa tra loro. Questo è nel genere di *connession oriented e non, il primo, TCP è connection oriented, l’altro no, questa è l’unica differenza fra i due. Questa differenza è spiegata in maggior dettaglio qui [0.3.8 Servizi orientati alla connessione e non ...

Reading Time: 13 minutes ·  By Xuanqiang 'Angelo' Huang