mzszym / sparsegrad

sparsegrad - automatic computation of sparse Jacobian
https://marekszymanski.com/software/sparsegrad/
GNU Affero General Public License v3.0
9 stars 1 forks source link

Matrix multiplication #2

Open IgorTo opened 4 years ago

IgorTo commented 4 years ago

Hi, my objective function is:

def F(x):
    A = np.diag(np.random.rand(100))
    return np.diag(x**2) @ A @ x

For x0 = np.random.rand(100), the command: F(ad.seed(x0)) returns: ValueError: Input must be 1- or 2-d.

Is a matrix multiplication in an objective function unsupported?