Define error function
Here, our input is vector X with vocabulary x1 to xk and our output y is the output vector. So, to calculate the error E , we need to define the error function or loss function, and we are using the L2 loss function. Let's begin with understanding the basic concept of the L2 loss function, and then we will see how it will be useful in word2vec.
There are two type of loss functions that are mostly used across machine learning (ML) and deep learning (DL). By the way, we will look at ML and DL in upcoming chapters, which are Chapter 8, Machine Learning ( ML) for NLP Problems and Chapter 9, Deep Learning for NLP and NLG Problems. There are two standard types of loss functions, but here we will only look at least square error ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access