Keras Python

Sequential groups a linear stack of layers into a tf.keras.Model. Keras is an open source deep learning framework for python. It has been developed by an artificial intelligence researcher at Google named Francois Chollet. Leading organizations like Google, Square, Netflix, Huawei and Uber are currently using Keras.

Keras
  • Keras Tutorial
  • Keras Useful Resources

Keras is an open-source software library that provides a Python interface for artificial neural networks. Keras acts as an interface for the TensorFlow library. Up until version 2.3 Keras supported multiple backends, including TensorFlow, Microsoft Cognitive Toolkit, Theano, and PlaidML. As of version 2.4, only TensorFlow is supported.

  • Selected Reading

This chapter deals with the model evaluation and model prediction in Keras.

Let us begin by understanding the model evaluation.

Model Evaluation

Keras

Evaluation is a process during development of the model to check whether the model is best fit for the given problem and corresponding data. Keras model provides a function, evaluate which does the evaluation of the model. It has three main arguments,

  • Test data
  • Test data label
  • verbose - true or false

Let us evaluate the model, which we created in the previous chapter using test data.

Executing the above code will output the below information.

The test accuracy is 98.28%. We have created a best model to identify the handwriting digits. On the positive side, we can still scope to improve our model.

Model Prediction

Prediction is the final step and our expected outcome of the model generation. Keras provides a method, predict to get the prediction of the trained model. The signature of the predict method is as follows,

Here, all arguments are optional except the first argument, which refers the unknown input data. The shape should be maintained to get the proper prediction.

Let us do prediction for our MPL model created in previous chapter using below code −

Here,

  • Line 1 call the predict function using test data.

  • Line 2 gets the first five prediction

  • Line 3 gets the first five labels of the test data.

  • Line 5 - 6 prints the prediction and actual label.

The output of the above application is as follows −

The output of both array is identical and it indicate that our model predicts correctly the first five images.

Latest version

Released:

Keras python version

Deep Learning for humans

Project description

Keras is a high-level neural networks API for Python.

Read the documentation at: https://keras.io/

Keras is compatible with Python 3.6+and is distributed under the MIT license.

Keras Python

Release historyRelease notifications RSS feed

2.5.0rc0 pre-release

2.4.3

2.4.2

2.4.1

2.4.0

2.3.1

2.3.0

2.2.5

2.2.4

2.2.3

2.2.2

2.2.1

2.2.0

2.1.6

2.1.5

2.1.4

2.1.3

2.1.2

2.1.1

2.1.0

2.0.9

2.0.8

2.0.7

2.0.6

2.0.5

2.0.4

2.0.3

2.0.2

Keras Python

2.0.1

2.0.0

1.2.2

Keras Python Model

1.2.1

1.2.0

1.1.2

1.1.1

1.1.0

1.0.8

1.0.7

1.0.6

1.0.5

1.0.4

1.0.3

1.0.2

1.0.1

1.0.0

0.3.3

0.3.2

0.3.1

0.3.0

0.2.0

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for keras, version 2.4.3
Filename, sizeFile typePython versionUpload dateHashes
Filename, size Keras-2.4.3-py2.py3-none-any.whl (36.3 kB) File type Wheel Python version py2.py3 Upload dateHashes
Filename, size Keras-2.4.3.tar.gz (291.0 kB) File type Source Python version None Upload dateHashes
Close

Keras Python Library

Hashes for Keras-2.4.3-py2.py3-none-any.whl

Hashes for Keras-2.4.3-py2.py3-none-any.whl
AlgorithmHash digest
SHA25605e2faf6885f7899482a7d18fc00ba9655fe2c9296a35ad96949a07a9c27d1bb
MD5455ade6a8c056ae26d6b8db941364ca4
BLAKE2-25644e1dc0757b20b56c980b5553c1b5c4c32d378c7055ab7bfa92006801ad359ab
Close

Hashes for Keras-2.4.3.tar.gz

Keras Python 2.7

Hashes for Keras-2.4.3.tar.gz
AlgorithmHash digest
SHA256fedd729b52572fb108a98e3d97e1bac10a81d3917d2103cc20ab2a5f03beb973
MD53e08083f7478f37671cc86104d18b08a
BLAKE2-256df1d46fbcf446b5fa42aff723124fb10bc900e542389e7d7574b0c5466e1ffbc