Skip to content

Commit

Permalink
include assertions to prevent issue #14
Browse files Browse the repository at this point in the history
  • Loading branch information
jpivarski committed Jan 7, 2025
1 parent d664ffd commit f412d74
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions deep-learning-intro-for-hep/24-convolutional.md
Original file line number Diff line number Diff line change
Expand Up @@ -342,6 +342,14 @@ confusion_matrix = np.array(
confusion_matrix
```

```{code-cell} ipython3
assert confusion_matrix[0:2, 2:].sum() / confusion_matrix[0:2].sum() < 0.5
```

```{code-cell} ipython3
assert confusion_matrix[3:, :3].sum() / confusion_matrix[3:].sum() < 0.5
```

Most images are in the diagonal of the confusion matrix—the predicted category is the actual category—so this CNN is correctly identifying jets!

The biggest confusion (off-diagonal terms) is between gluons and light quarks and between $W$ and $Z$ bosons, as expected.
Expand Down

0 comments on commit f412d74

Please sign in to comment.