mirror of
https://github.com/furyfire/trueskill.git
synced 2025-04-20 04:44:28 +00:00
Upgrade with rector
This commit is contained in:
@ -9,19 +9,10 @@ use DNW\Skills\Numerics\GaussianDistribution;
|
||||
|
||||
abstract class GaussianFactor extends Factor
|
||||
{
|
||||
protected function __construct($name)
|
||||
{
|
||||
parent::__construct($name);
|
||||
}
|
||||
|
||||
/**
|
||||
* Sends the factor-graph message with and returns the log-normalization constant.
|
||||
*
|
||||
* @param Message $message
|
||||
* @param Variable $variable
|
||||
* @return float|int
|
||||
*/
|
||||
protected function sendMessageVariable(Message $message, Variable $variable)
|
||||
protected function sendMessageVariable(Message $message, Variable $variable): float|int
|
||||
{
|
||||
$marginal = $variable->getValue();
|
||||
$messageValue = $message->getValue();
|
||||
@ -34,11 +25,10 @@ abstract class GaussianFactor extends Factor
|
||||
public function createVariableToMessageBinding(Variable $variable)
|
||||
{
|
||||
$newDistribution = GaussianDistribution::fromPrecisionMean(0, 0);
|
||||
$binding = parent::createVariableToMessageBindingWithMessage($variable,
|
||||
|
||||
return parent::createVariableToMessageBindingWithMessage($variable,
|
||||
new Message(
|
||||
$newDistribution,
|
||||
sprintf('message from %s to %s', $this, $variable)));
|
||||
|
||||
return $binding;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user