Published
- 2 min read
TensorFlow API Keras
Introduction to tensorflow API Keras
- Keras is the high level API for TensorFlow platform
- Keras provide approachable and highly productive interface for machine learning with focus on mordern deep learning
- Keras cover every step from DATA PROCESSING to HYPERPARAMETER TUNING to DEPLOYMENT
- It was developed with focus on enabling fast experimentation
- You can run keras on TPU or large PODS
- You can run keras models in browser or mobile devices
- You can also serve keras model via web API
- Keras was able to reduce cognitive load (amount of information our working memory can process) by working on the following offfer simple , consistent interfaces minimize the number of actions required for common usecases provide clear, actionable error message follow principle of progressive disclosure of complexity (design technique that helps user interact with complext system helps to write concise, readable code)
Who should use keras Every tensorflow user, should use keras by default
Keras API documentation
- models (directed acyclic graph)
- layers (simple input output transformation)
Layers Layers are defined in tf.keras.layers.layer, they have some weights and computations defined in layers.call
- Weights created by layers are trainable and non trainable
- Weights created by layers are recrusively composable, example if you assign weights created by one layer as an attribute to another the outer layer will start tracking weights of the inner layer.
- Layers can be used for tasks like normal preprocessing and normalization
- Preprocessing layer can be included in model, either during training or after training, which makes model protable
Models Model is the object that groups layers together and can be trained on data Simplest type of model is sequential model which stacks layers together For advanced models look at keras api which lets you build arbitiary Graphs Features of a built-in model class a. tf.keras.Model.fit - Trains the model for fix number of epocs b. tf.keras.Model.predict - genrates output predections for input samples c. tf.keras.Model.evaluate - returns loss anf metric values for models d. tf.keras.Model.compile - configuration for evaluate