.. _f-kerasmnist: module ``examples.keras_mnist`` =============================== Short summary +++++++++++++ module ``ensae_teaching_dl.examples.keras_mnist`` Taken from `mnist_cnn.py `_. Trains a simple convolution network on the :epkg:`MNIST` dataset. Gets to 99.25% test accuracy after 12 epochs (there is still a lot of margin for parameter tuning). 16 seconds per epoch on a GRID K520 GPU. :githublink:`%|py|11` Functions +++++++++ +--------------------------------------------------------------------------------------------------+------------------------------------------------------------+ | function | truncated documentation | +==================================================================================================+============================================================+ | :func:`keras_build_mnist_model ` | Builds a :epkg:`CNN` for :epkg:`MNIST` with :epkg:`keras`. | +--------------------------------------------------------------------------------------------------+------------------------------------------------------------+ | :func:`keras_fit ` | Fits a :epkg:`keras` model. | +--------------------------------------------------------------------------------------------------+------------------------------------------------------------+ | :func:`keras_mnist_data ` | Retrieves the :epkg:`MNIST` database for :epkg:`keras`. | +--------------------------------------------------------------------------------------------------+------------------------------------------------------------+ | :func:`keras_predict ` | Computes the predictions with a :epkg:`keras` model. | +--------------------------------------------------------------------------------------------------+------------------------------------------------------------+ Documentation +++++++++++++ .. automodule:: ensae_teaching_dl.examples.keras_mnist :members: :special-members: __init__ :show-inheritance: .. _keras_mnist_literal: Code ---- .. literalinclude:: keras_mnist.py