Deep Learning With JavaScript: Neural Networks in TensorFlow. Js by Shanqing Cai & Stan Bileschi & Eric Nielsen

Deep Learning With JavaScript: Neural Networks in TensorFlow. Js by Shanqing Cai & Stan Bileschi & Eric Nielsen

Author:Shanqing Cai & Stan Bileschi & Eric Nielsen [Cai, Shanqing & Bileschi, Stan & Nielsen, Eric]
Language: eng
Format: epub
Tags: computers, Data Science, Neural Networks, Artificial Intelligence, General, Languages, JavaScript
ISBN: 9781617296178
Google: N2dswgEACAAJ
Publisher: Manning
Published: 2020-02-11T23:39:41.009520+00:00


This is the first time you encounter sequential input data in this book. In the next chapter, we will dive deeper into how to build specialized and more powerful models (RNNs) for sequential data in TensorFlow.js. But here, we will approach the problem using two types of models we already know: linear regressors and MLPs. This forms a buildup to our study of RNNs and gives us a baseline that can be compared with the more advanced models.

The actual code that performs the data-generation process illustrated in figure 8.1 is in jena-weather/data.js, under the function getNextBatchFunction(). This is an interesting function because instead of returning a concrete value, it returns an object with a function called next(). The next() function returns actual data values when it’s called. The object with the next() function is referred to as an iterator. Why do we use this indirection instead of writing an iterator directly? First, this conforms to the generator/iterator specification of JavaScript.[2] We will soon pass it to the tf.data .generator() API in order to create a dataset object for model training. The API requires this function signature. Second, our iterator needs to be configurable; a function that returns the iterator is a good way to enable the configuration.

2

See “Iterators and Generators,” MDN web docs, http://mng.bz/RPWK.



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.