The loss function should be no different in the binary and multiclass cases; the only difference is the input. Example:

```
>>> yt = array([0, 0, 1])
>>> yp = array([.1, .01, .85])
```

Binary formulation:

```
>>> -(yt * log(yp) + (1 - yt) * log(1 - yp)).sum()
0.27792978100910271
```

Multiclass loss:

```
>>> yt = np.vstack([yt, 1 - yt])
>>> yp = np.vstack([yp, 1 - yp])
>>> -(yt * np.log(yp)).sum()
0.27792978100910271
```

(A good look at the definition shows that the binary formula is just a special case of the multiclass formula.)