- Suppose input data x = linspace(0,1,100). Use following to train network:
How can I specify custom data and a custom loss function?
20 ビュー (過去 30 日間)
古いコメントを表示
Hi,
I would like to program a physics-informed neural network (I have attached the paper introducing them). It can be used to solve partial differential equations with given initial and boundary data. Therefore, I need to do two things:
1. I have to manually generate the input data. In Matlab it is very easy, e.g. x = linspace(0, 1, 100). How can I transfer that data as training data to the neural net?
2. I have to manually specify a loss function. More specifically, the loss function is the differential equation and the initial/boundary conditions.
So, I would like to solve the steady-state heat-diffusion equation: d^2T/dx^2 = 5 with T(0) = 0 and T(1) = 3
How can I program this into Matlab?
0 件のコメント
回答 (1 件)
Anshika Chaurasia
2020 年 8 月 31 日
Hi Marius,
It is my understanding that input data is defined manually in form of vector.
x = linspace(0,1,100);
net = train(net,x,t);
2. Define custom loss function in following way:
loss = CustomLoss(Y,T);%where Y is the network predictions, T are the targets,
% and loss is the returned loss.
Refer to specify loss function and GAN loss example documentations for specifying custom loss functions.
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Sequence and Numeric Feature Data Workflows についてさらに検索
製品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!