| Products & Services | Solutions | Academia | Support | User Community | Company |
| Download Product Updates | | | Get Pricing | | | Trial Software |
| Documentation → Neural Network Toolbox |
| Contents | Index |
Calculate weight and bias performance gradient as single vector
This function calculates the gradient of a network's performance with respect to its vector of weight and bias values X.
If the network has no layer delays with taps greater than 0, the result is the true gradient.
If the network has layer delays greater than 0, the result is the Elman gradient, an approximation of the true gradient.
[gX,normgX] = calcgx(net,X,Pd,BZ,IWZ,LWZ,N,Ac,El,perf,Q,TS) takes
| gX |
Gradient dPerf/dX |
| normgX |
Norm of gradient |
Here is a linear network with a single input element ranging from 0 to 1, two neurons, and a tap delay on the input with taps at 0, 2, and 4 time steps. The network is also given a recurrent connection from layer 1 to itself with tap delays of [1 2].
Here is a single (Q = 1) input sequence P with five time steps (TS = 5), and the four initial input delay conditions Pi, combined inputs Pc, and delayed inputs Pd.
Here the two initial layer delay conditions for each of the two neurons and the layer targets for the two neurons over five time steps are defined.
Here the network's weight and bias values are extracted, and the network's performance and other signals are calculated.
Finally you can use calcgz to calculate the gradient of performance with respect to the weight and bias values X.
| Provide feedback about this page |
![]() | boxdist | calcjejj | ![]() |

Includes the most popular MATLAB recorded presentations with Q&A sessions led by MATLAB experts.
| © 1984-2009- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |