## Diagram: Forward and Backward Pass in a Neural Network
### Overview
The image illustrates the forward and backward pass in a neural network with two heads sharing a common layer. It includes a diagram of the network architecture and corresponding code snippet.
### Components/Axes
* **Legend:** Located at the top of the image.
* Forward: Represented by a blue arrow.
* Backward: Represented by a red arrow.
* Tensor: Represented by a gray circle.
* **Network Diagram:** Located on the left side of the image.
* Shared: A dark blue rounded rectangle at the bottom.
* Head 1: A light green rounded rectangle above "Shared" on the left.
* Head 2: A light green rounded rectangle above "Shared" on the right.
* Loss 1: A light yellow rounded rectangle above "Head 1".
* Loss 2: A light yellow rounded rectangle above "Head 2".
* Tensor: A gray circle connecting "Shared", "Head 1", and "Head 2".
* **Code Snippet:** Located on the right side of the image.
### Detailed Analysis
* **Network Diagram:**
* Forward Pass:
* Arrow 1 (blue): From "Shared" to the gray "Tensor" circle.
* Arrow 2 (blue): From the gray "Tensor" circle to "Head 1".
* Arrow 4 (blue): From the gray "Tensor" circle to "Head 2".
* Arrow 3 (blue): From "Head 1" to "Loss 1".
* Arrow 5 (blue): From "Head 2" to "Loss 2".
* Backward Pass:
* Arrow 6 (red): From the gray "Tensor" circle back to "Shared".
* **Code Snippet:**