<https://git.frama-c.com/pub/caisar/-/blob/master/stdlib/interpretation.mlw>`_ provides theories that defines those concepts.
theories that defines those concepts. We will import the relevant theories with
We will import the relevant theories with the ``use`` keyword.
the ``use`` keyword. As described in :ref:`interpretation`, the ``Vector``
As described in :ref:`interpretation`, the ``Vector`` theory provides
theory provides a vector type, a getter (``[]``) operation and a ``valid_index``
a vector type, a getter (``[]``) operation and a ``valid_index`` predicate
predicate that determines whether the get operation is within the range of the
that determines whether the get operation is within the range of the vector length.
vector length. ``NN`` defines a type and an application function (``@@``). We
``NeuralNetwork`` defines a type and an application function (``@@``).
will also need integers and floating point numbers to declare and define
We will also need integers and floating point numbers
:math:`\epsilon`.
to declare and define :math:`\epsilon`.
.. code-block:: whyml
.. code-block:: whyml
use ieee_float.Float64
use ieee_float.Float64
use int.Int
use int.Int
use interpretation.Vector
use caisar.types.Vector
use interpretation.NeuralNetwork
use caisar.model.Model
use interpretation.Dataset
use caisar.model.NN
use caisar.dataset.Dataset
type image = vector t
type image = vector t
type label_ = int
type label_ = int
We will first write some predicates to take into account the fact
We will first write some predicates to take into account the fact that MNIST
that MNIST counts 10 labels (integer from 0 to 9) in the dataset sample,
counts 10 labels (integer from 0 to 9) in the dataset sample, and that the input
and that the
images are normalized (floating point values between 0. and 1.). We will also
input images are normalized (floating point values between 0. and 1.).
define a predicate that, given a label ``l`` and an image ``i``, checks whether
We will also define a predicate that, given a label ``l`` and an image ``i``, checks whether the neural network ``nn`` indeed advises the correct label.
the neural network ``nn`` indeed advises the correct label.
.. code-block:: whyml
.. code-block:: whyml
...
@@ -104,7 +102,7 @@ We will also define a predicate that, given a label ``l`` and an image ``i``, ch
...
@@ -104,7 +102,7 @@ We will also define a predicate that, given a label ``l`` and an image ``i``, ch