MCPcopy Create free account
hub / github.com/FidoProject/Fido / getReward

Method getReward

src/LSInterpolator.cpp:40–45  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

38}
39
40double LSInterpolator::getReward(const std::vector<Wire> &controlWires, const std::vector<double> &action) {
41 double maxReward = -9999999;
42 for (std::vector<Wire>::const_iterator a = controlWires.begin(); a != controlWires.end(); ++a) if (a->reward > maxReward) maxReward = a->reward;
43
44 return weightedSum(controlWires, action, maxReward) / normalize(controlWires, action, maxReward);
45}
46
47double LSInterpolator::rewardDerivative(const std::vector<double> &action, const Wire &wire, const std::vector<Wire> &controlWires) {
48 double maxReward = -9999999;

Callers 4

trainOnHistoriesMethod · 0.80
getSetOfWiresMethod · 0.80
getQValueMethod · 0.80
newControlWiresMethod · 0.80

Calls 2

beginMethod · 0.80
endMethod · 0.80

Tested by

no test coverage detected