Failed to using syntax 'genFunction' to simulate
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
Tien Tran
am 11 Apr. 2016
Beantwortet: Walter Roberson
am 11 Apr. 2016
- I have trained a ANN, then using 'genFunction' to create a function file.m named 'netFcn'. However, I have not yet understood about syntax of function: netFcn(X,~,~).
- For example: input = [-0.993243243243243;-1] ; target = [-0.148851286284220]
- the result ANN trained from this input is: output = [-0.138566963076372]
- while using syntax : netFcn(-0.993243243243243,-1) = -0.131790888633589Why it is different with the output of ANN ? How to use a syntax netFcn(X,~,~) to predict correctly?
0 Kommentare
Akzeptierte Antwort
Walter Roberson
am 11 Apr. 2016
The syntax
function result = netFcn(X,~,~)
means that netFcn expects three inputs to be passed in, but that it is going to ignore the second and third inputs.
The syntax
netFcn(-0.993243243243243,-1)
passes in the scalar -0.993243243243243 as the argument X to netFcn, and passes the scalar -1 as an additional parameter that netFcn is going to ignore. This is not the same as
input = [-0.993243243243243;-1]
for your training, because that input is a vector of two values, not a scalar. The equivalent would be
netFcn([-0.993243243243243;-1])
0 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Statistics and Machine Learning Toolbox finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!