这是indexloc提供的服务,不要输入任何密码
Skip to content

Conversation

@jsboige
Copy link

@jsboige jsboige commented Nov 5, 2020

No description provided.

lazy and others added 30 commits February 29, 2020 09:49
`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.
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.
* LogValueOverride in ToString

* Add separator
Add `GetElementsUntyped` method to `ICollectionDistribution` interface to be able to get elements for the collection without knowing of the element type.
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.
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
`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.
* Use g17 when printing doubles
* Re-enabled GammaUpperRegularized tests
* MMath.LargestDoubleSum fix for 32-bit
* 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>
- 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.
Automaton is pointmass if it has only 1 support string.

This implementation is also faster than previous one.
… 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
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.
…lisers, 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.
`SequenceDistribution.SetTo()` called `SetWorkspace` that tried to normalize weight function.
This is not necessary if sequence distribution is set to another valid sequence distribution.
Renamed Factor.Cut to Cut.Backward
Added InferNet.IsIncreasing, IsIncreasingTransform
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.
msdmkats and others added 28 commits May 27, 2020 18:19
- 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.
Removed c_digamma_small case from MMath.Digamma
Added tests for MMath.GammaLnSeries and XMinusLog1Plus
GenerateSeries also generates error bounds
Added CheckMathLibraries
…lString

Removed Visualizers/Windows/FactorManagerView
Fixed MslTests.MethodOverrideTest
Added MslTests.MethodInAnotherFileTest
* 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"
* Update build instructions
…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>
* ModelCompiler.IncludeDebugInformation defaults to false

* Fixed TestFSharp.fsproj
…234)

ClickThroughModel can run with .NET core (when explicitly built)
This is required to be able support code on .NET 5.0 where this code would be obsolete.
Uses version 4.6.0 of System.Resources.Extensions as explained at dotnet/msbuild#4704 (comment)

Co-authored-by: Tom Minka <8955276+tminka@users.noreply.github.com>
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
In .NET 5, the framework description string is ".NET 5.0.0" and should not use the CodeDom compiler.
This is required for .NET 5 support as explained at dotnet/fsharp#10009 (comment)
* Add more generated files to exclusion list
* RobustGaussianProcess uses OxyPlot.Wpf only on Windows

Co-authored-by: Tom Minka <8955276+tminka@users.noreply.github.com>
* Removed references to NETFULL.
* Don't define NET45.
* Don't define NETCORE, NETSTANDARD, or NETSTANDARD2_0
* Added Matrix.FromDiagonal
* Fix long overflow in OperatorTests.Longs()

* Fixed printing big float arrays, extended series for ((exp(x) - 1) / x - 1) - 0.5

* GammaPower.GetLogProb uses ulp-based threshold

* Moved a constant for maximum terms in NormalCdfMomentRatio outside of method body

* Separate methods for Previous/NextDoubleWithPositiveDifference

* More magic constants replaced with ulp-based ones

* Fixed abs value comparison in GammaPower.GetLogProb

* Ulp-based constatnts in IsBetween.XAverageConditional

* Moved the definitions of Ulp1-dependant constants below that of Ulp1

* Replaced  <= in GammaPower with a < as it used to be

Co-authored-by: Dmitry Kats <ratkillerx@hotmail.com>
* Tests use Assert.Throws instead of try/catch

* Test output is less verbose

* Added SimplestBackwardChainTest3

* Fixed IterativeProcessTransform when variable has QueryTypes.MarginalDividedByPrior and ConstrainEqualRandom(variable, observed)

* Discrete allows Dimension=0
This allows QuantileEstimator to produce the same result even if it is serialized/deserialized in the middle.
* Improved accuracy of Gamma.FromMeanAndMeanLog, ExpOp, PlusGammaOp, PlusGammaVmpOp
* Fixed GammaPower.SetMeanAndVariance for infinite variance
* TruncatedGamma implements CanGetQuantile
* TruncatedGamma.Sample is faster when shape==1
* Extracted PlusWrappedGaussianOp and PlusTruncatedGaussianOp from PlusDoubleOp
* Gamma.FromMeanAndMeanLog takes an optimal logMean argument.  Removed Gamma.FromLogMeanAndMeanLog.
* Improved accuracy of GammaPower.FromMeanAndMeanLog.
* ExpOp supports GammaPower output.
@jsboige jsboige merged commit cca9914 into MyIntelligenceAgency:master Nov 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants