Electron microscopy
 
Keras
- Python for Integrated Circuits -
- An Online Book -
Python for Integrated Circuits                                                                                   http://www.globalsino.com/ICs/        


Chapter/Index: Introduction | A | B | C | D | E | F | G | H | I | J | K | L | M | N | O | P | Q | R | S | T | U | V | W | X | Y | Z | Appendix

=================================================================================

Keras is an open-source high-level neural networks API written in Python. It is designed to be user-friendly, modular, and extensible. Keras serves as an interface for building, training, and deploying deep learning models, and it allows users to define neural networks using a high-level, user-friendly syntax. Keras provides a convenient and simplified interface for constructing and training neural networks, while TensorFlow provides a lower-level framework that allows for greater customization and control when needed.

Originally, Keras was a standalone library, but it has been integrated into TensorFlow since version 1.10. This integration means that you can use Keras as a high-level API on top of TensorFlow, taking advantage of the capabilities of both libraries. tf.keras was originally meant for small-scale models, as it had very simple APIs, but it was not scalable. Thank Google for backing the Keras project since it has been fantastic to see Keras adopted as TensorFlow’s high-level API. Keras is a model-level library, providing high-level building blocks for developing deep-learning models. The Keras doesn’t handle low-level operations such as tensor manipulation and differentiation. The Keras handles the problem in a modular way as shown in Figure 4170.

The deep-learning software and hardware stack in Keras process

Figure 4170. The deep-learning software and hardware stack in Keras process. [1]

Keras helps you go from idea to experiment in the least possible time. A smooth integration between Keras and TensorFlow greatly benefits both TensorFlow users and Keras users and makes deep learning accessible to most. In fact, keras, one of the most popular and fastest-growing deep-learning frameworks, is widely recommended as the best tool to get started with deep learning.

The development of Keras started in the early months of 2015. Up to date, it has evolved into one of the most popular and widely used libraries that is built on top of Theano and TensorFlow. Similar to TensorFlow, the Keras allows us to utilize our GPUs to accelerate neural network training. One of its prominent features is that it has a very intuitive and user-friendly API, which allows us to implement neural networks in only a few lines of code. Keras was first released as a standalone API that could leverage Theano as a backend, and the support for TensorFlow was added later.

A Keras model is a very specific type of object that can therefore be easily wrapped and plugged into other abstractions. Keras enables fast experimentation with deep neural networks. With deep learning becoming ubiquitous, Keras becomes the ideal choice as it is API designed for humans and not machines according to the creators. With over 200,000 users as of November 2017, Keras has stronger adoption in both the industry and the research community even over TensorFlow or Theano. Before installing Keras, it is advised to install TensorFlow backend engine.

Examples of Keras applications:
          i) Classify structured data by using Keras preprocessing layers, such as tabular data in a csv file. In this process, we can use Vertex AI API and its instance, Debian 10 (or Debian 20.04), NVIDIA GPU libraries and JupterLab.

The steps can be:
             i.a) Define the model,
             i.b) Load a csv file by using Pandas,
             i.c) Build an input pipleline to batch and shuffle the rows using tf.data,
             i.d) Map from columns in the CSV to features used to train the model using Keras preprocessing layers,
             i.e) Preprocess layers as a bridge to map from columns in a csv to features that is used to train the model.
             i.f) Build, train, and evaluate a model using Keras.

With a Keras model for training, the significance of the .fit() method is that it can define the number of epochs.

 


============================================

         
         
         
         
         
         
         
         
         
         
         
         
         
         
         
         
         
         

 

 

 

 

 



















































 

 

 

 

[1] François Chollet, Deep Learning with Python, 2018.

 


=================================================================================