Skip to main content

This is a simple encapsulation for networkX, which further simplifies the process of networkX for drawing neural network diagrams, so that the author can only focus on the logical writing of neural networks, without spending time on the visual presentation of neural networks. At the same time, this module also inherits all the methods of network and does not affect the normal function calls of networkX.

Project description

networkXsimple

This is a simple encapsulation for networkX, which further simplifies the process of networkX for drawing neural network diagrams, so that the author can only focus on the logical writing of neural networks, without spending time on the visual presentation of neural networks. At the same time, this module also inherits all the methods of network and does not affect the normal function calls of networkX.

install

pip install

guid

api

graph.addNode(name="node name", desc="node A desc", pos=(int layer, int node No. in this layer) , nexts=[
    {
        "node": "B",
        "label":"B"
    },
    previous=[]
])
  • nexts : output degress dict
  • previous : input degress dict { "node": "next node name", "label":"edge desc" }

exmaple

import numpy as np
import matplotlib.pyplot as plt
import math
import netGraph


# 示例用法
graph = netGraph(type=1)

# 添加节点
graph.addNode(name="A", desc="node A", pos=(1, 1) , nexts=[
    {
        "node": "B",
        "label":"B"
    }
])
graph.addNode(name="B", desc="node B", pos=(1, 2))
graph.addNode(name="C", desc="node C", pos=(1, 3))
graph.addNode(name="D", desc="node A", pos=(1, 4))
graph.addNode(name="E", desc="node A", pos=(1, 5))
graph.addNode(name="F", desc="node A", pos=(1, 6))
graph.addNode(name="I", desc="node A", pos=(1, 7))
graph.addNode(name="G", desc="node B", pos=(2, 1))
graph.addNode(name="H", desc="node B", pos=(2, 2))
graph.addNode(name="Z", desc="node B", pos=(2, 3))

graph.addNode(name="1", desc="node B", pos=(3, 1))
graph.addNode(name="2", desc="node B", pos=(3, 2))
graph.addNode(name="3", desc="node B", pos=(3, 3))

# add edge
graph.addEdge(("B", "G"))
# draw network
graph.draw()

show

img.png

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

package_xskj_NetworkXsimple-0.1.0.tar.gz (9.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

package_xskj_NetworkXsimple-0.1.0-py2.py3-none-any.whl (8.7 kB view details)

Uploaded Python 2Python 3

File details

Details for the file package_xskj_NetworkXsimple-0.1.0.tar.gz.

File metadata

File hashes

Hashes for package_xskj_NetworkXsimple-0.1.0.tar.gz
Algorithm Hash digest
SHA256 39dc7ed29bc2065ed3bef2ddc7236fc4746263d55703b661e445362454f6c84c
MD5 8613cd3eb10406aecfc60b437856b91f
BLAKE2b-256 837f333c9298b093f03377371a5b0da8249267d66b3bdb1f34f9a7be1199a0e2

See more details on using hashes here.

File details

Details for the file package_xskj_NetworkXsimple-0.1.0-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for package_xskj_NetworkXsimple-0.1.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 53e490376eac01b5296ad213b26d9d628124f17cce64c2c58933212446e4ff9a
MD5 987b79cdb4b7e121b46be25823f7856c
BLAKE2b-256 7e747b0bc01b5c9141ad0530a4081fd2fa72c5c378b46a93a22d5eb04c754cea

See more details on using hashes here.

Supported by

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