<commit_before>.. # coding=utf-8

.. _installation:

Installation
============

Release version
---------------

Run ``pip install snntoolbox``. This will install the minimum dependencies
needed to get started. Optional dependencies like matplotlib and scipy enable
generating output plots.

The toolbox relies on Keras internally, and by default installs
`Tensorflow <https://www.tensorflow.org/>`_ as Keras backend. You may want to
update this backend to optimally fit your system.

.. note:: The SNN toolbox provides a built-in simulator to run the converted
   network. This simulator is Keras-based and will use either Tensorflow or
   `Theano <http://www.deeplearning.net/software/theano/install_ubuntu.html>`_
   as backend. Depending on the backend you choose, different features are
   available in the toolbox simulator. You can install both backends and switch
   between them simply by setting the corresponding parameter in the
   :ref:`config file <configuration>`::

      [simulation]
      keras_backend = tensorflow

   As the Theano is not actively developed any more, the tensorflow backend is
   better maintained. The only reason to choose Theano at this point is that we
   provide an implementation of MaxPooling in INIsim, which is not available
   with the tensorflow backend.

.. note:: (March 2020) The toolbox has been tested to work with keras==2.2.5<commit_msg>Fixed Keras version<commit_after>.. # coding=utf-8

.. _installation:

Installation
============

Release version
---------------

Run ``pip install snntoolbox``. This will install the minimum dependencies
needed to get started. Optional dependencies like matplotlib and scipy enable
generating output plots.

The toolbox relies on Keras internally, and by default installs
`Tensorflow <https://www.tensorflow.org/>`_ as Keras backend. You may want to
update this backend to optimally fit your system.

.. note:: The SNN toolbox provides a built-in simulator to run the converted
   network. This simulator is Keras-based and will use either Tensorflow or
   `Theano <http://www.deeplearning.net/software/theano/install_ubuntu.html>`_
   as backend. Depending on the backend you choose, different features are
   available in the toolbox simulator. You can install both backends and switch
   between them simply by setting the corresponding parameter in the
   :ref:`config file <configuration>`::

      [simulation]
      keras_backend = tensorflow

   As the Theano is not actively developed any more, the tensorflow backend is
   better maintained. The only reason to choose Theano at this point is that we
   provide an implementation of MaxPooling in INIsim, which is not available
   with the tensorflow backend.

.. note:: (March 2020) The toolbox has been tested to work with keras==2.3.0
{'fraction_non_alphanumeric': 0.07598566308243727, 'fraction_numerical': 0.005734767025089606, 'mean_word_length': 3.905096660808436, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 2, 'lorem ipsum': 0, 'www.': 4, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5981932', 'n_tokens_mistral': 746, 'n_tokens_neox': 703, 'n_words': 351}