To program great apps, Software Developers need not only a good programming language, but also great libraries and tooling. For ML Researchers and Engineers, the situation is no different. At our recent deep learning conference, Luiz GUStavo Martins, TensorFlow Developer Advocate at Google took a deep dive into some of the available tools and libraries in the TensorFlow ecosystem that will make your life easier and more productive. We’re presenting some of the themes of his presentation here, but you’ll want to watch the video to enjoy the whole presentation as well as the Q&A session with the audience.
Imagine software development without:
- IDEs
- Support libraries “so you have to do everything from scratch”
- Debugger “So, if you need to understand how things are working, what happened inside your code, you have to do it by printing things. Or you have to reread your code multiple, multiple times.”
Collaboration with peers: “imagine you don’t have you cannot ask for help. You cannot share your code with anyone to take a look.”
As a software developer, you need all those tools to help to support you in your job. And for data scientists, that’s exactly the same thing. You can’t build a great model without great tools.”
Even if you managed to do so, when you need it to go to from research to production, such as you need to deploy it somewhere and need to put in an app and integrate with a service, you will also need tooling to do that. It’s not something you can just do without any help.
TensorFlow framework
TensorFlow framework is more than a library to make models, it’s a complete framework of libraries and tools to go from experimentation to production.
Colaboratory (Colab) is a hosted Jupyter notebook environment that allows you to write and execute Python in your browser, with
- Zero configuration required
- Free access to GPUs
- Easy sharing
- Free to use and requires no setup.
They typically come with TensorFlow installed and access to GPU and RAM. Google has been using the tool internally since 2012 and it was launched externally since 2012.
Colab comes with pre-warmed VMs and preinstalled packages. You can run notebooks, train, and just disconnect later and the VMs will be deleted and reset and pre-warmed again for someone else. You can also upload your own files, you can download files from your Colab notebook, share on Google Drive and commit to Github and people can from GitHub, for example click there directly and open these on Colab. “So you have all these kind of integrations that make sharing your code and continue to work super easy.”
For more resources Colab Pro subscription is also available (currently only in the US) for faster GPU and more memory. You can also use your Google Cloud Console.
The problem with research and documentation
It can be difficult to know how to use code that you find in research papers or other documentation It;s safety is unknown as well as the level of fairness or bias. Is it written somewhere, what the latest version?
“This is a challenge that’s getting more and more common to everyone because if you want to just use a model that someone already made, it’s a challenge. Sometimes you get access to the model itself to the code, but you don’t get the training model. So then you have to do a lot of work yourself. So this is this is a big challenge for people trying to deploy machine learning.”
TensorFlow Hub is a central hub of image, text, video and audio models that can be easily downloaded. There is already documentation. There is simple code, there is Colab that you can click and try in the browser. You know who is the publisher, you know what’s the latest version. You know where to use. “So you have all this information in one place with search capabilities, of course, and filtering and all those kinds of things. TensorFlow has more than 1000 models already available for everyone to use.”
Gus takes a virtual walk through some of the models in the hub and provides demonstrates how you could apply a model found in the TensorFlow hub.
Recent Improvements in TensorFlow
Improved search and discovery: TensorFlow has improved search filters to enable you to search for specific model types.
TensorFlow light + meta data: added meta data makes deployment easier on embedded devices.
TensorFlow.js: There are new models for face and hand tracking. New models for interactive web apps are also being added.
There is also the option to submit your own models (with conditions). Models from publishers such as Google, Microsoft and Nvidia are also plentiful.
And now we have another challenge. debugging when you do your code, sorry.
Debugging
As Gus notes, “When you do your code, you need to understand what’s going on. In a regular software environment you have to understand the behaviour of your code. But when we do machine learning, the challenge is a little bit different. When, for example, you need to train a model for with a huge data set, you cannot go step by step, you cannot go and understand every step because first of all, it will take forever. And second, you might, it’s not doable. So, when we do machine learning, it’s done differently. You need to look into the overall picture and understand a lot of other things.”
TensorBoard can help.
TensorBoard: TensorFlow’s visualization toolkit
TensorBoard provides the visualization and tooling needed for machine learning experimentation:
- Tracking and visualizing metrics such as loss and accuracy
- Visualizing the model graph (ops and layers)
- Viewing histograms of weights, biases, or other tensors as they change over time
- Projecting embeddings to a lower-dimensional space
- Displaying images, text, and audio data
- Profiling TensorFlow programs
- And much more
Tensorboard has multiple dashboards (scalar, graphs, photographs, images etc. You can slice and dice by run and tag and you have access to a visual representation of how data changes over time. (Gus offers a detailed demonstration in the presentation).
An additional advantage of TensorFlow is that it makes it incredibly easy to share your results with other researchers, something which is crucial. Watch the video to find out more!