{"id":13936144,"url":"https://github.com/RedaOps/ann-visualizer","last_synced_at":"2025-07-19T21:31:51.429Z","repository":{"id":42646172,"uuid":"127026864","full_name":"RedaOps/ann-visualizer","owner":"RedaOps","description":"A python library for visualizing Artificial Neural Networks (ANN)","archived":true,"fork":false,"pushed_at":"2020-10-16T16:57:02.000Z","size":62,"stargazers_count":1251,"open_issues_count":21,"forks_count":217,"subscribers_count":44,"default_branch":"master","last_synced_at":"2025-06-21T03:17:34.612Z","etag":null,"topics":["ann","ann-visualizer","neural-network","python-library"],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/RedaOps.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-03-27T18:05:44.000Z","updated_at":"2025-06-19T20:58:27.000Z","dependencies_parsed_at":"2022-08-12T10:03:04.539Z","dependency_job_id":null,"html_url":"https://github.com/RedaOps/ann-visualizer","commit_stats":null,"previous_names":["prodicode/ann-visualizer"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/RedaOps/ann-visualizer","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RedaOps%2Fann-visualizer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RedaOps%2Fann-visualizer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RedaOps%2Fann-visualizer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RedaOps%2Fann-visualizer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/RedaOps","download_url":"https://codeload.github.com/RedaOps/ann-visualizer/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RedaOps%2Fann-visualizer/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266019657,"owners_count":23864916,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ann","ann-visualizer","neural-network","python-library"],"created_at":"2024-08-07T23:02:25.025Z","updated_at":"2025-07-19T21:31:46.414Z","avatar_url":"https://github.com/RedaOps.png","language":"Python","readme":"![photo](https://i.imgur.com/DrZJOzy.png)\n![photo](https://i.imgur.com/EHIoNoR.png)\n\n# ANN Visualizer\n[![PyPI version](https://badge.fury.io/py/ann_visualizer.svg)](https://badge.fury.io/py/ann_visualizer) [![Build Status](https://travis-ci.org/Prodicode/ann-visualizer.svg?branch=master)](https://travis-ci.org/Prodicode/ann-visualizer) [![Donate](https://liberapay.com/assets/widgets/donate.svg)](https://liberapay.com/Prodicode/donate)\n\nA great visualization python library used to work with Keras. It uses python's graphviz library to create a presentable graph of the neural network you are building.\n\n## Version 2.0 is Out!\n\nVersion 2.0 of the ann_visualizer is now released! The community demanded a CNN visualizer, so we updated our module. You can check out an example of a CNN visualization below!\n\nHappy visualizing!\n\n## Installation\n### From Github\n1. Download the `ann_visualizer` folder from the github repository.\n2. Place the `ann_visualizer` folder in the same directory as your main python script.\n\n### From pip\nUse the following command:\n\n```bash\npip3 install ann_visualizer\n```\n\nMake sure you have graphviz installed. Install it using:\n\n```bash\nsudo apt-get install graphviz \u0026\u0026 pip3 install graphviz\n```\n\n## Usage\n\n```python\n\nfrom ann_visualizer.visualize import ann_viz;\n#Build your model here\nann_viz(model)\n```\n\n## Documentation\n\n### ann_viz(model, view=True, filename=\"network.gv\", title=\"MyNeural Network\")\n* `model` - The Keras Sequential model\n* `view` - If True, it opens the graph preview after executed\n* `filename` - Where to save the graph. (.gv file format)\n* `title` - A title for the graph\n\n## Example ANN\n```python\nimport keras;\nfrom keras.models import Sequential;\nfrom keras.layers import Dense;\n\nnetwork = Sequential();\n        #Hidden Layer#1\nnetwork.add(Dense(units=6,\n                  activation='relu',\n                  kernel_initializer='uniform',\n                  input_dim=11));\n\n        #Hidden Layer#2\nnetwork.add(Dense(units=6,\n                  activation='relu',\n                  kernel_initializer='uniform'));\n\n        #Exit Layer\nnetwork.add(Dense(units=1,\n                  activation='sigmoid',\n                  kernel_initializer='uniform'));\n\nfrom ann_visualizer.visualize import ann_viz;\n\nann_viz(network, title=\"\");\n```\n\nThis will output:\n![photo](https://i.imgur.com/ngThGlk.png)\n\n## Example CNN\n```python\nimport keras;\nfrom keras.models import Sequential;\nfrom keras.layers import Dense;\nfrom ann_visualizer.visualize import ann_viz\nmodel = build_cnn_model()\nann_viz(model, title=\"\")\n\ndef build_cnn_model():\n  model = keras.models.Sequential()\n\n  model.add(\n      Conv2D(\n          32, (3, 3),\n          padding=\"same\",\n          input_shape=(32, 32, 3),\n          activation=\"relu\"))\n  model.add(Dropout(0.2))\n\n  model.add(\n      Conv2D(\n          32, (3, 3),\n          padding=\"same\",\n          input_shape=(32, 32, 3),\n          activation=\"relu\"))\n  model.add(MaxPooling2D(pool_size=(2, 2)))\n  model.add(Dropout(0.2))\n\n  model.add(\n      Conv2D(\n          64, (3, 3),\n          padding=\"same\",\n          input_shape=(32, 32, 3),\n          activation=\"relu\"))\n  model.add(Dropout(0.2))\n\n  model.add(\n      Conv2D(\n          64, (3, 3),\n          padding=\"same\",\n          input_shape=(32, 32, 3),\n          activation=\"relu\"))\n  model.add(MaxPooling2D(pool_size=(2, 2)))\n  model.add(Dropout(0.2))\n\n  model.add(Flatten())\n  model.add(Dense(512, activation=\"relu\"))\n  model.add(Dropout(0.2))\n\n  model.add(Dense(10, activation=\"softmax\"))\n\n  return model\n```\n\nThis will output:\n![photo](https://i.imgur.com/v3QpACl.png)\n\n## Contributions\nThis library is still unstable. Please report all bug to the issues section. It is currently tested with `python3.5` and `python3.6`, but it should run just fine on any python3.\n","funding_links":["https://liberapay.com/Prodicode/donate"],"categories":["Python"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FRedaOps%2Fann-visualizer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FRedaOps%2Fann-visualizer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FRedaOps%2Fann-visualizer/lists"}