From 09ebb9fc8e1c6673534233852f7df25ecb47cd82 Mon Sep 17 00:00:00 2001 From: Tammy DiPrima Date: Fri, 24 Oct 2025 09:00:30 -0400 Subject: [PATCH 1/5] Update repository URL in installation instructions --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 1130c9f..6cd4841 100644 --- a/README.md +++ b/README.md @@ -23,7 +23,7 @@ This package is based on the original **[PlotNeuralNet by HarisIqbal88](https:// 1. Clone the repository: ```bash - git clone https://github.com//PlotNeuralNet.git + git clone https://github.com/kgruiz/PlotNeuralNet.git cd PlotNeuralNet ``` @@ -172,4 +172,4 @@ This package is based on the original **[PlotNeuralNet by HarisIqbal88](https:// ## **License** -This project is licensed under the **MIT License**. See the [LICENSE](LICENSE) file for more details. \ No newline at end of file +This project is licensed under the **MIT License**. See the [LICENSE](LICENSE) file for more details. From d37ab145681b9b4a2799a007e3a53cd850a9ee49 Mon Sep 17 00:00:00 2001 From: Tammy DiPrima Date: Fri, 24 Oct 2025 09:10:55 -0400 Subject: [PATCH 2/5] Fix syntax for Original Work URL in pyproject.toml --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index b95b60a..f1a08f7 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -22,4 +22,4 @@ dependencies = [] # Add runtime dependencies if needed [project.urls] Source = "https://github.com/kgruiz/PlotNeuralNet" -Original Work = "https://github.com/HarisIqbal88/PlotNeuralNet" +"Original Work" = "https://github.com/HarisIqbal88/PlotNeuralNet" From 482f4bdee8267d2e956467f767b0824644993a1b Mon Sep 17 00:00:00 2001 From: Tammy DiPrima Date: Fri, 24 Oct 2025 09:14:50 -0400 Subject: [PATCH 3/5] Remove readme-content-type entry Removed readme-content-type from pyproject.toml --- pyproject.toml | 1 - 1 file changed, 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index f1a08f7..36ec51d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -7,7 +7,6 @@ name = "PlotNeuralNet" version = "0.1.0" description = "Visualize neural networks with a focus on easy-to-use diagrams." readme = "README.md" -readme-content-type = "text/markdown" authors = [ {name = "Kaden Gruizenga", email = "kgruiz@umich.edu"} ] From 1b36c775d08547e590dee2a89bff527965704dba Mon Sep 17 00:00:00 2001 From: Tammy DiPrima Date: Fri, 24 Oct 2025 10:36:27 -0400 Subject: [PATCH 4/5] Update README with corrected imports and paths --- README.md | 43 +++++++++++++++++++++++++++---------------- 1 file changed, 27 insertions(+), 16 deletions(-) diff --git a/README.md b/README.md index 6cd4841..5f1764b 100644 --- a/README.md +++ b/README.md @@ -22,17 +22,20 @@ This package is based on the original **[PlotNeuralNet by HarisIqbal88](https:// ### **Installation** 1. Clone the repository: + ```bash git clone https://github.com/kgruiz/PlotNeuralNet.git cd PlotNeuralNet ``` 2. Install the package: + ```bash pip install . ``` 3. Verify the installation: + ```python import PlotNeuralNet print("PlotNeuralNet installed successfully!") @@ -50,33 +53,36 @@ The package is organized to simplify the creation of diagrams. It includes Pytho You can use the Python API to define your architecture programmatically. For example: ```python -from PlotNeuralNet.pycore import tikzeng -from PlotNeuralNet.pycore.blocks import block_2ConvPool, block_Unconv +from PlotNeuralNet.PyCore import TikzGen as tikzeng +from PlotNeuralNet.PyCore.Blocks import Block2ConvPool, BlockUnconv # Define architecture arch = [ - tikzeng.to_head('..'), - tikzeng.to_cor(), - tikzeng.to_begin(), - + tikzeng.ToHead(".."), + tikzeng.ToCor(), + tikzeng.ToBegin(), # Input image - tikzeng.to_input('../examples/fcn8s/cats.jpg'), - + tikzeng.ToInput('./PlotNeuralNet/examples/fcn8s/cats.jpg'), # Encoder - *block_2ConvPool(name='b1', botton='input', top='b2', s_filer=256, n_filer=64), - *block_2ConvPool(name='b2', botton='b2', top='b3', s_filer=128, n_filer=128), - + *Block2ConvPool(name="b1", botton="input", top="b2", sFilter=256, nFilter=64), + *Block2ConvPool(name="b2", botton="b2", top="b3", sFilter=128, nFilter=128), # Decoder - *block_Unconv(name='b4', botton='b3', top='output', s_filer=64, n_filer=32), - + *BlockUnconv(name="b4", botton="b3", top="output", sFilter=64, nFilter=32), # Output layer - tikzeng.to_ConvSoftMax(name='softmax', offset="(1,0,0)", to="(output-east)", width=1, height=30, depth=30), - tikzeng.to_end(), + tikzeng.ToConvSoftMax( + name="softmax", + offset="(1,0,0)", + to="(output-east)", + width=1, + height=30, + depth=30, + ), + tikzeng.ToEnd(), ] # Generate the architecture diagram def main(): - tikzeng.to_generate(arch, "my_architecture.tex") + tikzeng.ToGenerate(arch, "my_architecture.tex") if __name__ == "__main__": main() @@ -84,11 +90,13 @@ if __name__ == "__main__": #### **Compile and View the Diagram** Run the Python script: + ```bash python my_architecture.py ``` Compile the `.tex` file with: + ```bash bash ../tikzmake.sh my_architecture ``` @@ -100,6 +108,7 @@ bash ../tikzmake.sh my_architecture You can directly modify `.tex` files in the `examples` directory, such as `examples/FCN-8` or `examples/HED`. Each `.tex` file demonstrates how to use LaTeX for defining architectures. To compile a `.tex` file, use: + ```bash pdflatex .tex ``` @@ -112,6 +121,7 @@ The package structure includes predefined resources for easy reuse: #### **LaTeX Resources** - Available in the `PlotNeuralNet/layers/` directory. - Example LaTeX layer definitions: + ```latex \input{layers/Box.sty} ``` @@ -123,6 +133,7 @@ The package structure includes predefined resources for easy reuse: #### **Python Scripts** - Python examples for generating diagrams programmatically are in `PlotNeuralNet/pyexamples/`. - Example usage: + ```bash python PlotNeuralNet/pyexamples/unet.py ``` From 63a58fda6f65aa2cc846f662271dfc8980f045ae Mon Sep 17 00:00:00 2001 From: Tammy DiPrima Date: Fri, 24 Oct 2025 10:37:18 -0400 Subject: [PATCH 5/5] Rename sFiler and nFiler to sFilter and nFilter Fixed typos --- PlotNeuralNet/PyCore/Blocks.py | 48 +++++++++++++++++----------------- 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/PlotNeuralNet/PyCore/Blocks.py b/PlotNeuralNet/PyCore/Blocks.py index e501e61..06eda2c 100644 --- a/PlotNeuralNet/PyCore/Blocks.py +++ b/PlotNeuralNet/PyCore/Blocks.py @@ -6,8 +6,8 @@ def Block2ConvPool( name, botton, top, - sFiler=256, - nFiler=64, + sFilter=256, + nFilter=64, offset="(1,0,0)", size=(32, 32, 3.5), opacity=0.5, @@ -23,9 +23,9 @@ def Block2ConvPool( The node from which the block starts. top : str The node where the block ends. - sFiler : int, optional + sFilter : int, optional Size of the filter, by default 256. - nFiler : int, optional + nFilter : int, optional Number of filters, by default 64. offset : str, optional Position offset, by default "(1,0,0)". @@ -42,8 +42,8 @@ def Block2ConvPool( return [ ToConvConvRelu( name=f"ccr_{name}", - sFiler=str(sFiler), - nFiler=(nFiler, nFiler), + sFilter=str(sFilter), + nFilter=(nFilter, nFilter), offset=offset, to=f"({botton}-east)", width=(size[2], size[2]), @@ -67,8 +67,8 @@ def BlockUnconv( name, botton, top, - sFiler=256, - nFiler=64, + sFilter=256, + nFilter=64, offset="(1,0,0)", size=(32, 32, 3.5), opacity=0.5, @@ -84,9 +84,9 @@ def BlockUnconv( The node from which the block starts. top : str The node where the block ends. - sFiler : int, optional + sFilter : int, optional Size of the filter, by default 256. - nFiler : int, optional + nFilter : int, optional Number of filters, by default 64. offset : str, optional Position offset, by default "(1,0,0)". @@ -114,8 +114,8 @@ def BlockUnconv( name=f"ccr_res_{name}", offset="(0,0,0)", to=f"(unpool_{name}-east)", - sFiler=str(sFiler), - nFiler=str(nFiler), + sFilter=str(sFilter), + nFilter=str(nFilter), width=size[2], height=size[0], depth=size[1], @@ -125,8 +125,8 @@ def BlockUnconv( name=f"ccr_{name}", offset="(0,0,0)", to=f"(ccr_res_{name}-east)", - sFiler=str(sFiler), - nFiler=str(nFiler), + sFilter=str(sFilter), + nFilter=str(nFilter), width=size[2], height=size[0], depth=size[1], @@ -135,8 +135,8 @@ def BlockUnconv( name=f"ccr_res_c_{name}", offset="(0,0,0)", to=f"(ccr_{name}-east)", - sFiler=str(sFiler), - nFiler=str(nFiler), + sFilter=str(sFilter), + nFilter=str(nFilter), width=size[2], height=size[0], depth=size[1], @@ -146,8 +146,8 @@ def BlockUnconv( name=f"{top}", offset="(0,0,0)", to=f"(ccr_res_c_{name}-east)", - sFiler=str(sFiler), - nFiler=str(nFiler), + sFilter=str(sFilter), + nFilter=str(nFilter), width=size[2], height=size[0], depth=size[1], @@ -161,8 +161,8 @@ def BlockRes( name, botton, top, - sFiler=256, - nFiler=64, + sFilter=256, + nFilter=64, offset="(0,0,0)", size=(32, 32, 3.5), opacity=0.5, @@ -180,9 +180,9 @@ def BlockRes( The node from which the block starts. top : str The node where the block ends. - sFiler : int, optional + sFilter : int, optional Size of the filter, by default 256. - nFiler : int, optional + nFilter : int, optional Number of filters, by default 64. offset : str, optional Position offset, by default "(0,0,0)". @@ -204,8 +204,8 @@ def BlockRes( name=f"{layerName}", offset=offset, to=f"({botton}-east)", - sFiler=str(sFiler), - nFiler=str(nFiler), + sFilter=str(sFilter), + nFilter=str(nFilter), width=size[2], height=size[0], depth=size[1],