Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Analysis of TensorFlow 2.0 in the release of Keras 2.3.0

2025-04-04 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)05/31 Report--

This article shows you the analysis of TensorFlow 2.0 in the release of Keras 2.3.0, which is concise and easy to understand. I hope you can learn something through the detailed introduction of this article.

Keras focuses on tf.keras while continuing to support Theano/CNTK

This release comes with a number of API changes to "synchronize" multiple backend Keras API with TensorFlow's advanced API tf.keras. However, some TensorFlow 2.0 features are not supported. This is why the team recommends that developers switch their Keras code to tf.keras in TensorFlow 2.0.

Migrating to tf.keras will give developers access to better integration between high-level concepts such as fast execution, TPU training, and low-level TensorFlow and Layer and Model.

After this release, the team plans to focus on the further development of tf.keras. "Development will focus on future development. We will continue to maintain multiple back-end Keras in the next 6 months, but we will only merge bug fixes. API changes will not be migrated," the team wrote.

To make it easier for the community to contribute to the development of Keras, the team will develop tf.keras in keras-team/keras 's separate GitHub repository.

API updates in Keras 2.3.0

Here are some API updates in Keras 2.3.0:

The add_metric method is added to Layer/Model, which is similar to the add_loss method, but is used for metrics.

Keras 2.3.0 introduces several class-based losses, including MeanSquaredError,MeanAbsoluteError,BinaryCrossentropy,Hinge and so on. With this update, you can parameterize the loss by constructor parameters.

Many class-based metrics have been added, including Accuracy,MeanSquaredError,Hinge,FalsePositives,BinaryAccuracy, and so on. This update enables metrics to be stateful and parameterized by constructor parameters.

The train_on_batch and test_on_batch methods now have a new parameter called resent_metrics. You can set this parameter to True to maintain the metrics status of different batches when writing lower-level training or evaluation cycles.

The model.reset_metrics () method is added to Model to clear the metric state at the beginning of the era when writing a lower-level training or evaluation cycle.

Major changes in Keras 2.3.0

As API changes, Keras 2.3.0 contains some major changes. In this release, batch_size,write_grads,embeddings_freq and embeddings_layer_names are not recommended, so they are ignored when used with TensorFlow 2.0. Metrics and losses will now be reported based on the exact name specified by the user. In addition, the default repeated activation is changed from hard_sigmoid to sigmoid in all RNN layers.

The above is about the TensorFlow 2.0 analysis in the Keras 2.3.0 release. Have you learned any knowledge or skills? If you want to learn more skills or enrich your knowledge reserve, you are welcome to follow the industry information channel.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report