Skip to content

Tensorflow: Estimator quickstart code

Being a part of the Devoteam Global AI Community and working with state of the art AI toolkits means that for my AI, data science, and machine learning activities I do my projects in Tensorflow. Tensorflow is one of the best tools for building neural networks, but at times I felt that there was a steep learning curve for particular novel functions. While there are some good tutorials, that learning curve is a hindrance for getting results fast on a dataset – spending as little time as possible on the plumbing.

TensorFlow by Google Cloud

TensorFlow is an open-source software library for dataflow programming across a range of tasks. It is a symbolic math library, and is also used for machine learning applications such as neural networks. It is used for both research and production at Google.‍

tensorflow

Recently the Tensorflow team announced that high-level API around Tensorflow was going to be Estimator. This is good news, since it was previously difficult to predict which neural network layer would stick, and which would slide off the wall. Estimator is a great framework, as it lets the user focus on changing the right parts. In addition, it makes it easier to use the models in production.

However, using Estimator with the Dataset API is in my experience not as straightforward as it could be. This can mean that it takes more time than is convenient to get a result.

In order to solve this problem I made some ease-of-use code for Estimator to kickstart my projects – which we share with you in this link. The example runs the famous MNIST dataset. It will train four models and gives you a good start to get a estimate of your possible results. In addition it will gives you a good idea on what you need to focus on next – data or model.

While this code is used on the MNIST dataset, the foundations were built for our proprietary chatbot code. I have rewritten parts of it to be more universally useful, to be able to share it with you and use it myself more easily on future AI projects. As a result, you can easily change the code to encompass nearly every ML problem. The code is written to be clear and easy to adapt. I look forward to hearing from you how you use the code, and I would love to hear feedback on my blog!