Why do I get "Encountered complex value" error when training a custom network with the "fft" function?
Show older comments
I'm training a neural network with "fullyConnectedLayer" and a custom loss function that has the "fft" function. "fft" should be supported for "dlarray" operations, but when I call the "dlgradient" function to calculate the gradients, I get an error:
Error using dlarray/dlgradient
Encountered complex value when computing gradient with respect to an output of fullyconnect. Convert all outputs of fullyconnect to real.
Accepted Answer
More Answers (0)
Categories
Find more on Custom Training Using Automatic Differentiation in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!