NLP-C3-W1: Neural Networks for Sentiment Analysis

https://www.coursera.org/learn/sequence-models-in-nlp/home/week/1

Structure

Embedding Layer

An embedding layer is a trainable layer of size Vocab Size x Embedding Size. Its goal is to map the vocabulary to corresponding embeddings.

Mean Layer

The mean layer takes the average of each dimension of the embeddings across all sentence vocabulary to reduce the number of trainable parameters.

Input Representation

A vector of numbers. Each number represents a specific word. Zero-padded to make sure all inputs have the same size.

Model Architecture in Trax

// Some code
from trax import layers as tl

Model = tl.Serial(
        tl.Dense(4), 
        tl.Sigmoid(), 
        tl.Dense(4), 
        tl.Sigmoid(), 
        tl.Dense(3), 
        tl.Softmax())

Completed Notebook

Trax: Lecture Notebook

  • Trax introduction

Last updated