Skip to main content

A usefull CNN/DenseNet visualization tool

Project description

neural-network-renderer

This repository contains everything necessary to generated neural network visualisation.

The code generating the image is writen in Python. This code generates .texfile that is directly compiled and deleted once the results are available.

Example

Here is an example of the code to generate a simple convolutionnal-network representation:

from pathlib import Path
import sys

from network_layer.architecture import Architecture
from network_layer.layers import Input, Pool, Conv, Softmax, Dense, Spacer


def main():
    arch = Architecture(2 / 32)

    # input
    arch.add(Input("assets/input_def_crop.png", shape=[64, 64]))

    # first layer
    arch.add(Conv([64, 64, 32], s_filter=64, n_filter=32, to="(4,0,0)"))
    arch.add(Conv([62, 62, 32], s_filter=62, n_filter=32))
    arch.add(Pool([31, 31, 32]))

    arch.add(Spacer())

    # second layer
    arch.add(Conv([31, 31, 64], s_filter=31, n_filter=64))
    arch.add(Conv([29, 29, 64], s_filter=29, n_filter=64))
    arch.add(Pool([14, 14, 64]))

    arch.add(Spacer())

    # third layer
    arch.add(Conv([13, 13, 64], s_filter=14, n_filter=64))
    arch.add(Conv([12, 12, 64], s_filter=12, n_filter=64))
    arch.add(Pool([6, 6, 64]))

    arch.add(Spacer())

    # flatten
    arch.add(Dense(64, 64))

    # output
    arch.add(Spacer())
    arch.add(Softmax(5, 5))

    arch.generate(f"{Path(sys.argv[0]).stem}.tex")


if __name__ == "__main__":
    main()

The rendering is started with this command:

bash to_pdf.sh main

where main is the name of the python file.

Project details


Download files

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

Source Distribution

Built Distribution

neural_network_renderer-0.1-py3-none-any.whl (9.9 kB view details)

Uploaded Python 3

File details

Details for the file neural-network-renderer-0.1.macosx-11.0-arm64.tar.gz.

File metadata

  • Download URL: neural-network-renderer-0.1.macosx-11.0-arm64.tar.gz
  • Upload date:
  • Size: 18.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/34.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.9 tqdm/4.63.1 importlib-metadata/4.11.3 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.10.4

File hashes

Hashes for neural-network-renderer-0.1.macosx-11.0-arm64.tar.gz
Algorithm Hash digest
SHA256 9a54ceb9419b3e5fab21ddd68b5106123056d76f294af56c4dad36dbcc841776
MD5 0b232e45278aa1f971406c85e8ddfdde
BLAKE2b-256 1d8cc88175e8aa12829bddec8f1ffedd72d5e68098c85c8736a5ea2b6ab34cc3

See more details on using hashes here.

File details

Details for the file neural_network_renderer-0.1-py3-none-any.whl.

File metadata

  • Download URL: neural_network_renderer-0.1-py3-none-any.whl
  • Upload date:
  • Size: 9.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/34.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.9 tqdm/4.63.1 importlib-metadata/4.11.3 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.10.4

File hashes

Hashes for neural_network_renderer-0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 3988099abc27e85c4be18a375936ff50de6fd41e06e2f091dfba42236d2f5d6b
MD5 5d4df28ca5bbb87543f04b2055b59674
BLAKE2b-256 1241303bbcd80369f395d67bbe3778ccfd475b24a98495691d45fe3e371cf785

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page