TensorFlow 2.0 brings a lot of changes. Google engineer Cassie Kozyrkov said that the previous TensorFlow was dead, and the new version of TensorFlow made it reborn.

If you are an AI iron powder, but you don't see this big news, it may be like a nap at the time of the earthquake. Everything will change.

TensorFlow 2.0

what is this? TensorFlow's logo? Still answering the letters of the true/false judgment questions?

I wrote last year. 9 pieces about TensorFlow What you need to know. But one thing you need to know clearly is: TensorFlow 2.0 is here! A new revolution! Welcome to TensorFlow 2.0.

This is a subversive transformation. The arrival of TensorFlow 2.0 will create a huge chain reaction for every industry, waiting for it. If you are a newcomer to TF in 2019, you are especially lucky, because you have chosen the best time to enter the world of AI (if you have the word "session" in your old tutorial, you may want to start from scratch. ).

In short: TensorFlow has covered Keras! Please stand firm and help.

Heart-wrenching experience

I am skeptical that many people love TensorFlow1.x. This is like an artificial intelligence industrial lathe, which is user friendly. But at best, you may be grateful for it just because it can do incredible AI tasks.

Heart-wrenching experience

If you say that TensorFlow 1.x is easy to get started, you may be blinded by others. Its steep learning curve makes ordinary users discouraged, and mastering it is like climbing the Everest with your toes. Interesting? Do not.

You are not alone - everyone feels like this in the TensorFlow 1.x tutorial...

You are not alone - everyone feels like this in the TensorFlow 1.x tutorial...

The core strength of TensorFlow is performance. It is designed to move models from research to mass production, but TF 1.x lets you do your best. Stick to it, you can join the ranks of ML practitioners, who use it to do a lot of incredible things, such as finding new planets and exploring advanced medical tools.

However, it is a pity that such a powerful tool is in the hands of so few people. But now, the situation is different.

Don't worry about what the tensor is. Previously it was called a (generalized) matrix. The name TensorFlow is affirmation of the fact that TF is very good at performing distributed computing involving multidimensional arrays (呃, matrices), which is common in the AI ​​world. (Source: http://karlstratos.com/drawings/drawings.html)
Don't worry about what the tensor is. Previously it was called a (generalized) matrix. The name TensorFlow is affirmation of the fact that TF is very good at performing distributed computing involving multidimensional arrays (呃, matrices), which is common in the AI ​​world. (Source: http://karlstratos.com/drawings/drawings.html)


Cute and charming character - Keras

We have already introduced the "Prickly Pear", and now let's talk about what you really want to embrace. I accidentally heard a sentence at the place where I worked: "I think I really like Keras."

