{"id":18917567,"url":"https://github.com/manuelblancovalentin/tensorplot","last_synced_at":"2026-02-06T12:08:14.964Z","repository":{"id":57474188,"uuid":"273833125","full_name":"manuelblancovalentin/tensorplot","owner":"manuelblancovalentin","description":"Tired of old-school boring default tensorflow/keras model architecture plots? Give this code a try! Nice, fresh, super-cool, colorful plots for your keras models (works with any wrapper also!).","archived":false,"fork":false,"pushed_at":"2025-01-05T20:54:42.000Z","size":20770,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-05-23T01:14:54.577Z","etag":null,"topics":["artificial","deep","gpu","intelligence","keras","learning","machine","model","plot","pytorch","tensorboard","tensorflow"],"latest_commit_sha":null,"homepage":"https://github.com/manuelblancovalentin/tensorplot","language":"HTML","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/manuelblancovalentin.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2020-06-21T04:22:07.000Z","updated_at":"2025-01-05T20:54:45.000Z","dependencies_parsed_at":"2024-11-08T10:32:55.872Z","dependency_job_id":"875ac0e2-f261-4a45-a473-6a93c8331469","html_url":"https://github.com/manuelblancovalentin/tensorplot","commit_stats":{"total_commits":14,"total_committers":2,"mean_commits":7.0,"dds":0.0714285714285714,"last_synced_commit":"6196fb6ccd8c11f15550e4dc20649e696431da5d"},"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/manuelblancovalentin/tensorplot","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/manuelblancovalentin%2Ftensorplot","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/manuelblancovalentin%2Ftensorplot/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/manuelblancovalentin%2Ftensorplot/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/manuelblancovalentin%2Ftensorplot/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/manuelblancovalentin","download_url":"https://codeload.github.com/manuelblancovalentin/tensorplot/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/manuelblancovalentin%2Ftensorplot/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265895909,"owners_count":23845403,"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":["artificial","deep","gpu","intelligence","keras","learning","machine","model","plot","pytorch","tensorboard","tensorflow"],"created_at":"2024-11-08T10:27:00.173Z","updated_at":"2026-02-06T12:08:09.937Z","avatar_url":"https://github.com/manuelblancovalentin.png","language":"HTML","funding_links":[],"categories":[],"sub_categories":[],"readme":"# TensorPlot\n#### Easily plot keras models using nice style and formatting\nauthor: Manu Blanco Valentin \u003c/br\u003e\ngithub: [manuelblancovalentin](http://github.com/manuelblancovalentin) \u003c/br\u003e\nversion: v0.0.1\n\n\n## What is this module intended for?\nTired of old-school boring default tensorflow/keras model architecture plots? Give this code a try! Nice, fresh, super-cool, colorful plots for your keras models (works with any wrapper also!).\n\nThis library was designed to help in the process of visualizing keras models graphs. It was expected to be as straightforward as possible.\n\n## How to use?\n\nFirst define your tf.keras model:\n\n```python\nimport tensorflow as tf\n\ninput = tf.keras.layers.Input(shape=(100,100,1))\nlayer = tf.keras.layers.Conv2D(64,(3,3),activation='relu')(input)\nlayer = tf.keras.layers.Conv2D(128,(5,5),activation='relu')(layer)\nlayer = tf.keras.layers.Flatten()(layer)\nlayer = tf.keras.layers.Dense(128,activation='relu')(layer)\nlayer = tf.keras.layers.Dense(32,activation='relu')(layer)\nlayer = tf.keras.layers.Dense(1,activation='softmax')(layer)\n\nmodel = tf.keras.Model(input,layer)\n```\n\nNow call the function to visualize the model (it does not require the model to be compiled nor trained, just created)\n\n```python\nimport tensorplot as tp\ntp.plot_model(model, filename = 'model.png')\n```\n\nThis call will generate both a png and an svg image with a graph representing the model we just created. The \u003cdisplay_shapes\u003e flag is used to toggle between displayinh or not the shape of the data through the layers of the net or not displaying them. In case the flag is set to True, the shape of the activations will be shown after any layer of the model that has the potential to effectively change the size of the data: convolutional, dense, pooling, flatten layers (activation, normalization, concatenate, merge, dropout layers are ignored). There is another flag that can be specified: \u003cdisplay_params\u003e, which is by default set to False. When this flag is set to True some important parameters of different layers of the model are displayed along with the layer itself (such as the kernel size and strides of a Conv2D layer, or the pool_size of a Pool layer, the dropout rate in a dropout layer, etc.). \n\nThe image below shows a comparison between the graph obtained using keras built in visualization utility ([see here](https://www.tensorflow.org/api_docs/python/tf/keras/utils/plot_model)) on the left, and the result using our function, on the right, for the model defined in the previous example:\n\n\u003cp align=\"center\"\u003e\n \u003cimg src=\"./imgs/builtin_model.png\"\u003e\n \u003cimg src=\"./imgs/my_model.png\"\u003e\n\u003c/p\u003e\n\nIf the display_params flag was set to True in the previous example the result would look like:\n\n\u003cp align=\"center\"\u003e\n \u003cimg src=\"./imgs/my_model_params.png\"\u003e\n\u003c/p\u003e\n\n\n## Supported layers\nAlmost every keras layer is supported (unsupported layers are: SimpleRNNCell, GRUCell nor LSTMCell -which are usually wrapped inside an RNN, SimpleRNN, GRU, LSTM or ConvLSTM2D layer-. Layer wrappers (such as TimeDistributed or Bidirectional) are not supported either). See further documentation on Keras layers on https://keras.io/layers . The render for each type of layer is shown below:\n\n### Core layers\nFrom top to bottom and left to right: Input, Flatten, Dense, Lambda, ActivityRegularization, Masking, Reshape, Permute and RepeatVector layers.\n\u003cp align=\"center\"\u003e\n \u003cimg src=\"./imgs/core_layers.png\"\u003e\n\u003c/p\u003e\n\n### Convolutional layers\n\u003cp align=\"center\"\u003e\n \u003cimg src=\"./imgs/conv_layers.png\"\u003e\n\u003c/p\u003e\n\n### Pooling layers\n\u003cp align=\"center\"\u003e\n \u003cimg src=\"./imgs/pool_layers.png\"\u003e\n\u003c/p\u003e\n\n### Locally Connected Layers\n\u003cp align=\"center\"\u003e\n \u003cimg src=\"./imgs/locally_layers.png\"\u003e\n\u003c/p\u003e\n\n### Activation layers \nNotice that these layers are created using the Activation layer and specifying the activation function rather than using specific advanced activation layers. This means that the ReLU layer shown below was obtained using ```tf.keras.layers.Activation('relu')``` instead of ```tf.keras.layers.ReLU```.\n\u003cp align=\"center\"\u003e\n \u003cimg src=\"./imgs/activation_layers.png\"\u003e\n\u003c/p\u003e\n\n### Advanced Activation Layers\n\u003cp align=\"center\"\u003e\n \u003cimg src=\"./imgs/advance_activation_layers.png\"\u003e\n\u003c/p\u003e\n\n### Normalization Layers\n\u003cp align=\"center\"\u003e\n \u003cimg src=\"./imgs/norm_layers.png\"\u003e\n\u003c/p\u003e\n\n### Dropout layers\n\u003cp align=\"center\"\u003e\n \u003cimg src=\"./imgs/dropout_layers.png\"\u003e\n\u003c/p\u003e\n\n### Recurrent layers\n\u003cp align=\"center\"\u003e\n \u003cimg src=\"./imgs/recurrent_layers.png\"\u003e\n\u003c/p\u003e\n\n### Noise layers\n\u003cp align=\"center\"\u003e\n \u003cimg src=\"./imgs/noise_layers.png\"\u003e\n\u003c/p\u003e\n\n### Embedding layers\n\u003cp align=\"center\"\u003e\n \u003cimg src=\"./imgs/embedding_layers.png\"\u003e\n\u003c/p\u003e\n\n### Merge layers\n\u003cp align=\"center\"\u003e\n \u003cimg src=\"./imgs/merge_layers.png\"\u003e\n\u003c/p\u003e\n\n\n## How to install?\n\nTo start using tensorplot simply install it via pip using the following command:\n\n```bash\npip install TensorPlot\n```\n\nExtra documentation about the module can be found in our pypi page:\n\n[https://pypi.org/project/TensorPlot/](https://pypi.org/project/TensorPlot/)\n\n\n## Requirements\n\nThe modules required to use tensorplot are cited below:\n\n```\nsetuptools~=46.4.0\nnumpy~=1.18.1\npydot\u003e=1.4.1\n```\n\n## How to cite this work?\n\nPlease, if you found my work valuable and it was useful for you, consider citing it in any published work that used it to help me improve the visibility of my code and make it easier for other people to access it. \n\nIf so, use the following bibtex entry in your paper:\n\n```\n@misc{MBValentin2020TensorPlot,\n  author = {Valentin, Manuel Blanco},\n  title = {Tensorplot},\n  year = {2020},\n  publisher = {GitHub},\n  journal = {GitHub repository},\n  howpublished = {\\url{https://github.com/manuelblancovalentin/tensorplot}}\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmanuelblancovalentin%2Ftensorplot","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmanuelblancovalentin%2Ftensorplot","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmanuelblancovalentin%2Ftensorplot/lists"}