Get input/output gradient of neural network

16 ビュー (過去 30 日間)
Aaron Kandel
Aaron Kandel 2020 年 9 月 11 日
コメント済み: Ruyue Yang 2021 年 7 月 22 日
Matlab's built in functions in the NN toolbox seem to provide a good set of options for getting the gradient of the network performance wrt the network parameters. Is there a way to get the gradient of the network output with respect to the network input?

回答 (1 件)

Mahesh Taparia
Mahesh Taparia 2020 年 9 月 14 日
Hi
In general, in any neural network, the network tries to learn the weights which can reduce the cost/ loss function. The gradients are updated iteratively by using the derivative of loss function with respect to weights.
Usually for a fix input, calculating gradients of loss with respect to input is not meaningful because if input is fix, then d(loss)/d(Input) is not defined. If the network is feed with 2 different input sequence, in this case you can find the gradient by calculating (Loss2-Loss1)/(X2-X1), where Loss is the value of network loss with respect to input X. There is no use of this while training the network.
Hope it will helps!
  6 件のコメント
David Leather
David Leather 2020 年 11 月 24 日
編集済み: David Leather 2020 年 11 月 24 日
This seems like an oversight. When applying the trained neural network to other applications, it is essential to be able to evaluate the gradient wrt to the output of the neural network, and not the loss function....
Ruyue Yang
Ruyue Yang 2021 年 7 月 22 日
Get the gradient dy/dx can be really trick for the trained multi-layer neural network (not that deep, maybe 3 or 4 layer). Such function can help a lot for the network's various application.

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeSequence and Numeric Feature Data Workflows についてさらに検索

製品


リリース

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by