public void ReturnTrueIfFirstVectorIsKnown() { var bcmModel = new BcmModel(); var threshold = 2; bcmModel.Teach(_firstVector); bcmModel.Teach(_secondVector); bcmModel.Test(_firstVector, threshold).Should().BeTrue(); }
public void ReturnFalseIfVectorIsNotKnown() { var bcmModel = new BcmModel(); var threshold = 2; var unknownVector = Vector <float> .Build.DenseOfArray(new[] { 1f, 1, 1, 1, 0, 0 }); bcmModel.Teach(_firstVector); bcmModel.Teach(_secondVector); bcmModel.Test(unknownVector, threshold).Should().BeFalse(); }
public void TestMethodShouldThrowExceptionIfVectorHaveDifferentLength() { var bcmModel = new BcmModel(); var threshold = 2; var vectorWithOtherLength = Vector <float> .Build.Dense(8); bcmModel.Teach(_firstVector); bcmModel.Teach(_secondVector); Action testingWithDifferentLengths = () => bcmModel.Test(vectorWithOtherLength, threshold); testingWithDifferentLengths.ShouldThrow <ArgumentException>(); }