Input datasets – cosine and stock price

As we claimed before, we will use two mono-dimensional signals as timeseries for our experiment. The first is a cosine wave with some added uniform noise.

This is the function to generate the cosine signal, given (as parameters) the number of points, the frequency of the signal, and the absolute intensity of the uniform generator for the noise. Also, in the body of the function, we're making sure to set the random seed, so we can make our experiments replicable:

def fetch_cosine_values(seq_len, frequency=0.01, noise=0.1):     np.random.seed(101)    x = np.arange(0.0, seq_len, 1.0)    return np.cos(2 * np.pi * frequency * x) + np.random.uniform(low=-noise, high=noise, size=seq_len)

To print 10 points, one full ...

Get TensorFlow Deep Learning 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.