Given m x n matrix A and n x r matrix B how to write the following formula in np.einsum
notation?
f(i) = \sum_{j,k} a_ij * b_jk
What will change in np.einsum
if r x p matrix C will be added?
f(i) = \sum_{j,k,l} a_ij * b_jk * c_kl
Given m x n matrix A and n x r matrix B how to write the following formula in np.einsum
notation?
f(i) = \sum_{j,k} a_ij * b_jk
What will change in np.einsum
if r x p matrix C will be added?
f(i) = \sum_{j,k,l} a_ij * b_jk * c_kl
@Sengiley Despite you already answered yourself's question. A more general version that allows broadcasting is:
np.einsum('...ij,jk,kl->...i', a, b, c)