In my humble opinion it doesn't make sense to include P5js, a canvas, and the setup and draw functions in the example code for creating a ML5 Neural Network:
https://docs.ml5js.org/#/reference/neural-network
This is confusing if you just want to learn working with neural networks.