Skip to content

Cost function used in hillclimb.js #10

@mykeels

Description

@mykeels

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.
};

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions