Well if it’s not layers but more like a chaotic web I’m not sure how you can do that neatly. You could do lots and lots of mini-layers, but to fit them together would take something handcrafted.
Or maybe organise them in layers but put some nodes/weights to zero.
Also, have a look at the NEAT algorithm. That can create these structures but is an evolutionary algorithm