diff --git a/lectures/opt_transport.md b/lectures/opt_transport.md index e6d1ab348..a97955718 100644 --- a/lectures/opt_transport.md +++ b/lectures/opt_transport.md @@ -681,10 +681,12 @@ X Sure enough, we have the same solution and the same cost ```{code-cell} ipython3 -total_cost = np.sum(X * C) +total_cost = np.vdot(X, C) total_cost ``` +Here we use [np.vdot](https://numpy.org/doc/stable/reference/generated/numpy.vdot.html) for the trace inner product of X and C + ### A Larger Application Now let's try using the same package on a slightly larger application.