- "Y": Array of predictions.
- "T": Array of target values.
How to load value from deep learning experiment to custom metric
3 views (last 30 days)
Show older comments
I'm attending a course about machine learning and I'm new to matlab. I've been working on a regression project that need Evaluate deep learning experiment by metric funtion , however I can't load the value from Experiment to other.Is there any way to recall the value or set the default to custom metric?
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/945514/image.png)
0 Comments
Answers (1)
Avadhoot
on 27 Sep 2023
Hi William,
Since you have already written the metric function you want to use, you can pass the function handle to the "metrics" option in the input arguments of the "trainingOptions" function. Here's an example of how to do it:
function metricOutput = metric1(testY, predY)
% Perform the evaluation of custom metric
% You can implement your custom function here
metricOutput = sqrt(mean((testY – predY).^2));
end
While specifying the input parameters for "trainingOptions", include the following line in your code:
trainingOptions("sgdm", ...
Metrics=@metricOutput)
Make sure to specify the inputs to the metric function correctly. There should be two inputs: "Y" and "T". The contents of the inputs should be as follows:
Note that the prediction part should not be done inside the metric function.
For more information about custom metric functions refer to the following link:
To understand how the “Metrics” parameter is used in “trainingOptions” follow the link below:
I hope it helps.
Regards,
Avadhoot.
0 Comments
See Also
Categories
Find more on Image Data Workflows in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!