RNN cyclic neural network – regression

Now, we will deal with a regression problem under RNN. The cyclic neural network provides memory to the neural network. For the serial data, the cyclic neural network can achieve better results. We will use RNN here in this example to predict time series data.

To find out more about circular neural networks, go to https://iopscience.iop.org/article/10.1209/0295-5075/18/3/003/meta.

The following code is for the logistic regression:

%matplotlib inlineimport torchfrom torch import nnimport numpy as npimport matplotlib.pyplot as plt# torch.manual_seed(1) # reproducible# Hyper ParametersTIME_STEP = 10 # rnn time stepINPUT_SIZE = 1 # rnn input sizeLR = 0.02 # learning rate# show datasteps = np.linspace(0, ...

Get Mobile Artificial Intelligence Projects now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.