Metadata-Version: 2.0
Name: keras-diagram
Version: 1.0.4
Summary: Keras models as ASCII diagrams
Home-page: http://github.com/brianlow/keras_diagram
Author: Brian Low
Author-email: brian.low22@gmail.com
License: MIT
Keywords: keras ascii diagram model
Platform: UNKNOWN

Keras Diagram
=============

Print ASCII diagrams of your
`Keras <https://github.com/fchollet/keras>`__ models to visualize the
layers and their shapes.

::

          InputLayer (None, 50, 300)
             Reshape (None, 1, 50, 300)
       Convolution2D (None, 250, 48, 1)
                Relu (None, 250, 48, 1)
        MaxPooling2D (None, 250, 1, 1)
             Flatten (None, 250)
             Dropout (None, 250)
               Dense (None, 7)
             Softmax (None, 7)

A more complex model from
`babi\_rnn.py <https://github.com/fchollet/keras/blob/e2fb8b2786817b4014c077c13e99efb551fe35c1/examples/babi_rnn.py>`__:

::

                                       InputLayer (None, 5)
                                        Embedding (None, 5, 50)
      InputLayer (None, 552)              Dropout (None, 5, 50)
       Embedding (None, 552, 50)             LSTM (None, 50)
         Dropout (None, 552, 50)     RepeatVector (None, 552, 50)
                 \______________________________/
                                |
                           Merge (None, 552, 50)
                            LSTM (None, 50)
                         Dropout (None, 50)
                           Dense (None, 36)

To install
----------

::

    pip install keras_diagram

Note for Conda installation (Python 3.5): ``pip install pypandoc``

To use
------

::

    from keras_diagram import ascii

    model = Sequential()
    model.add(...)

    print(ascii(model))

Developing
----------

::

     ./test.py       # run tests via docker
     ./publish.py    # build distributions and publish to pypi
     ./shell.py      # run bash above docker container with current folder mounted


