Skip to content

Commit

Permalink
[DLSP21] Update 11-2.md and 15-2.md (Atcold#769)
Browse files Browse the repository at this point in the history
* Update 15-2.md

[DLSP21] Deleted a line (Covered in section 2), but there was no section 2 in the blog

* corrected equations and inconsistencies in 11-2.md

* Change in equation for english version

* Equation change in spanish version

* updated equation in french version

* Updated equation for japanese

* Updated the equation in Korean

* Updated  equation in turkish

* Updated equations in chinese version.

* Fix alignment, remove e from margin-e

Co-authored-by: Alfredo Canziani <[email protected]>
  • Loading branch information
rahuja123 and Atcold authored Jul 2, 2021
1 parent 2e331df commit 3acc4e4
Show file tree
Hide file tree
Showing 8 changed files with 66 additions and 96 deletions.
20 changes: 8 additions & 12 deletions docs/en/week11/11-2.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,15 +83,13 @@ This margin-base loss allows for different inputs to have variable amounts of ta
### Hinge Embedding Loss - `nn.HingeEmbeddingLoss()`

$$
\begin{equation}
l_n =
\left\{
\begin{array}{lr}
x_n, &\quad y_n=1, \\
\max\{0,\Delta-x_n\}, &\quad y_n=-1 \\
\end{array}
\begin{array}{lr}
x_n, &\quad y_n=1, \\
\max\{0,\Delta-x_n\}, &\quad y_n=-1 \\
\end{array}
\right.
\end{equation}
$$

Hinge embedding loss used for semi-supervised learning by measuring whether two inputs are similar or dissimilar. It pulls together things that are similar and pushes away things are dissimilar. The $y$ variable indicates whether the pair of scores need to go in a certain direction. Using a hinge loss, the score is positive if $y$ is 1 and some margin $\Delta$ if $y$ is -1.
Expand All @@ -100,15 +98,13 @@ Hinge embedding loss used for semi-supervised learning by measuring whether two
### Cosine Embedding Loss - `nn.CosineEmbeddingLoss()`

$$
\begin{equation}
l_n =
\left\{
\begin{array}{lr}
1-\cos(x_1,x_2), & \quad y=1, \\
\max(0,\cos(x_1,x_2)-\text{margin}), & \quad y=-1
\end{array}
\begin{array}{lr}
1-\cos(x_1,x_2), & \quad y=1, \\
\max(0,\cos(x_1,x_2)-\text{margin}), & \quad y=-1
\end{array}
\right.
\end{equation}
$$

This loss is used for measuring whether two inputs are similar or dissimilar, using the cosine distance, and is typically used for learning nonlinear embeddings or semi-supervised learning.
Expand Down
2 changes: 1 addition & 1 deletion docs/en/week15/15-2.md
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ In technical terms, if free energy is

Objective - Finding a well behaved energy function

A loss functional, minimized during learning, is used to measure the quality of the available energy functions. In simple terms, loss functional is a scalar function that tells us how good our energy function is. A distinction should be made between the energy function, which is minimized by the inference process, and the loss functional (introduced in Section 2), which is minimized by the learning process.
A loss functional, minimized during learning, is used to measure the quality of the available energy functions. In simple terms, loss functional is a scalar function that tells us how good our energy function is. A distinction should be made between the energy function, which is minimized by the inference process, and the loss functional, which is minimized by the learning process.

$$\mathcal{L}(F(\cdot),Y) = \frac{1}{N} \sum_{n=1}^{N} l(F(\cdot),\vect{y}^{(n)}) \in \R$$

Expand Down
23 changes: 10 additions & 13 deletions docs/es/week11/11-2.md
Original file line number Diff line number Diff line change
Expand Up @@ -200,17 +200,16 @@ $$
-->

$$
\begin{equation}
l_n =
\left\{
\begin{array}{lr}
x_n, &\quad y_n=1, \\
\max\{0,\Delta-x_n\}, &\quad y_n=-1 \\
\end{array}
\begin{array}{lr}
x_n, &\quad y_n=1, \\
\max\{0,\Delta-x_n\}, &\quad y_n=-1 \\
\end{array}
\right.
\end{equation}
$$


<!--Hinge embedding loss used for semi-supervised learning by measuring whether two inputs are similar or dissimilar. It pulls together things that are similar and pushes away things are dissimilar. The $y$ variable indicates whether the pair of scores need to go in a certain direction. Using a hinge loss, the score is positive if $y$ is 1 and some margin $\Delta$ if $y$ is -1.
-->

Expand All @@ -237,15 +236,13 @@ $$
-->

$$
\begin{equation}
l_n =
\left\{
\begin{array}{lr}
1-\cos(x_1,x_2), & \quad y=1, \\
\max(0,\cos(x_1,x_2)-\text{margen}), & \quad y=-1
\end{array}
\begin{array}{lr}
1-\cos(x_1,x_2), & \quad y=1, \\
\max(0,\cos(x_1,x_2)-\text{margin}), & \quad y=-1
\end{array}
\right.
\end{equation}
$$

<!--This loss is used for measuring whether two inputs are similar or dissimilar, using the cosine distance, and is typically used for learning nonlinear embeddings or semi-supervised learning.
Expand Down Expand Up @@ -490,7 +487,7 @@ Esta pérdida hace que la energía de la respuesta correcta sea pequeña, y al m
-->


## Pérdida de Margen Generalizado
## Pérdida de Margen Generalizado

<!--**Most offending incorrect answer**: discrete case
Let $Y$ be a discrete variable. Then for a training sample $(X^i,Y^i)$, the *most offending incorrect answer* $\bar Y^i$ is the answer that has the lowest energy among all possible answers that are incorrect:
Expand Down
21 changes: 9 additions & 12 deletions docs/fr/week11/11-2.md
Original file line number Diff line number Diff line change
Expand Up @@ -175,16 +175,15 @@ Hinge embedding loss used for semi-supervised learning by measuring whether two

### Hinge Embedding Loss - `nn.HingeEmbeddingLoss()`


$$
\begin{equation}
l_n =
\left\{
\begin{array}{lr}
x_n, &\quad y_n=1, \\
\max\{0,\Delta-x_n\}, &\quad y_n=-1 \\
\end{array}
\begin{array}{lr}
x_n, &\quad y_n=1, \\
\max\{0,\Delta-x_n\}, &\quad y_n=-1 \\
\end{array}
\right.
\end{equation}
$$

Cette perte est utilisée pour l'apprentissage semi-supervisé en mesurant si deux entrées sont similaires ou dissemblables. Elle rassemble les choses qui sont similaires et repousse celles qui sont dissemblables. La variable $y$ indique si la paire de notes doit aller dans une certaine direction. En utilisant une telle perte, le score est positif si $y$ est égal à 1 et une certaine marge $\Delta$ si $y$ est égal à -1.
Expand Down Expand Up @@ -215,15 +214,13 @@ This loss is used for measuring whether two inputs are similar or dissimilar, us
### Cosine Embedding Loss - `nn.CosineEmbeddingLoss()`

$$
\begin{equation}
l_n =
\left\{
\begin{array}{lr}
1-\cos(x_1,x_2), & \quad y=1, \\
\max(0,\cos(x_1,x_2)-\text{margin}), & \quad y=-1
\end{array}
\begin{array}{lr}
1-\cos(x_1,x_2), & \quad y=1, \\
\max(0,\cos(x_1,x_2)-\text{margin}), & \quad y=-1
\end{array}
\right.
\end{equation}
$$


Expand Down
22 changes: 9 additions & 13 deletions docs/ja/week11/11-2.md
Original file line number Diff line number Diff line change
Expand Up @@ -100,15 +100,13 @@ $$
### Hinge Embedding Loss - `nn.HingeEmbeddingLoss()`

$$
\begin{equation}
l_n =
\left\{
\begin{array}{lr}
x_n, &\quad y_n=1, \\
\max\{0,\Delta-x_n\}, &\quad y_n=-1 \\
\end{array}
\begin{array}{lr}
x_n, &\quad y_n=1, \\
\max\{0,\Delta-x_n\}, &\quad y_n=-1 \\
\end{array}
\right.
\end{equation}
$$

<!-- Hinge embedding loss used for semi-supervised learning by measuring whether two inputs are similar or dissimilar. It pulls together things that are similar and pushes away things are dissimilar. The $y$ variable indicates whether the pair of scores need to go in a certain direction. Using a hinge loss, the score is positive if $y$ is 1 and some margin $\Delta$ if $y$ is -1. -->
Expand All @@ -118,15 +116,13 @@ $$
### Cosine Embedding Loss - `nn.CosineEmbeddingLoss()`

$$
\begin{equation}
l_n =
\left\{
\begin{array}{lr}
1-\cos(x_1,x_2), & \quad y=1, \\
\max(0,\cos(x_1,x_2)-\text{margin}), & \quad y=-1
\end{array}
\begin{array}{lr}
1-\cos(x_1,x_2), & \quad y=1, \\
\max(0,\cos(x_1,x_2)-\text{margin}), & \quad y=-1
\end{array}
\right.
\end{equation}
$$

<!-- This loss is used for measuring whether two inputs are similar or dissimilar, using the cosine distance, and is typically used for learning nonlinear embeddings or semi-supervised learning.
Expand Down Expand Up @@ -333,7 +329,7 @@ If the energy function is able to ensure that the energy of the *most offending
$$
L_{\text{hinge}}(W,Y^i,X^i)=\max(0,m+E(W,Y^i,X^i))-E(W,\bar Y^i,X^i)
$$
<!--
<!--
Where $\bar Y^i$ is the *most offending incorrect answer*. This loss enforces that the difference between the correct answer and the most offending incorrect answer be at least $m$. -->
ここで、$bar Y^i$は、*最も問題のある不正解*です。この損失は、正解と最も問題のある不正解の差が少なくとも$m$であることを要請します。

Expand Down
22 changes: 9 additions & 13 deletions docs/ko/week11/11-2.md
Original file line number Diff line number Diff line change
Expand Up @@ -106,15 +106,13 @@ $$
### 힌지 임베딩 손실 - `nn.HingeEmbeddingLoss()`

$$
\begin{equation}
l_n =
\left\{
\begin{array}{lr}
x_n, &\quad y_n=1, \\
\max\{0,\Delta-x_n\}, &\quad y_n=-1 \\
\end{array}
\begin{array}{lr}
x_n, &\quad y_n=1, \\
\max\{0,\Delta-x_n\}, &\quad y_n=-1 \\
\end{array}
\right.
\end{equation}
$$

<!--Hinge embedding loss used for semi-supervised learning by measuring whether two inputs are similar or dissimilar. It pulls together things that are similar and pushes away things are dissimilar. The $y$ variable indicates whether the pair of scores need to go in a certain direction. Using a hinge loss, the score is positive if $y$ is 1 and some margin $\Delta$ if $y$ is -1.-->
Expand All @@ -125,15 +123,13 @@ $$
### 코사인 임베딩 손실 - `nn.CosineEmbeddingLoss()`

$$
\begin{equation}
l_n =
\left\{
\begin{array}{lr}
1-\cos(x_1,x_2), & \quad y=1, \\
\max(0,\cos(x_1,x_2)-\text{margin}), & \quad y=-1
\end{array}
\begin{array}{lr}
1-\cos(x_1,x_2), & \quad y=1, \\
\max(0,\cos(x_1,x_2)-\text{margin}), & \quad y=-1
\end{array}
\right.
\end{equation}
$$

<!--This loss is used for measuring whether two inputs are similar or dissimilar, using the cosine distance, and is typically used for learning nonlinear embeddings or semi-supervised learning.-->
Expand Down Expand Up @@ -438,4 +434,4 @@ $$

<!--We assume that $Y$ is discrete, but if it were continuous, the sum would be replaced by an integral. Here, $E(W, Y^i,X^i)-E(W,y,X^i)$ is the difference of $E$ evaluated at the correct answer and some other answer. $C(Y^i,y)$ is the margin, and is generally a distance measure between $Y^i$ and $y$. The motivation is that the amount we want to push up on a incorrect sample $y$ should depend on the distance between $y$ and the correct sample $Y_i$. This can be a more difficult loss to optimize.-->

우리는 $Y$가 이산이지만, 만약 연속이라면 그 합은 적분으로 바뀔 것이라 가정한다. 여기서 $E(W, Y^i,X^i)-E(W,y,X^i)$는 정답과 어떤 다른 답에서 측정된 $E$의 차이이다. $C(Y^i,y)$는 마진이며 일반적으로 $Y^i$와 $y$ 사이의 거리값을 나타낸다. 동기는 우리가 잘못된 표본 $y$에서 밀어올리고 싶은 합이 $y$와 옳은 표본 $Y_i$ 사이 거리에 따라 달라져야 한다는 것이다. 이것은 최적화하는데 더 어려운 손실이 될 수 있는 것이다.
우리는 $Y$가 이산이지만, 만약 연속이라면 그 합은 적분으로 바뀔 것이라 가정한다. 여기서 $E(W, Y^i,X^i)-E(W,y,X^i)$는 정답과 어떤 다른 답에서 측정된 $E$의 차이이다. $C(Y^i,y)$는 마진이며 일반적으로 $Y^i$와 $y$ 사이의 거리값을 나타낸다. 동기는 우리가 잘못된 표본 $y$에서 밀어올리고 싶은 합이 $y$와 옳은 표본 $Y_i$ 사이 거리에 따라 달라져야 한다는 것이다. 이것은 최적화하는데 더 어려운 손실이 될 수 있는 것이다.
32 changes: 12 additions & 20 deletions docs/tr/week11/11-2.md
Original file line number Diff line number Diff line change
Expand Up @@ -141,46 +141,40 @@ Bu marj bazlı kayıp terimi, farklı girdilerin değişken miktarlarda hedefler
<!--### Hinge Embedding Loss - `nn.HingeEmbeddingLoss()`
$$
\begin{equation}
l_n =
\left\{
\begin{array}{lr}
x_n, &\quad y_n=1, \\
\max\{0,\Delta-x_n\}, &\quad y_n=-1 \\
\end{array}
\right.
\end{equation}
$$
Hinge embedding loss used for semi-supervised learning by measuring whether two inputs are similar or dissimilar. It pulls together things that are similar and pushes away things are dissimilar. The $y$ variable indicates whether the pair of scores need to go in a certain direction. Using a hinge loss, the score is positive if $y$ is 1 and some margin $\Delta$ if $y$ is -1.-->
### Hinge Gömü Kayıp Terimi (Hinge Embedding Loss) - `nn.HingeEmbeddingLoss()`

$$
\begin{equation}
l_n =
\left\{
\begin{array}{lr}
x_n, &\quad y_n=1, \\
\max\{0,\Delta-x_n\}, &\quad y_n=-1 \\
\end{array}
\begin{array}{lr}
x_n, &\quad y_n=1, \\
\max\{0,\Delta-x_n\}, &\quad y_n=-1 \\
\end{array}
\right.
\end{equation}
$$

İki girdinin benzer veya farklı olup olmadığını ölçmek için yarı denetimli öğrenmede kullanılan bir gömme kaybıdır. Benzer olan şeyleri bir araya getirir ve farklı olan şeyleri uzaklaştırır. $y$ değişkeni, puan çiftinin belirli bir yönde gitmesi gerekip gerekmediğini gösterir. Hinge kaybı kullanıldığında, puan $y$ 1 ise pozitif, $y$ -1 ise $\Delta$ marjı elde edilir.

<!--### Cosine Embedding Loss - `nn.CosineEmbeddingLoss()`
$$
\begin{equation}
l_n =
\left\{
\begin{array}{lr}
1-\cos(x_1,x_2), & \quad y=1, \\
\max(0,\cos(x_1,x_2)-\text{margin}), & \quad y=-1
\end{array}
\begin{array}{lr}
1-\cos(x_1,x_2), & \quad y=1, \\
\max(0,\cos(x_1,x_2)-\text{margin}), & \quad y=-1
\end{array}
\right.
\end{equation}
$$
This loss is used for measuring whether two inputs are similar or dissimilar, using the cosine distance, and is typically used for learning nonlinear embeddings or semi-supervised learning.
Expand All @@ -192,15 +186,13 @@ This loss is used for measuring whether two inputs are similar or dissimilar, us
### Kosinüs Gömme Terimi (Cosine Embedding Loss) - `nn.CosineEmbeddingLoss()`

$$
\begin{equation}
l_n =
\left\{
\left\{
\begin{array}{lr}
1-\cos(x_1,x_2), & \quad y=1, \\
\max(0,\cos(x_1,x_2)-\text{margin}), & \quad y=-1
\max(0,\cos(x_1,x_2)-\text{margine}), & \quad y=-1
\end{array}
\right.
\end{equation}
\right.
$$

Bu kayıp, kosinüs mesafesini kullanarak iki girişin benzer veya farklı olup olmadığını ölçmek için kullanılır ve genellikle doğrusal olmayan gömmeleri öğrenmek veya yarı denetimli öğrenme için kullanılır.
Expand Down Expand Up @@ -362,7 +354,7 @@ Bu kayıp fonksiyonu, olasılıkları ile orantılı olarak tüm cevapların ene

Olasılık modeli, aşağıdakileri içeren bir EBM'dir:

* Enerji Y (tahmin edilecek değişken) üzerinden integre edilebilinir
* Enerji Y (tahmin edilecek değişken) üzerinden integre edilebilinir
* Kayıp işlevi, negatif log-olabilirliktir.


Expand Down
20 changes: 8 additions & 12 deletions docs/zh/week11/11-2.md
Original file line number Diff line number Diff line change
Expand Up @@ -115,15 +115,13 @@ $$
### 合页嵌入损失 (Hinge Embedding Loss) - `nn.HingeEmbeddingLoss()`

$$
\begin{equation}
l_n =
\left\{
\begin{array}{lr}
x_n, &\quad y_n=1, \\
\max\{0,\Delta-x_n\}, &\quad y_n=-1 \\
\end{array}
\begin{array}{lr}
x_n, &\quad y_n=1, \\
\max\{0,\Delta-x_n\}, &\quad y_n=-1 \\
\end{array}
\right.
\end{equation}
$$

<!--Hinge embedding loss used for semi-supervised learning by measuring whether two inputs are similar or dissimilar. It pulls together things that are similar and pushes away things are dissimilar. The $y$ variable indicates whether the pair of scores need to go in a certain direction. Using a hinge loss, the score is positive if $y$ is 1 and some margin $\Delta$ if $y$ is -1.
Expand All @@ -133,15 +131,13 @@ $$
### 余弦嵌入损失 (Cosine Embedding Loss) - `nn.CosineEmbeddingLoss()`

$$
\begin{equation}
l_n =
\left\{
\begin{array}{lr}
1-\cos(x_1,x_2), & \quad y=1, \\
\max(0,\cos(x_1,x_2)-\text{margin}), & \quad y=-1
\end{array}
\begin{array}{lr}
1-\cos(x_1,x_2), & \quad y=1, \\
\max(0,\cos(x_1,x_2)-\text{margin}), & \quad y=-1
\end{array}
\right.
\end{equation}
$$

<!--This loss is used for measuring whether two inputs are similar or dissimilar, using the cosine distance, and is typically used for learning nonlinear embeddings or semi-supervised learning.
Expand Down

0 comments on commit 3acc4e4

Please sign in to comment.