Skip to content

Commit

Permalink
TOTUNE: Evaluation of hypotheses
Browse files Browse the repository at this point in the history
  • Loading branch information
claudio-db committed Jan 30, 2014
1 parent 5dac511 commit 40ffbc5
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
7 changes: 5 additions & 2 deletions machineLearning/DiveHandler/DiveHandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,10 @@ float DiveHandler::PGLearner::evaluatePerturbation( std::vector<float> R )
assert(R.size() == coeffs.size());
// Generate perturbated policy and call the DiveHandler object for evaluation
float tDiveAndRecover = diveHandler_ptr->computeDiveAndRecoverTime(coeffs.at(0) + R.at(0), coeffs.at(1) + R.at(1));
return LAMBDA*fabs(tDiveAndRecover) + (1-LAMBDA)*fabs(diveHandler_ptr->tBall2Goal - tDiveAndRecover);

return (1.0-LAMBDA1-LAMBDA2)*fabs(tDiveAndRecover) +
LAMBDA1*fabs(diveHandler_ptr->tBall2Goal - tDiveAndRecover) +
LAMBDA2*fabs(1.0 - ((coeffs.at(0) + R.at(0))+(coeffs.at(1) + R.at(1))));
}


Expand All @@ -260,7 +263,7 @@ void DiveHandler::PGLearner::updateParams(const std::list<float>& rewards)
reward_score += (*i) * pow(GAMMA, discount_exp);
++i; ++discount_exp;
}
positivesWeight = static_cast<float>(positives)/rewards.size();
positivesWeight = (POSITIVE_REWARD*static_cast<float>(positives))/(positives*POSITIVE_REWARD + (rewards.size()-positives)*fabs(NEGATIVE_REWARD));

#ifdef DIVEHANDLER_TRAINING_DEBUG
SPQR_INFO("Positive rewards: " << positives << " out of " << rewards.size());
Expand Down
3 changes: 2 additions & 1 deletion machineLearning/DiveHandler/DiveHandler.h
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,8 @@ END_MODULE
#define EPSILON 0.15
#define T 15
// Evaluation weight
#define LAMBDA 0.15
#define LAMBDA1 0.6
#define LAMBDA2 0.3


// Module class declaration
Expand Down

0 comments on commit 40ffbc5

Please sign in to comment.