BFGS 알고리즘을 사용하여 Julia에서 함수를 최소화하기 위해 Optim.jl 라이브러리를 사용하고 있습니다. 오늘 나는 question에 대해 같은 라이브러리를 요청했지만 혼란을 피하기 위해 2로 나누기로 결정했습니다.Optim.jl : 역방향 역변환
다음 계산을 위해 최적화 후 부정 역 Hessian의 추정값을 얻고 싶습니다. Optim을 라이브러리의 GitHub의 웹 사이트에서
, 나는 다음과 같은 작업 예제를 발견using Optim
rosenbrock(x) = (1.0 - x[1])^2 + 100.0 * (x[2] - x[1]^2)^2
result = optimize(rosenbrock, zeros(2), BFGS())
내가
결과에서 최적화 후 부정적인 역 독일인를 얻을 수있는 방법
? Hessian, Inverse Hessian 또는 Negative inverse Hessian을 식별하는 필드가 있습니까? 의견에 대한
편집
감사합니다. 함수가 inverse Hessian을 반환하도록 "optimize.jl"을 편집하는 것이 더 효율적이라고 생각합니까? 작업 예를 들어 아래를 참조하십시오 - 편집은 라인 (226)에 도입되었습니다 단지
if state.method_string == "BFGS"
return MultivariateOptimizationResults(state.method_string,
initial_x,
f_increased ? state.x_previous : state.x,
f_increased ? state.f_x_previous : state.f_x,
iteration,
iteration == options.iterations,
x_converged,
options.x_tol,
f_converged,
options.f_tol,
g_converged,
options.g_tol,
f_increased,
tr,
state.f_calls,
state.g_calls,
state.h_calls), state.invH
else
return MultivariateOptimizationResults(state.method_string,
initial_x,
f_increased ? state.x_previous : state.x,
f_increased ? state.f_x_previous : state.f_x,
iteration,
iteration == options.iterations,
x_converged,
options.x_tol,
f_converged,
options.f_tol,
g_converged,
options.g_tol,
f_increased,
tr,
state.f_calls,
state.g_calls,
state.h_calls)
end
또는를 :
return MultivariateOptimizationResults(state.method_string,
initial_x,
f_increased ? state.x_previous : state.x,
f_increased ? state.f_x_previous : state.f_x,
iteration,
iteration == options.iterations,
x_converged,
options.x_tol,
f_converged,
options.f_tol,
g_converged,
options.g_tol,
f_increased,
tr,
state.f_calls,
state.g_calls,
state.h_calls), state
는 최적화 후 "상태"에 대한 전체 액세스 권한을 가지려면.
편집이 변화가 Optim.jl 라이브러리의 새 버전에 도입되기 때문에 2
,이 논의를 계속할 필요가 없습니다. 현재로서는 확장형과 after_while! 트릭이 작동합니다. 개인적으로 나는 후자를 선호하기 때문에 @Dan Getz에게 정답을주는 토론을 마무리 할 것입니다.
'optimize.jl'에 대한 제안 된 변경 사항은 작동하지만'optimize.jl'에 대한 BFGS에만 해당되며 모든 옵티 마이저의 최종 최적화 상태에 자연스럽게 접근 할 필요가 없습니다. –
마지막 편집은 어떨까요? 의미 : 최적화 후 "상태"에 대한 액세스 권한 부여. – merch
이것은 확실히 Optim에 추가하려는 것입니다. 아무도 패키지의 파일을 편집해야합니다! – pkofod