Plotting neural network diagram #586
-
I did the following plot in Thanks in advance! |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments
-
Yes, this is possible. Maybe |
Beta Was this translation helpful? Give feedback.
-
Some starting point: #import "@preview/cetz:0.2.2"
#cetz.canvas({
import cetz.draw: *
let node(pos, body, ..style) = {
content(pos, body, padding: .2, frame: "circle", ..style)
}
node(name: "1", (0,+1), [1])
node(name: "2", (0,-1), [2])
node(name: "3", (2,+2), [3], stroke: red)
node(name: "4", (2, 0), [4], stroke: red)
node(name: "5", (2,-2), [5], stroke: red)
node(name: "6", (4, 0), [6], stroke: blue)
set-style(line: (mark: (end: "stealth", fill: black)),
content: (padding: .2))
line((rel: (-1, 0), to: "1.west"), "1", name: "in-1")
content("in-1.start", $X_1$, anchor: "east")
line((rel: (-1, 0), to: "2.west"), "2", name: "in-2")
content("in-2.start", $X_2$, anchor: "east")
line("1", "3", name: "1-3")
content("1-3.50%", $W_(1,3)$, angle: "3", anchor: "south")
line("1", "4")
// ...
line("2", "3")
}) |
Beta Was this translation helpful? Give feedback.
-
Superb, @johannes-wolf! Thanks! |
Beta Was this translation helpful? Give feedback.
Some starting point: