Automatic Differentiation for gamma and psi functions

조회 수: 4 (최근 30일)
Frantisek Gaspar
Frantisek Gaspar 2020년 11월 29일
댓글: Frantisek Gaspar 2024년 2월 21일
Is there a way to make automatic differentiation work with MATLAB functions gamma and psi? I can use equivalent custom functions but it is not quite as elegant.
I am using automatic differentiation equivalent to rosenbrock example in https://www.mathworks.com/help/deeplearning/ug/include-automatic-differentiation.html. When I try to use gamma function of psi function in the differentiated function the code ends with error that dlarray is not supported input for the gamma and/or psi function.
If the psi and gamma are just not supported can you recomend a place where I can angrily write that MATLAB is basicaly unsable and ask for this feature to be in the new update? :D

채택된 답변

Aditya Patil
Aditya Patil 2020년 12월 23일
Currently, dlarray support is not available for gamma and psi. I have brought your request to the notice of concerned people. As a workaround, you can write a function that implements the aforementioned functions using other functions that have dlarray support.
In general, to request any new features, see How can I make a features request?
  댓글 수: 3
Torsten
Torsten 2023년 12월 18일
I don't understand why automatic differentiation is needed although there are custom MATLAB functions for the derivatives of gamma and polygamma.
Frantisek Gaspar
Frantisek Gaspar 2024년 2월 21일
Function exp has derivative available, but also can be called with dlarrays. The goal of automatic differenciation is to obtain derivative of any normal function without the need to analyticaly derive it. If any function called within your function does not support dlarrays, like gamma, the process fails.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Special Functions에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by