Keras is a specification for a layer-by-layer build model that works with multiple machine learning frameworks (so it's not a tool for TF), but you probably know that you can access its high-level API tf.keras from TensorFlow.

Hard

Keras is written in pure Python and is always people-oriented – designed to be flexible and easy to learn.

Can fish and bear's paws have both?

Why do we have to choose between the simple operation of Keras and the powerful performance of traditional TensorFlow? How can we have both?

Fish and bear's paws can be combined - this is TensorFlow 2.0.

The picture is TensorFlow 2.0.Website: https://www.tensorflow.org/overview, you can try these orange buttons on this page. "We don't think you need to choose between a simple API and an extensible API. We want a more advanced API that will take you directly from MNIST to the stars in the sky."-Karmel Allison, Google TensorFlow Project Leader
In the picture is TensorFlow 2.0. Website: https://www.tensorflow.org/overview, where you can try these orange buttons at will.
"We don't think you need to choose between a simple API and an extensible API. We want a more advanced API that takes you directly from MNIST to the stars." - Karmel Allison, Google TensorFlow Project Leader

Ease of use revolution

Looking ahead, Keras will become TensorFlow's advanced API, which has been extended so you can use all of TensorFlow's advanced features directly from tf.keras. All TensorFlow is easy to use with Keras and can be used on all sizes and on a variety of hardware.

Keras will become the advanced API of TensorFlow

In the new version, all of the most annoying TensorFlow1.x features are gone. Just to add two numbers together, you must use the "dark" operation? Goodbye. TensorFlow Sessions? Goodbye. Do the same thing with a million ways? Goodbye. Is it necessary to rewrite the code to switch hardware or scale? Goodbye. Want to write a lot of boilerplate files? Goodbye. Terrible unforcible error message? Goodbye. Steep learning curve? Goodbye.

TensorFlow has become a thing of the past, TensorFlow 2.0 Long live!

Do you think there will be a big trap? Performance will get worse? Guess again! We will not give up performance.

TensorFlow is now cute, it's a game rule changer because it means one of the most powerful tools of our time has removed its high walls. Technology enthusiasts from all walks of life have the right to participate, because the new version of the open allows researchers to no longer have headaches, but also those who have suffered from the "painful experience" using the previous version can be actively involved.

One of the most powerful tools of our time has withdrawn its high walls.

TensorFlow 2.0 welcomes everyone.

Satisfactory Eager

In TensorFlow 2.0, eager execution is the default mode. Even in the eager context, you can use diagrams to make debugging and prototyping simple, while the TensorFlow runtime is responsible for the underlying performance and extensions.

The entanglement in TensorFlow 1.x (Declarative Programming) has left many people confused, but now, eager execution has freed everyone from this nightmare. If you haven't studied this part before, it's even better. TF 2.0 is a new beginning for everyone.

Simple enough to one is enough

Many APIs are integrated under TensorFlow Keras, so now it's easier to know when you should use something. For example, you only need to use a set of optimizers and a set of metrics now. How many layers do you need to set? You guessed it! One! This is the style of Keras.

In fact, the entire tool ecosystem has been cleaned up, from data processing to simple model export, to the integration of TensorBoard and Keras, now in one line!

There are also some great tools for switching and optimizing distribution strategies to achieve amazing scalability without sacrificing the convenience of Keras itself.

These distribution strategies are great, aren't they?

problem

If performance is not an issue, then there must be other traps right?

In fact, the problem so far is that the user has waited too long. TensorFlow requires a lot of patience when developing a friendly version. This is not a deliberate attempt to compromise users. Developing deep learning tools is a new area and we are always moving in this direction. Detours are inevitable, but we have learned a lot in this process. This is not a deliberate attempt to compromise users. Deep learning is an unknown area.

The TensorFlow community has put a lot of effort into creating this miracle, and then puts more effort into polishing the best gems while polishing out bad designs. This plan won't force you to use the unfinished "original stone" forever, but maybe you are used to this discomfort, you don't realize it is temporary. thanks for your patience! We will not give up performance!

The reward is that everything you appreciate about TensorFlow 1.x is still there, they are under a consistent API, and a lot of repetitive features are removed, so it's clearer to use. Even the wrong information is clean, concise, easy to understand, and easy to operate. Its performance is still strong!

the most important thing

Hater may say that most of the features in v2.0 can be pieced together in v1.x. As long as you search enough, what can be a big surprise? Ok, not everyone wants to spend time in the sand to pan for gold. The renovation and clean-up work deserves everyone’s applause. But this is not the most important thing.

One thing not to be missed is that TensorFlow has just announced its focus on ease of use, which cannot be compromised. This is an unprecedented step in the process of democratization of artificial intelligence!

AI can automate tasks, so you don't have to think about them. It can automate content that cannot be described. Democratization means that large-scale artificial intelligence will no longer be exclusive to a few elites.
Now anyone can steer!

Imagine the future "I know how to develop things with Python" and "I know how to develop things with AI" are equally common, which can be described by the word "subversion".

migrate

We know that upgrading to a new version is a tough job, especially when these changes are so great. If you're going to migrate your codebase to 2.0, you're not alone, Google will do the same, and Google has the world's largest codebase. As we go deeper, we will share the migration guide to help everyone.

We have provided great tools to simplify the migration.

If you rely on a specific feature, then there is nothing wrong with contrib, and all TF 1.x features will be in the compat.v1 compatible module. We also provide a script (http://bit.ly/tfupgrade) that automatically updates the code to run on TensorFlow 2.0. See the video below for more information:

This video is a great resource if you want to learn more about TF 2.0 and how to handle code snippets.

For Xiaobai

TF 2.0 is a paradise for beginners, so for those who have been looking forward to seeing the suffering of the rookie, this will not happen.

If you want to use TensorFlow to bully new employees, you may need to "take a different path." If you are a TensorFlow beginner, you may be late at the AI ​​party, but many will be late. Now is the best time to enter!

Staying off the court may be a wise choice, as it is now the best time to enter. 2019 3 Month, the TensorFlow 2.0 Alpha version is already available, so learning it now will get you ready for the full release in the next quarter. TF 2.0 is a paradise for beginners.

With the massive changes in TF 2.0, you won't be the kind of beginner you imagined. The playing field has become flat, the game has become easier, and there is a seat reserved for you. welcome! I am very glad that you have finally arrived here. I hope that you are as excited about this new world as I am.

Join it!

Check out the redesigned tensorflow.org (http://bit.ly/tfdotorg) for tutorials, examples, documentation, and tools to help get started... or use the following command directly:

pip install tensorflow == 2.0.0-alpha0

See http://bit.ly/tfalpha for details.

This article is reproduced from the heart of the machine,Original address