Граф коммитов

451 Коммитов

Автор SHA1 Сообщение Дата
Andrii Kurdiumov bc953687bf
TestFSharp uses .NET 4.7.2 (#285)
This is required for .NET 5 support as explained at https://github.com/dotnet/fsharp/issues/10009#issuecomment-681019355
2020-09-01 16:22:40 +01:00
Andrii Kurdiumov bd90da2b8b
Update year of copyright (#283) 2020-08-27 15:22:30 +01:00
Andrii Kurdiumov 37ec4b0918
Improve .NET Core detection (#281)
In .NET 5, the framework description string is ".NET 5.0.0" and should not use the CodeDom compiler.
2020-08-27 12:44:37 +01:00
Andrii Kurdiumov 42b560dcbb
Documentation refers to Core 3.1 instead of Core 2.1 (#282) 2020-08-27 12:34:48 +01:00
Tom Minka 6186fff2a6
Better handling of Sequential attribute (#279)
IncrementTransform handles GetJaggedItemsOp and GetDeepJaggedItemsOp.
IndexingTransform gives a warning for unimplemented cases instead of throwing.
Improved code doc for Damp functions.
Changed "#if HAS_BINARY_FORMATTER" to "#if NETFULL"
Removed Assert.Timeout from performance tests
2020-08-26 14:47:32 +01:00
Andrii Kurdiumov 90607a287f
Add configuration required to embedding pictures in the resources (#277)
Uses version 4.6.0 of System.Resources.Extensions as explained at https://github.com/dotnet/msbuild/issues/4704#issuecomment-648967397

Co-authored-by: Tom Minka <8955276+tminka@users.noreply.github.com>
2020-08-25 17:35:52 +01:00
Andrii Kurdiumov 4e2ecb17e9
Put binary formatter usage behind define (#276)
This is required to be able support code on .NET 5.0 where this code would be obsolete.
2020-08-25 16:33:21 +01:00
Andrii Kurdiumov 17fbd5f078
Disable warning using #pragma (#275) 2020-08-25 15:26:06 +01:00
Andrii Kurdiumov 2ebf99a950
Use WindowsDesktop SDK to bring Windows Forms and WPF into project. (#234)
ClickThroughModel can run with .NET core (when explicitly built)
2020-08-24 14:52:30 +01:00
Tom Minka f72fe0f846
Improved accuracy of FastSumOp (#272)
* ModelCompiler.IncludeDebugInformation defaults to false

* Fixed TestFSharp.fsproj
2020-08-22 17:02:25 +01:00
msdmkats 980f1e2513
Fixes for RoslynDeclarationProvider and Conversion.TryFindConversion (#271)
* RoslynDeclarationProvider uses all available source codes
to build the requested type declaration.

* Conversion.TryFindConversion looks for casts defined on the toType as
well.

Co-authored-by: Dmitry Kats <ratkillerx@hotmail.com>
2020-08-13 16:47:59 +01:00
Tom Minka 421507bb6e
Update to xUnit 2.4.1 (#265)
* Update build instructions
2020-07-26 22:07:20 +01:00
Tom Minka 82bfc893ed
Ported tutorial code to Python (#264)
* Added TestPython project.
* TestFSharp exposes xUnit tests.
* Added Invoker.InvokeInstance.  Invoker favors overloads with higher array indexing depth.
* Added EpTests.LinearProgrammingTest.
* Updated FSharp.Core, Msagl
* pr-netcore.yml uses latest version of .NET 3.1 instead of exact version
* UseDotNet task
* Updated versions of YAML tasks
* netcoretest.sh uses "dotnet test"
2020-07-26 07:08:10 +01:00
Tom Minka 032372ce36 StringUtil.EscapeXmlCharacters replaces StringUtil.MethodFullNameToXmlString
Removed Visualizers/Windows/FactorManagerView
Fixed MslTests.MethodOverrideTest
Added MslTests.MethodInAnotherFileTest
2020-07-22 19:43:51 +01:00
Tom Minka b94260d87e Added GammaPowerProductOp_LaplaceTest 2020-07-09 06:24:24 +01:00
Tom Minka dbda600379 MMath.DigammaLookup and MMath.NormalCdfMomentRatioTable are Lazy 2020-07-09 06:24:24 +01:00
Tom Minka 659b224ce7 Avoid overflow 2020-07-07 15:29:20 +01:00
Tom Minka a3af197dd8 InferenceEngine.SaveFactorGraphToFolder uses correct path on Unix 2020-06-18 21:31:12 +01:00
Tom Minka 4f824e4c23
More special functions improvements (#254)
Removed c_digamma_small case from MMath.Digamma
Added tests for MMath.GammaLnSeries and XMinusLog1Plus
GenerateSeries also generates error bounds
Added CheckMathLibraries
2020-05-28 18:32:55 +01:00
msdmkats c6f896cfbf
Special functions improvements (#253)
- Ensured argument consistency in NormalCdfIntegralTest
- Fixed some test values
- Exp-Sinh quadrature in LogisticGaussian
- Arithmetic-precision-based constants in logistic gaussian
- Named const for Ulp(1)
- Generating series for gamma(x) - 1/x
- Fixed integer overflow in BGRat
- GenerateSeries can print arrays of bigfloats.
2020-05-27 18:19:16 +03:00
Tom Minka 804c8cc83d
NormalCdfRatioLn tests work correctly in arbitrary precision (#250) 2020-05-21 12:54:48 +01:00
Tom Minka 9affe7f082
Updated ComputeSpecialFunctionsTestValues.py (#248)
ComputeSpecialFunctionsTestValues.py computes more accurate test values, uses pure mpmath, more reliable quadrature. Computes values for NormalCdfRatioLn. Removed hard-coded cases.
MMath.Log1PlusExp uses a threshold based on machine epsilon.
2020-05-15 22:20:47 +01:00
Tom Minka 8aa4fbf2fc
Moved ExtendedDouble to the Microsoft.ML.Probabilistic.Math namespace (#246)
Added FloatTests
2020-05-12 18:30:49 +01:00
Tom Minka 4a6cbbaf8e
Fixed more corner cases in MMath.LogisticGaussian (#245) 2020-05-08 14:00:47 +01:00
Tom Minka cc60de338b
Fixed MMath.LogisticGaussian corner case (#244) 2020-05-07 01:14:49 +01:00
Tom Minka 268353c5bb
Added Variable.CutForwardWhen, Range.IsIncreasing (#243)
Renamed Factor.Cut to Cut.Backward
Added InferNet.IsIncreasing, IsIncreasingTransform
2020-05-01 11:24:59 +01:00
Ivan Korostelev 09d05e617a
Faithful SetTo for SequenceDistribution (#240)
`SequenceDistribution.SetTo()` called `SetWorkspace` that tried to normalize weight function.
This is not necessary if sequence distribution is set to another valid sequence distribution.
2020-04-28 13:11:39 +01:00
Tom Minka d00ac25426
ChainWithTransitionParameterTest2 uses more iterations when OptimiseInferenceCode=false (#239) 2020-04-24 18:49:45 +01:00
Jonathan Tims 399236c6f9
Allow builds to specialise the package ID of generated Runtime, Visualisers, and Compiler NuGet packages (#236)
This allows you to avoid confusion of private internal versions of these packages, with those on nuget.org or other feeds with other privately build versions.
2020-04-23 20:35:35 +01:00
Jonathan Tims 57621b8089
Move Nightly build on to VS2019 machines (#237)
The Nightly build has been failing because it uses VS2017 hosted machines that can not target the desired version of .NET Core.

Switching to VS2019 machines fixes this issue.
2020-04-20 13:10:43 +01:00
Tom Minka f8cf34f301
Discrete point mass distributions are considered equal whenever their Point properties are equal. (#212)
Added PointMassEstimator.
PointMass overrides Equals.
Observed variables can have query types.
Removed the obsolete Output attribute.
Fixed build order.

Internal compiler changes:
* Added MarginalAnalysisTransform.  VariableTransform, ChannelTransform, Channel2Transform no longer set marginal prototypes.
* VariableInformation can be attached to any declaration, not just variables.
* DeriveArrayVariable does not propagate MarginalPrototype attributes.
* VariableTransform and ChannelTransform create marginal channels for constants and parameters.
* ModelBuilder only attaches sizes to objects assignable from arrays.
* Added ObservedVariableMessages CompilerAttribute.
* Channel2Transform attaches DescriptionAttributes
2020-04-19 16:31:49 +01:00
Ivan Korostelev a1cbadd391
Simplify TryComputePoint() (#229)
Automaton is pointmass if it has only 1 support string.

This implementation is also faster than previous one.
2020-04-14 12:09:38 +01:00
msdmkats 520f5d2767
Special functions testing improvements, NormalCdfLn bugfix. (#233)
- Moved arguments and expected result values for special function tests from inlined code to csv files.
- Added a python script to compute expected result values for tested special functions in high precision.
- Improved accuracy of NormalCdfLn for `x < -8`. Truncated series was too short, test used to pass, because the expected value itself was incorrect.
2020-04-08 18:13:08 +03:00
Tom Minka 911c2d1444
CSharpWriter uses G17 to write doubles and G9 to write singles, for correct round-trip behavior (#235) 2020-04-08 10:44:34 +01:00
Andrey Kurdyumov 27200bd649
Update to .NET Core 3.1 (#232)
* Update to .NET Core 3.1

This update was faily trivial change of project properties with only one caveat
```
error CS0104: 'Range' is an ambiguous reference between 'Microsoft.ML.Probabilistic.Models.Range' and 'System.Range'
```

which require sprinkling everywhere following line of code
```
using Range = Microsoft.ML.Probabilistic.Models.Range;
```

* Update build definition to use more modern images
- Windows 2019 for .NET Core 3.1
- Mac OS 10.14 (Specifically https://docs.microsoft.com/en-us/azure/devops/pipelines/agents/hosted?view=azure-devops)

Co-authored-by: Tom Minka <8955276+tminka@users.noreply.github.com>
2020-04-07 20:30:04 +01:00
Immo Landwerth e39cb5b5f7
Link Code of Conduct (#231) 2020-04-03 16:21:05 +01:00
Tom Minka 46bdd9dc49
More accurate messages for IsBetween, IsPositive, Plus, Max (#230)
* Use g17 when printing doubles
* Re-enabled GammaUpperRegularized tests
* MMath.LargestDoubleSum fix for 32-bit
2020-04-02 19:02:51 +01:00
Michael Roer Pedersen d79edfdf42 ChessAnalysis GenerateData fix 2020-03-30 15:21:53 +01:00
Jonathan Tims 96679cb984
wip (#227) 2020-03-27 10:54:26 +00:00
Jonathan Tims 6e1e72b8bd
wip (#225) 2020-03-22 12:07:59 +00:00
Jonathan Tims 9326f5dc88
Merge pull request #224 from dotnet/jotims/pr/fix-prefix-build
Fix AssemblyNamePrefix usage
2020-03-19 12:04:52 +00:00
Jonathan Tims 57f5a6c7b3
Merge branch 'master' into jotims/pr/fix-prefix-build 2020-03-19 10:32:31 +00:00
Jonathan Tims 205d26f4a1 wip 2020-03-18 23:13:59 +00:00
Ivan Korostelev 7e4ec4dccf
Implement concatenation operation for automata and transudcers (#223)
`AppendInPlace()` is not inplace anymore, it creates a copy of automata under the hood.
This makes calling it repeatedly quite expensive, because runtime will grow quadratically
with the number of calls. This method should be removed in future.

As a replacement a new method is introduced - `Concatenate()` which concatenates multiple
automata/transducers at once. It is significantly faster.
2020-03-17 15:10:40 +00:00
Tom Minka 9b2cbe9619
Improved TruncatedGamma support (#222)
Improved accuracy of TruncatedGamma.GetMeanAndVariance, GetMeanPower, GetNormalizer, Sample
Improved accuracy of Factor.TruncatedGammaFromShapeAndRate
GammaFromShapeAndRateOp_Slow.SampleAverageConditional handles sample=0
GammaFromShapeAndRateOp_Slow.RateAverageConditional handles rate=0
Improved accuracy of MMath.ExpMinus1, Gamma, GammaUpper
Gamma.SetShapeAndScale throws if shape is infinite
Added TruncatedGamma.GetMode
Added MMath.ToStringExact, GammaUpperScale
Changed uses of :r to :g17 numeric format string
MMath.IndexOfMinimum takes IEnumerable
PowerOp supports GammaPower = TruncatedGamma ^ y
2020-03-13 00:28:01 +00:00
Ivan Korostelev 085a5a4675
Remove Owner field from State (#220)
It really is not required - at all points it is known with which automaton we operate right now.

Also, where only state index was needed we store now the int index instead of fat State object
which contains extra information.
2020-03-11 16:28:08 +00:00
Elena Pochernina 7ce78c0e1b
Add GetElementsUntyped (#221)
Add `GetElementsUntyped` method to `ICollectionDistribution` interface to be able to get elements for the collection without knowing of the element type.
2020-03-11 12:00:39 +00:00
John Guiver 683f259277
LogValueOverride in ToString (#219)
* LogValueOverride in ToString

* Add separator
2020-03-04 09:57:35 +00:00
Ivan Korostelev 0c2f2859f5
Improve support enumeration in StringAutomata (#218)
Contracts has been changed: `TryEnumerateSupport()` does not throw if it encounters non-enumerable automata.

- Implementation of `TryEnumerateSupport` was changed a lot:
  - It avoids recursion (and "stacked IEnumerables")
  - An optimization has been added - traversing states with single point-mass forward transition
    (90+% of real-world cases) is cheaper, because it avoids some extra allocations

Also "is enumerable" status is cached. It is set proactively at automaton construction
in 2 common cases which are cheap to detect:
  - automaton with self-loops can not be enumerated
  - automaton with only forward transitions (and thus no loops) can always be enumerated

In all other cases this flag is calculated lazily on first enumeration try.
2020-03-03 20:46:05 +00:00
Ivan Korostelev 7bd784335d
Replace ReadOnlyArray with ImmutableArray look-alike (#217)
`System.Collections.Immutable` has `ImmutableArray` that serves the same purpose as
`ReadOnlyArray` but has different API. This type is available (without extra dependencies)
only in netcore, so can't be used in Infer.NET which has to support netframework.
Until netframework support can be dropped reimplement a subset of `ImmutableArray`
in Infer.NET codebase.
2020-02-29 09:49:41 +00:00