goodcoffeecode posted on 11-05-2010 3:53 AM
http://research.microsoft.com/en-us/um/cambridge/projects/infernet/docs/Bayes%20Point%20Machine%20tutorial.aspx
This example produces exceptions when using the latest version of the Infer.Net libraries (v.2.4). Initially the following line throws a compilation exception...
Variable<Vector> w = Variable.Random(new VectorGaussian(new Vector(3), PositiveDefiniteMatrix.Identity(3))).Named("w");
and needs to be changed to
Variable<Vector> w = Variable.Random(new VectorGaussian(Vector.Zero(3), PositiveDefiniteMatrix.Identity(3))).Named("w");
This then generates the following runtime exception:
Test method InferenceTests.UnitTest1.Test2 threw exception:
System.ArgumentException: VariableArray<Vector> x cannot be indexed by index1. Perhaps you omitted index1 as an argument to the constructor?
Parameter name: index
MicrosoftResearch.Infer.Models.Range.CheckCompatible(IModelExpression index, IVariableArray array) in C:\infernetBuilds\29-10-2010_16-40\Compiler\Infer\Models\Range.cs: line 219
MicrosoftResearch.Infer.Models.VariableArrayBase`2.GetItem(VariableArrayBase`2 array, TItem itemPrototype, IModelExpression[] index) in C:\infernetBuilds\29-10-2010_16-40\Compiler\Infer\Models\VariableArrayBase.cs: line 129
MicrosoftResearch.Infer.Models.VariableArrayBase`2.get_Item(IModelExpression[] index) in C:\infernetBuilds\29-10-2010_16-40\Compiler\Infer\Models\VariableArrayBase.cs: line 91
MicrosoftResearch.Infer.Models.VariableArray`2.get_Item(Range range) in C:\infernetBuilds\29-10-2010_16-40\Compiler\Infer\Models\VariableArray.cs: line 62
InferenceTests.UnitTest1.Test2() in c:\Code\InferenceTests\UnitTest1.cs: line 51
Hoping someone can suggest a fix for this please.
Thanks, Chris