I want to train a shallow neural network using known output gradients rather than input/output training pair data

1 回表示 (過去 30 日間)
James
James 2022 年 7 月 19 日
回答済み: arushi 2024 年 8 月 27 日
I have a shallow network defined by:
net = fitnet([64,112],'traingd');
The outputs of this network feed INTO a function Y = f(X) where X is the vector of net outputs X=net(I).
I calculate the gradient of Y w.r.t X and want to then train net based on these gradients rather than input/output data for the net.

回答 (1 件)

arushi
arushi 2024 年 8 月 27 日
Hi James,
I understand that you are trying to train a shallow neural network using the known output gradients.
To train a shallow neural network using known output gradients, you can follow these steps:
  1. Initialize your shallow neural network with the desired architecture.
  2. Define your function Y = f(X) that takes the network outputs X as input and produces the desired output Y. This function represents the relationship between the network outputs and the target outputs.
  3. Calculate the gradient of Y with respect to X.
  4. Use the calculated gradients to update the network weights using gradient descent or another suitable optimization algorithm.
For additional information, please refer to the following documentation:
I hope this helps!

カテゴリ

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

製品


リリース

R2022a

Community Treasure Hunt

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

Start Hunting!

Translated by