MATLAB Answers

How to train neural network using newff with a custom loss function?

24 views (last 30 days)
Rah Yoonhyuk
Rah Yoonhyuk on 4 Feb 2020
Answered: Hiro Yoshino on 4 Feb 2020
I want to train a neural network (f) with input A and output B. I want to train it with the loss function between g(f(A)) and C where g is a pre-trained neural network. C is another data set. How can I use a custom loss function? Are there any other functions other than newff? Below is my code (very simple)
net = newff(minmax(A),[10,51],{'logsig','purelin','trainlm'});
net.trainparam.goal = 0;
net.trainparam.lr = 0.01;
net = train(net, A, B);

  0 Comments

Sign in to comment.

Sign in to answer this question.

Products


Release

R2019a

Translated by