machine_learning
machine_learning copied to clipboard
Cost function used in hillclimb.js
Is there a name for the cost function used in the hill-climbing example? I'm talking this:
var costf = function(vec) {
var cost = 0;
for(var i =0; i<14;i++) { // This example is using 15-dimensional input vector.
cost += (0.5*i*vec[i]*Math.exp(-vec[i]+vec[i+1])/vec[i+1])
}
cost += (3.*vec[14]/vec[0]);
return cost; // our goal is finding a vector which makes the cost value minimum.
};