String based "name" for Variable class removed for performance

This commit is contained in:
2024-03-19 15:09:13 +00:00
parent 0095829906
commit ae5d2a8b73
14 changed files with 28 additions and 83 deletions

View File

@ -19,11 +19,11 @@ class GaussianPriorFactor extends GaussianFactor
public function __construct(float $mean, float $variance, Variable $variable)
{
parent::__construct(sprintf('Prior value going to %s', (string)$variable));
parent::__construct('Prior value going to %s');
$this->newMessage = new GaussianDistribution($mean, sqrt($variance));
$newMessage = new Message(
GaussianDistribution::fromPrecisionMean(0, 0),
sprintf('message from %s to %s', (string)$this, (string)$variable)
'message from %s to %s'
);
$this->createVariableToMessageBindingWithMessage($variable, $newMessage);