Questions tagged [hessian-matrix]

Hessian matrix is an N x N matrix containing second partial derivatives of a function with respect to its input variables.

Hessian matrices are used extensively in second-order optimization methods such as Newton's method. They give information about the curvature around a point x0 on a function surface.

119 questions
1
vote
2 answers

Trying to understand the Hutchinson diagonal Hessian approximation

I am reading about his paper [1] and I have an implementation taken from here. At some point of the code the diagonal of the Hessian matrix is approximated by a function set_hessian you can find below. In the end of set_hessian(), it is mentioned…
Darkmoor
  • 862
  • 11
  • 29
1
vote
0 answers

Hessian matrix w.r.t parameter of MLP is not symmetric (TF2.0)

I tried to calculate the Hessian matrix w.r.t. model parameters However, each tensor shape in the Hessian matrix was not symmetric. import tensorflow as tf x_train = tf.constant(tf.random.uniform(shape=(100, 24), minval=0, maxval=100)) y_train =…
MyPrunus
  • 57
  • 5
1
vote
0 answers

How to properly specify Jacobian & Hessian functions of inequality constraints in Optim

I’m trying to use the Optim package in Julia to optimize an objective function with 19 variables, and the following inequality constraints: 0 <= x[1]/3 - x[2] <= 1/3 5 <= 1/x[3] + 1/x[4] <= 6 I’m trying to use either IPNewton() or…
Leonidas
  • 613
  • 1
  • 6
  • 23
1
vote
1 answer

R: LTM: How can I make an odd-behaving hessian matrix converge when standardization fails?

I try to fit a graded response model with the R package ltm. The issue is that the Hessian matrix does not converge, and I don't understand why. Here is the code I use: dset %>% select(Apathy5, Apathy6, Apathy7, Apathy8 ) %>% grm(IRT.param =…
Marco Meyer
  • 323
  • 2
  • 4
  • 6
1
vote
1 answer

How can I get standard errors for my 4 parameters when the Hessian matrix from solnp is 5 by 5?

I'm using the solnp() function in the R package Rsolnp to solve a nonlinear regression with constraints. It works well, converges with no problem. I want to use the Hessian matrix to calculate standard errors of the four parameter estimates, but…
Jean V. Adams
  • 4,634
  • 2
  • 29
  • 46
1
vote
1 answer

hessian for inequality constraint in fmincon

I am trying to help fmincon to converge faster by supplying gradient vector and Hessian matrix. I am using interior-point algorithm and I realize that in such case, I have to supply Hessian using a call to another function which is assigned to…
ِdidi
  • 19
  • 2
1
vote
1 answer

Minimize function won't show me the hessian

I minimized a function and need it's (inverse) Hessian for the standard errors. the function gives me this for the (inverse) Hessian: hess_inv: <5x5 LbfgsInvHessProduct with dtype=float64> I expected a matrix here? I tried list(hess_inv) but that…
Rens
  • 177
  • 9
1
vote
1 answer

Write function with dynamic variables to get its Hessian matrix using syms, f, and hessian

My problem has 60 variables (x1 to x60) and here is the function: f=(x1+x2+x3)*x1+(x2+x3+x4)*x2+...+(x58+x59+x60)*x58 I want to get the Hessian matrix of the function f. However, because there are so many variables, I don't want to write them one…
Naomi Li
  • 25
  • 4
1
vote
1 answer

statsmodel.api fit() throws overflow error

I am using Logistic regression for Mnist digit classification and am using statsmodel.api library to fit the parameters but the Logit.fit() still throws an overflow warning.Below is the error I am getting on Windows10,python 2.7 using library…
1
vote
1 answer

Arbitrary dimension for CVXGEN program

I would like to solve a QP/LP problem in MatLab using CVXGEN. I have preference for CVXGEN over CVX, since CVXGEN is much faster. In particular, I would like to solve min f(x) s.t. x in X where f(x) is in quadratic form and X is compact, convex,…
1
vote
1 answer

theano T.grad() error: not part of computational graph

code: a = T.vector() b = T.vector() loss = T.sum(a-b) dy = T.grad(loss, a) d2y = T.grad(loss, dy) f = theano.function([a,b], y) print f([.5,.5,.5], [1,0,1]) output: theano.gradient.DisconnectedInputError: grad method was asked to compute the…
user2255757
  • 756
  • 1
  • 6
  • 24
1
vote
1 answer

gradient and hessian of norm-1?

For solving an optimization problem in MATLAB I need to calculate the gradient and hessian of the following norm-1 function: norm1(A.x) here x is the parameter (n-by-1 vector) and A is a known fixed matrix (n-by-n matrix). Anybody have seen similar…
VahidB
  • 11
  • 4
1
vote
1 answer

Finding symbolic Hessian matrix for a function

I have the pseudocode function f(x,y)=x+y, and I want to find the symbolic Hessian matrix (2x2 second order partial derivative matrix) using Matlab. How do I do this? Here is my first attempt, which is very far from the correct syntax: syms x…
Andrew Hundt
  • 2,551
  • 2
  • 32
  • 64
1
vote
0 answers

How to retrieve the Hessian after a logistic regression in scikit-learn?

I am using the package scikit-learn to compute a logistic regression on a moderately large data set (300k rows, 2k cols. That's pretty large to me!). Now, since scikit-learn does not produce confidence intervals, I am calculating them myself. To do…
VitorH
  • 11
  • 1
1
vote
0 answers

Wrong Hessian from optim in R

I am doing some Extreme Values analysis. I don't want to use the fevd package for a variety of reasons (the first I want to be able to tweak some things that I cannot do otherwise). I wrote my own code. It is mostly very simple, and I thought I had…
claude
  • 549
  • 8
  • 25