Building Recommender Systems with Machine Learning and AI: Help people discover new products and content with deep learning, neural networks, and machine learning recommendations. by Kane Frank

Building Recommender Systems with Machine Learning and AI: Help people discover new products and content with deep learning, neural networks, and machine learning recommendations. by Kane Frank

Author:Kane, Frank [Kane, Frank]
Language: eng
Format: epub
Publisher: Sundog Education
Published: 2018-08-10T16:00:00+00:00


Using Keras

So we've had a look at developing neural networks using Tensorflow’s lower-level APIs, where instead of really thinking about neurons or units, you're thinking more about tensors and matrices and multiplying them together directly. And that's a very efficient way of doing it, but it's not really intuitive. It can be a little bit confusing especially when you're starting to try to implement a neural network in those terms.

Fortunately, there's a higher level API called Keras that's now built into Tensorflow. It used to be a separate product that was on top of Tensorflow. But as of Tensorflow 1.9, it's actually been incorporated into Tensorflow itself as an alternative higher-level API that you can use. And it's really nice because it's purpose-built for deep learning, so all the code is very much built around the concept of artificial neural networks. That makes it very easy to construct the layers of your neural network and wire them together, and use different optimization functions on them. It's a lot less code and a lot less things that can go wrong as a result.

Another benefit of Keras, in addition to its ease of use, is its integration with the scikit-learn library. If you're used to doing machine learning in Python, you probably use scikit-learn a lot. Keras can actually integrate your deep neural networks with scikit-learn .

You may have noticed in our previous lecture that we kind of glossed over the problem of actually doing train/test or cross validation on our neural network, because it would have been rather difficult to implement. But with scikit-learn, it's very to do cross validation and perform proper analysis and evaluation of this neural network. That makes it easier to validate what we're doing, and to integrate it with other models, or even chain a neural network with other deep learning or machine learning techniques. There's also a lot less to think about -- and that means that you can often get better results without even trying.

With Tensorflow’s original API, you have to think about every little detail at the linear algebra level of how these neural networks are constructed because it doesn't really natively support neural networks out of the box. You have to figure out: how do I multiply all the weights together? How do I add in the bias terms? How do I apply an optimizer to it? How do I define a loss function? In contrast, Keras can take care of a lot of those details for you. Why is that important? Well, the faster you can experiment and prototype things, the better your results will be. If it's that much easier for you to try different layers in your neural network -- different topologies, different optimizers, different variations -- it’s going to be that much easier and quicker for you to converge on the optimal neural network for the problem you're trying to solve. The more time you can spend on the topology and tuning of your neural network, and less on the implementation of it, the better your results will be.



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.