mirror of
https://github.com/furyfire/trueskill.git
synced 2025-01-16 01:47:39 +00:00
Checkpoint before another reference pass
This commit is contained in:
@ -49,8 +49,8 @@ abstract class Factor
|
|||||||
public function updateMessageIndex($messageIndex)
|
public function updateMessageIndex($messageIndex)
|
||||||
{
|
{
|
||||||
Guard::argumentIsValidIndex($messageIndex, count($this->_messages), "messageIndex");
|
Guard::argumentIsValidIndex($messageIndex, count($this->_messages), "messageIndex");
|
||||||
$message = $this->_messages[$messageIndex];
|
$message = &$this->_messages[$messageIndex];
|
||||||
$variable = $this->_messageToVariableBinding->getValue($this->_messages[$messageIndex]);
|
$variable = &$this->_messageToVariableBinding->getValue($this->_messages[$messageIndex]);
|
||||||
return $this->updateMessageVariable($message, $variable);
|
return $this->updateMessageVariable($message, $variable);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -58,7 +58,7 @@ class GaussianGreaterThanFactor extends GaussianFactor
|
|||||||
$epsilsonTimesSqrtC = $this->_epsilon*$sqrtC;
|
$epsilsonTimesSqrtC = $this->_epsilon*$sqrtC;
|
||||||
$d = $messageFromVar->getPrecisionMean();
|
$d = $messageFromVar->getPrecisionMean();
|
||||||
|
|
||||||
$denom = 1.0 - TruncatedGaussianCorrectionFunctions::vExceedsMargin($dOnSqrtC, $epsilsonTimesSqrtC);
|
$denom = 1.0 - TruncatedGaussianCorrectionFunctions::wExceedsMargin($dOnSqrtC, $epsilsonTimesSqrtC);
|
||||||
|
|
||||||
$newPrecision = $c/$denom;
|
$newPrecision = $c/$denom;
|
||||||
$newPrecisionMean = ($d +
|
$newPrecisionMean = ($d +
|
||||||
|
@ -218,8 +218,8 @@ class GaussianWeightedSumFactor extends GaussianFactor
|
|||||||
$allMessagesCount = count($allMessages);
|
$allMessagesCount = count($allMessages);
|
||||||
for ($i = 0; $i < $allMessagesCount; $i++)
|
for ($i = 0; $i < $allMessagesCount; $i++)
|
||||||
{
|
{
|
||||||
$updatedMessages[] =$allMessages[$indicesToUse[$i]];
|
$updatedMessages[] = &$allMessages[$indicesToUse[$i]];
|
||||||
$updatedVariables[] = $allVariables[$indicesToUse[$i]];
|
$updatedVariables[] = &$allVariables[$indicesToUse[$i]];
|
||||||
}
|
}
|
||||||
|
|
||||||
return $this->updateHelper($this->_weights[$messageIndex],
|
return $this->updateHelper($this->_weights[$messageIndex],
|
||||||
|
Reference in New Issue
Block a user