Thursday, April 15, 2021

How To Code RNN and LSTM Neural Networks in Python

How To Code RNN And LSTM Neural Networks In Python
In [1]:
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import tensorflow as tf
from tensorflow import keras
from tensorflow.keras import layers

tf.__version__
Out[1]:
'2.3.1'

Check out following links if you want to learn more about Pandas and Numpy.

Pandas

Numpy Basics

What's so special about text?

Text is categorized as Sequential data: a document is a sequence of sentences, each sentence is a sequence of words, and each word is a sequence of characters. What is so special about text is that the next word in a sentence depends on:

  1. Context: which can extend long distances before and after the word, aka long term dependancy.
  2. Intent: different words can fit in the same contexts depending on the author's intent.
What do we need?

We need a neural network that models sequences. Specifically, given a sequence of words, we want to model the next word,

(continued...)

from Planet SciPy
read more

No comments:

Post a Comment

TestDriven.io: Working with Static and Media Files in Django

This article looks at how to work with static and media files in a Django project, locally and in production. from Planet Python via read...