Custom loss function with LSTM for Physics Informed Machine Learning
35 次查看(过去 30 天)
显示 更早的评论
I want to train a LSTM model to prdict time history response of a dynamical system. I have defined a physics based loss function in a matlab code (.m file). I would like to include this function as the loss function in model training along with the standard RMSE. Is this possible using Matlab's Deep Learning Toolbox?
0 个评论
采纳的回答
Ranjeet
2023-5-8
To use a custom loss function, a custom layer can be created by following the documentation below, it has templates for defining an intermediate and final layer as well.
An LSTM specific example can be referred from the following answer and adapted for your use case:
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Build Deep Neural Networks 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!