I´m programming a basic neural network and want to plot it as a picture. For that i created all the nodes and edges i need.
for l, j in zip(self.layers, range(len(self.layers))):
for n, i in zip(l.neurons, range(len(l.neurons))):
fixed_positions[n.identifier] = (j, i)
for l in self.layers:
for n in l.neurons:
for c, w in zip(n.inconnections, n.inconnectionweights):
g.add_edge(n.identifier, c.identifier)
fixed_nodes = fixed_positions.keys()
pos = nx.spring_layout(g, pos=fixed_positions, fixed=fixed_nodes)
the blue points (imagine them on all edges) are where i want to add a label onto the edges, but i dont know how to do it. Its supposed to work for any reasonable net size, i.e. it shoudl also work for 4, 3 and 2 neurons in the resprective layers.




label_posparameter which determines how far along the edge the label is (as a float between 0 and 1, 0 being at the end where the start node is, and 1 being at the other end) - does that help at all? - bouteillebleu