зеркало из https://github.com/dotnet/infer.git
This commit is contained in:
Родитель
a4f7e2a4b8
Коммит
c16210c4c3
|
@ -42,10 +42,10 @@
|
|||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Condition="$(DefineConstants.Contains('ROSLYN'))" Include="Microsoft.CodeAnalysis.CSharp" Version="2.10.0" />
|
||||
<PackageReference Include="System.Reflection.Emit" Version="4.3.0" />
|
||||
<PackageReference Include="System.Reflection.Emit.Lightweight" Version="4.3.0" />
|
||||
<PackageReference Condition="$(DefineConstants.Contains('CODEDOM'))" Include="System.CodeDom" Version="4.4.0" />
|
||||
<PackageReference Condition="$(DefineConstants.Contains('ROSLYN'))" Include="Microsoft.CodeAnalysis.CSharp" Version="*" />
|
||||
<PackageReference Include="System.Reflection.Emit" Version="*" />
|
||||
<PackageReference Include="System.Reflection.Emit.Lightweight" Version="*" />
|
||||
<PackageReference Condition="$(DefineConstants.Contains('CODEDOM'))" Include="System.CodeDom" Version="*" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
@ -59,4 +59,4 @@
|
|||
<Compile Include="..\Shared\SharedAssemblyFileVersion.cs" />
|
||||
<Compile Include="..\Shared\SharedAssemblyInfo.cs" />
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
<PropertyGroup><WarningLevel>0</WarningLevel><TagForRemoval>1</TagForRemoval></PropertyGroup></Project>
|
||||
|
|
|
@ -154,9 +154,9 @@ namespace Microsoft.ML.Probabilistic.Models
|
|||
public interface HasRange
|
||||
{
|
||||
/// <summary>
|
||||
/// The Range being looped over.
|
||||
/// The Microsoft.ML.Probabilistic.Models.Range being looped over.
|
||||
/// </summary>
|
||||
Range Range { get; }
|
||||
Microsoft.ML.Probabilistic.Models.Range Range { get; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
@ -165,14 +165,14 @@ namespace Microsoft.ML.Probabilistic.Models
|
|||
public class ForEachBlock : StatementBlock, HasRange
|
||||
{
|
||||
/// <summary>
|
||||
/// Range associated with the 'for each' block
|
||||
/// Microsoft.ML.Probabilistic.Models.Range associated with the 'for each' block
|
||||
/// </summary>
|
||||
protected Range range;
|
||||
protected Microsoft.ML.Probabilistic.Models.Range range;
|
||||
|
||||
/// <summary>
|
||||
/// Range associated with the 'for each' block
|
||||
/// Microsoft.ML.Probabilistic.Models.Range associated with the 'for each' block
|
||||
/// </summary>
|
||||
public Range Range
|
||||
public Microsoft.ML.Probabilistic.Models.Range Range
|
||||
{
|
||||
get { return range; }
|
||||
}
|
||||
|
@ -186,7 +186,7 @@ namespace Microsoft.ML.Probabilistic.Models
|
|||
/// Constructs 'for each' block from a range
|
||||
/// </summary>
|
||||
/// <param name="range">The range</param>
|
||||
public ForEachBlock(Range range)
|
||||
public ForEachBlock(Microsoft.ML.Probabilistic.Models.Range range)
|
||||
{
|
||||
this.range = range;
|
||||
OpenBlock();
|
||||
|
@ -202,7 +202,7 @@ namespace Microsoft.ML.Probabilistic.Models
|
|||
return "ForEach(" + range + ")";
|
||||
}
|
||||
|
||||
internal static void CheckRangeCanBeOpened(Range range)
|
||||
internal static void CheckRangeCanBeOpened(Microsoft.ML.Probabilistic.Models.Range range)
|
||||
{
|
||||
// check that all ranges in Range.Size are already opened.
|
||||
Set<Range> openRanges = new Set<Range>();
|
||||
|
@ -215,7 +215,7 @@ namespace Microsoft.ML.Probabilistic.Models
|
|||
throw new InvalidOperationException("Range '" + range + "' is already open in a ForEach or Switch block");
|
||||
}
|
||||
Models.MethodInvoke.ForEachRange(range.Size,
|
||||
delegate(Range r)
|
||||
delegate(Microsoft.ML.Probabilistic.Models.Range r)
|
||||
{
|
||||
if (!openRanges.Contains(r))
|
||||
throw new InvalidOperationException("Range '" + range + "' depends on range '" + r + "', but range '" + r +
|
||||
|
@ -378,7 +378,7 @@ namespace Microsoft.ML.Probabilistic.Models
|
|||
openRanges.Add(fb.Range);
|
||||
}
|
||||
Models.MethodInvoke.ForEachRange(conditionVariable,
|
||||
delegate(Range r)
|
||||
delegate(Microsoft.ML.Probabilistic.Models.Range r)
|
||||
{
|
||||
if (!openRanges.Contains(r))
|
||||
throw new InvalidOperationException(conditionVariable + " depends on range '" + r + "', but range '" + r +
|
||||
|
@ -500,9 +500,9 @@ namespace Microsoft.ML.Probabilistic.Models
|
|||
/// </summary>
|
||||
private static CodeBuilder Builder = CodeBuilder.Instance;
|
||||
|
||||
private Range range;
|
||||
private Microsoft.ML.Probabilistic.Models.Range range;
|
||||
|
||||
internal SwitchBlock(Variable<int> conditionVariable, Range range)
|
||||
internal SwitchBlock(Variable<int> conditionVariable, Microsoft.ML.Probabilistic.Models.Range range)
|
||||
: base(conditionVariable, -1, false)
|
||||
{
|
||||
this.range = range;
|
||||
|
@ -521,7 +521,7 @@ namespace Microsoft.ML.Probabilistic.Models
|
|||
/// <summary>
|
||||
/// Get switch block's range
|
||||
/// </summary>
|
||||
public Range Range
|
||||
public Microsoft.ML.Probabilistic.Models.Range Range
|
||||
{
|
||||
get { return range; }
|
||||
}
|
||||
|
|
|
@ -267,7 +267,7 @@ namespace Microsoft.ML.Probabilistic.Models
|
|||
List<Range> ranges = new List<Range>();
|
||||
foreach (IModelExpression arg in ReturnValueAndArgs())
|
||||
{
|
||||
ForEachRange(arg, delegate(Range r) { if (!ranges.Contains(r)) ranges.Add(r); });
|
||||
ForEachRange(arg, delegate(Microsoft.ML.Probabilistic.Models.Range r) { if (!ranges.Contains(r)) ranges.Add(r); });
|
||||
}
|
||||
foreach (IStatementBlock b in Containers)
|
||||
{
|
||||
|
@ -281,7 +281,7 @@ namespace Microsoft.ML.Probabilistic.Models
|
|||
|
||||
internal static void ForEachRange(IModelExpression arg, Action<Range> action)
|
||||
{
|
||||
if (arg is Range range)
|
||||
if (arg is Microsoft.ML.Probabilistic.Models.Range range)
|
||||
{
|
||||
action(range);
|
||||
return;
|
||||
|
@ -305,7 +305,7 @@ namespace Microsoft.ML.Probabilistic.Models
|
|||
}
|
||||
|
||||
/// <summary>
|
||||
/// Get a dictionary mapping all array indexer expressions (including sub-expressions) to a list of their Range indexes, in order.
|
||||
/// Get a dictionary mapping all array indexer expressions (including sub-expressions) to a list of their Microsoft.ML.Probabilistic.Models.Range indexes, in order.
|
||||
/// </summary>
|
||||
/// <param name="args"></param>
|
||||
/// <returns></returns>
|
||||
|
@ -321,7 +321,7 @@ namespace Microsoft.ML.Probabilistic.Models
|
|||
}
|
||||
|
||||
/// <summary>
|
||||
/// If arg is an array indexer expression, get a list of all Range indexes, in order. Indexes that are not Ranges instead get their Ranges added to dict.
|
||||
/// If arg is an array indexer expression, get a list of all Microsoft.ML.Probabilistic.Models.Range indexes, in order. Indexes that are not Ranges instead get their Ranges added to dict.
|
||||
/// </summary>
|
||||
/// <param name="arg"></param>
|
||||
/// <param name="dict"></param>
|
||||
|
@ -337,7 +337,7 @@ namespace Microsoft.ML.Probabilistic.Models
|
|||
// must add item indices after array's indices
|
||||
foreach (IModelExpression expr in v.indices)
|
||||
{
|
||||
if (expr is Range range) indices.Add(range);
|
||||
if (expr is Microsoft.ML.Probabilistic.Models.Range range) indices.Add(range);
|
||||
else
|
||||
{
|
||||
List<List<Range>> argBrackets = GetRangeBrackets(expr, dict);
|
||||
|
@ -351,7 +351,7 @@ namespace Microsoft.ML.Probabilistic.Models
|
|||
return new List<List<Range>>();
|
||||
}
|
||||
|
||||
internal static int CompareRanges(IDictionary<IModelExpression, List<List<Range>>> dict, Range a, Range b)
|
||||
internal static int CompareRanges(IDictionary<IModelExpression, List<List<Range>>> dict, Microsoft.ML.Probabilistic.Models.Range a, Microsoft.ML.Probabilistic.Models.Range b)
|
||||
{
|
||||
foreach (List<List<Range>> brackets in dict.Values)
|
||||
{
|
||||
|
@ -361,7 +361,7 @@ namespace Microsoft.ML.Probabilistic.Models
|
|||
{
|
||||
bool aInThisBracket = false;
|
||||
bool bInThisBracket = false;
|
||||
foreach (Range range in bracket)
|
||||
foreach (Microsoft.ML.Probabilistic.Models.Range range in bracket)
|
||||
{
|
||||
if (range == a) aInThisBracket = true;
|
||||
if (range == b) bInThisBracket = true;
|
||||
|
@ -385,7 +385,7 @@ namespace Microsoft.ML.Probabilistic.Models
|
|||
{
|
||||
Set<Range> argRanges = new Set<Range>();
|
||||
ForEachRange(arg, argRanges.Add);
|
||||
foreach (Range r in ranges)
|
||||
foreach (Microsoft.ML.Probabilistic.Models.Range r in ranges)
|
||||
{
|
||||
if (!argRanges.Contains(r)) return false;
|
||||
}
|
||||
|
|
|
@ -19,13 +19,13 @@ namespace Microsoft.ML.Probabilistic.Models.Attributes
|
|||
/// <summary>
|
||||
/// The range indicating the values a variable can take or the dimension of the variable.
|
||||
/// </summary>
|
||||
public Range Range;
|
||||
public Microsoft.ML.Probabilistic.Models.Range Range;
|
||||
|
||||
/// <summary>
|
||||
/// Creates a ValueRange with the specified range.
|
||||
/// </summary>
|
||||
/// <param name="range"></param>
|
||||
public ValueRange(Range range)
|
||||
public ValueRange(Microsoft.ML.Probabilistic.Models.Range range)
|
||||
{
|
||||
this.Range = range;
|
||||
}
|
||||
|
@ -36,7 +36,7 @@ namespace Microsoft.ML.Probabilistic.Models.Attributes
|
|||
/// <returns></returns>
|
||||
public override string ToString()
|
||||
{
|
||||
return "ValueRange(" + Range + ")";
|
||||
return "ValueRange(" + this.Range + ")";
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -84,7 +84,7 @@ namespace Microsoft.ML.Probabilistic.Models.Attributes
|
|||
public class Sequential : ICompilerAttribute
|
||||
{
|
||||
/// <summary>
|
||||
/// If true, the Range will be iterated both forward and backward, with sequential updates in each direction. Otherwise, the Range will only be iterated in the forward direction.
|
||||
/// If true, the Microsoft.ML.Probabilistic.Models.Range will be iterated both forward and backward, with sequential updates in each direction. Otherwise, the Microsoft.ML.Probabilistic.Models.Range will only be iterated in the forward direction.
|
||||
/// </summary>
|
||||
public bool BackwardPass;
|
||||
}
|
||||
|
|
|
@ -244,7 +244,7 @@ namespace Microsoft.ML.Probabilistic.Models
|
|||
SearchMethodInvoke(methodInvoke);
|
||||
return;
|
||||
}
|
||||
if (expr is Range range)
|
||||
if (expr is Microsoft.ML.Probabilistic.Models.Range range)
|
||||
{
|
||||
SearchRange(range);
|
||||
return;
|
||||
|
@ -305,7 +305,7 @@ namespace Microsoft.ML.Probabilistic.Models
|
|||
foreach (IModelExpression arg in method.ReturnValueAndArgs())
|
||||
{
|
||||
MethodInvoke.ForEachRange(arg,
|
||||
delegate (Range r) { if (!localRanges.Contains(r)) localRanges.Add(r); });
|
||||
delegate (Microsoft.ML.Probabilistic.Models.Range r) { if (!localRanges.Contains(r)) localRanges.Add(r); });
|
||||
}
|
||||
ParameterInfo[] pis = method.method.GetParameters();
|
||||
for (int i = 0; i < pis.Length; i++)
|
||||
|
@ -326,7 +326,7 @@ namespace Microsoft.ML.Probabilistic.Models
|
|||
localRanges.Remove(br.Range);
|
||||
}
|
||||
}
|
||||
localRanges.Sort(delegate (Range a, Range b) { return MethodInvoke.CompareRanges(dict, a, b); });
|
||||
localRanges.Sort(delegate (Microsoft.ML.Probabilistic.Models.Range a, Microsoft.ML.Probabilistic.Models.Range b) { return MethodInvoke.CompareRanges(dict, a, b); });
|
||||
// convert from List<Range> to List<IStatementBlock>
|
||||
List<IStatementBlock> localRangeBlocks = new List<IStatementBlock>(localRanges.Select(r => r));
|
||||
BuildStatementBlocks(stBlocks, true);
|
||||
|
@ -733,7 +733,7 @@ namespace Microsoft.ML.Probabilistic.Models
|
|||
/// Search all variables referred to by a Range.
|
||||
/// </summary>
|
||||
/// <param name="range"></param>
|
||||
private void SearchRange(Range range)
|
||||
private void SearchRange(Microsoft.ML.Probabilistic.Models.Range range)
|
||||
{
|
||||
if (searched.Contains(range)) return;
|
||||
string name = ((IModelExpression)range).Name;
|
||||
|
@ -743,7 +743,7 @@ namespace Microsoft.ML.Probabilistic.Models
|
|||
SearchRangeAttributes(range);
|
||||
}
|
||||
|
||||
private void SearchRangeAttributes(Range range)
|
||||
private void SearchRangeAttributes(Microsoft.ML.Probabilistic.Models.Range range)
|
||||
{
|
||||
IVariableDeclaration ivd = range.GetIndexDeclaration();
|
||||
foreach (ICompilerAttribute attr in range.GetAttributes<ICompilerAttribute>())
|
||||
|
@ -836,7 +836,7 @@ namespace Microsoft.ML.Probabilistic.Models
|
|||
for (int i = 0; i < indexVars.Length; i++)
|
||||
{
|
||||
IModelExpression expr = parent.indices[i];
|
||||
if (expr is Range range)
|
||||
if (expr is Microsoft.ML.Probabilistic.Models.Range range)
|
||||
indexVars[i] = range.GetIndexDeclaration();
|
||||
else
|
||||
throw new Exception(parent + ".InitializeTo is not allowed since the indices are not ranges");
|
||||
|
@ -959,7 +959,7 @@ namespace Microsoft.ML.Probabilistic.Models
|
|||
sizes = new IExpression[ranges.Count];
|
||||
indexVars = new IVariableDeclaration[ranges.Count];
|
||||
int i = 0;
|
||||
foreach (Range r in ranges)
|
||||
foreach (Microsoft.ML.Probabilistic.Models.Range r in ranges)
|
||||
{
|
||||
SearchRange(r);
|
||||
indexVars[i] = r.GetIndexDeclaration();
|
||||
|
|
|
@ -29,9 +29,9 @@ namespace Microsoft.ML.Probabilistic.Models
|
|||
public IModelExpression<int> Size { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// Range from which this range was cloned, or null if none.
|
||||
/// Microsoft.ML.Probabilistic.Models.Range from which this range was cloned, or null if none.
|
||||
/// </summary>
|
||||
public Range Parent { get; private set; }
|
||||
public Microsoft.ML.Probabilistic.Models.Range Parent { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// Name
|
||||
|
@ -80,7 +80,7 @@ namespace Microsoft.ML.Probabilistic.Models
|
|||
/// </summary>
|
||||
/// <param name="attr">The attribute to add</param>
|
||||
/// <returns>The range object</returns>
|
||||
public Range Attrib(ICompilerAttribute attr)
|
||||
public Microsoft.ML.Probabilistic.Models.Range Attrib(ICompilerAttribute attr)
|
||||
{
|
||||
AddAttribute(attr);
|
||||
return this;
|
||||
|
@ -138,7 +138,7 @@ namespace Microsoft.ML.Probabilistic.Models
|
|||
/// Copy constructor
|
||||
/// </summary>
|
||||
/// <param name="parent"></param>
|
||||
protected Range(Range parent)
|
||||
protected Range(Microsoft.ML.Probabilistic.Models.Range parent)
|
||||
: this(parent.Size)
|
||||
{
|
||||
this.Parent = parent;
|
||||
|
@ -148,9 +148,9 @@ namespace Microsoft.ML.Probabilistic.Models
|
|||
/// Create a copy of a range. The copy can be used to index the same arrays as the original range.
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public Range Clone()
|
||||
public Microsoft.ML.Probabilistic.Models.Range Clone()
|
||||
{
|
||||
return new Range(this);
|
||||
return new Microsoft.ML.Probabilistic.Models.Range(this);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
@ -164,10 +164,10 @@ namespace Microsoft.ML.Probabilistic.Models
|
|||
if (Size is Variable<int> sizeVar)
|
||||
{
|
||||
if (!(sizeVar.IsObserved && sizeVar.IsReadOnly))
|
||||
throw new InvalidOperationException("The Range does not have constant size. To use SizeAsInt, set IsReadOnly=true on the range size.");
|
||||
throw new InvalidOperationException("The Microsoft.ML.Probabilistic.Models.Range does not have constant size. To use SizeAsInt, set IsReadOnly=true on the range size.");
|
||||
return sizeVar.ObservedValue;
|
||||
}
|
||||
else throw new InvalidOperationException("The Range does not have constant size. Set IsReadOnly=true on the range size.");
|
||||
else throw new InvalidOperationException("The Microsoft.ML.Probabilistic.Models.Range does not have constant size. Set IsReadOnly=true on the range size.");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -187,7 +187,7 @@ namespace Microsoft.ML.Probabilistic.Models
|
|||
/// </summary>
|
||||
/// <param name="name">Name for the range</param>
|
||||
/// <returns>this</returns>
|
||||
public Range Named(string name)
|
||||
public Microsoft.ML.Probabilistic.Models.Range Named(string name)
|
||||
{
|
||||
this.name = name;
|
||||
return this;
|
||||
|
@ -219,7 +219,7 @@ namespace Microsoft.ML.Probabilistic.Models
|
|||
internal static string ToString(IList<Range> ranges)
|
||||
{
|
||||
StringBuilder sb = new StringBuilder("[");
|
||||
foreach (Range r in ranges)
|
||||
foreach (Microsoft.ML.Probabilistic.Models.Range r in ranges)
|
||||
{
|
||||
if (sb.Length > 1) sb.Append(",");
|
||||
sb.Append(r.Name);
|
||||
|
@ -228,9 +228,9 @@ namespace Microsoft.ML.Probabilistic.Models
|
|||
return sb.ToString();
|
||||
}
|
||||
|
||||
internal Range GetRoot()
|
||||
internal Microsoft.ML.Probabilistic.Models.Range GetRoot()
|
||||
{
|
||||
Range root = this;
|
||||
Microsoft.ML.Probabilistic.Models.Range root = this;
|
||||
while (root.Parent != null) root = root.Parent;
|
||||
return root;
|
||||
}
|
||||
|
@ -247,12 +247,12 @@ namespace Microsoft.ML.Probabilistic.Models
|
|||
return v;
|
||||
}
|
||||
|
||||
private static Range ReplaceExpressions(Range r, Dictionary<IModelExpression, IModelExpression> replacements)
|
||||
private static Microsoft.ML.Probabilistic.Models.Range ReplaceExpressions(Microsoft.ML.Probabilistic.Models.Range r, Dictionary<IModelExpression, IModelExpression> replacements)
|
||||
{
|
||||
IModelExpression<int> newSize = (IModelExpression<int>)ReplaceExpressions(r.Size, replacements);
|
||||
if (ReferenceEquals(newSize, r.Size))
|
||||
return r;
|
||||
Range newRange = new Range(newSize);
|
||||
Microsoft.ML.Probabilistic.Models.Range newRange = new Microsoft.ML.Probabilistic.Models.Range(newSize);
|
||||
newRange.Parent = r;
|
||||
replacements.Add(r, newRange);
|
||||
return newRange;
|
||||
|
@ -261,7 +261,7 @@ namespace Microsoft.ML.Probabilistic.Models
|
|||
private static IModelExpression ReplaceExpressions(IModelExpression expr, Dictionary<IModelExpression, IModelExpression> replacements)
|
||||
{
|
||||
if (replacements.ContainsKey(expr)) return replacements[expr];
|
||||
if (expr is Range range)
|
||||
if (expr is Microsoft.ML.Probabilistic.Models.Range range)
|
||||
{
|
||||
return ReplaceExpressions(range, replacements);
|
||||
}
|
||||
|
@ -288,12 +288,12 @@ namespace Microsoft.ML.Probabilistic.Models
|
|||
}
|
||||
|
||||
/// <summary>
|
||||
/// Construct a new Range in which all subranges and size expressions have been replaced according to given Dictionaries.
|
||||
/// Construct a new Microsoft.ML.Probabilistic.Models.Range in which all subranges and size expressions have been replaced according to given Dictionaries.
|
||||
/// </summary>
|
||||
/// <param name="rangeReplacements"></param>
|
||||
/// <param name="expressionReplacements">Modified on exit to contain newly created ranges</param>
|
||||
/// <returns></returns>
|
||||
internal Range Replace(Dictionary<Range, Range> rangeReplacements, Dictionary<IModelExpression, IModelExpression> expressionReplacements)
|
||||
internal Microsoft.ML.Probabilistic.Models.Range Replace(Dictionary<Range, Range> rangeReplacements, Dictionary<IModelExpression, IModelExpression> expressionReplacements)
|
||||
{
|
||||
if (rangeReplacements.ContainsKey(this)) return rangeReplacements[this];
|
||||
return ReplaceExpressions(this, expressionReplacements);
|
||||
|
@ -307,10 +307,10 @@ namespace Microsoft.ML.Probabilistic.Models
|
|||
/// <exclude/>
|
||||
internal bool IsCompatibleWith(IModelExpression index)
|
||||
{
|
||||
if (index is Range range) return (range.GetRoot() == GetRoot());
|
||||
if (index is Microsoft.ML.Probabilistic.Models.Range range) return (range.GetRoot() == GetRoot());
|
||||
else if (index is Variable indexVar)
|
||||
{
|
||||
Range valueRange = indexVar.GetValueRange(false);
|
||||
Microsoft.ML.Probabilistic.Models.Range valueRange = indexVar.GetValueRange(false);
|
||||
if (valueRange == null) return true;
|
||||
return IsCompatibleWith(valueRange);
|
||||
}
|
||||
|
|
|
@ -54,7 +54,7 @@ namespace Microsoft.ML.Probabilistic.Models
|
|||
/// <param name="prior">A distribution over an array, to use as the prior.</param>
|
||||
/// <param name="divideMessages">Use division (the faster default) for calculating messages to batches</param>
|
||||
/// <returns></returns>
|
||||
public static SharedVariableArray<DomainType> Random<DistributionArrayType>(Range range, DistributionArrayType prior, bool divideMessages = true)
|
||||
public static SharedVariableArray<DomainType> Random<DistributionArrayType>(Microsoft.ML.Probabilistic.Models.Range range, DistributionArrayType prior, bool divideMessages = true)
|
||||
where DistributionArrayType : IDistribution<DomainType[]>, Sampleable<DomainType[]>, SettableToProduct<DistributionArrayType>,
|
||||
ICloneable, SettableToUniform, SettableTo<DistributionArrayType>, SettableToRatio<DistributionArrayType>, CanGetLogAverageOf<DistributionArrayType>
|
||||
{
|
||||
|
@ -70,7 +70,7 @@ namespace Microsoft.ML.Probabilistic.Models
|
|||
/// <param name="prior">Prior for the array.</param>
|
||||
/// <param name="divideMessages">Use division (the faster default) for calculating messages to batches</param>
|
||||
/// <returns></returns>
|
||||
public static ISharedVariableArray<VariableArray<DomainType>, DomainType[][]> Random<DistributionArrayType>(VariableArray<DomainType> itemPrototype, Range range,
|
||||
public static ISharedVariableArray<VariableArray<DomainType>, DomainType[][]> Random<DistributionArrayType>(VariableArray<DomainType> itemPrototype, Microsoft.ML.Probabilistic.Models.Range range,
|
||||
DistributionArrayType prior, bool divideMessages = true)
|
||||
where DistributionArrayType : IDistribution<DomainType[][]>, Sampleable<DomainType[][]>, SettableToProduct<DistributionArrayType>,
|
||||
ICloneable, SettableToUniform, SettableTo<DistributionArrayType>, SettableToRatio<DistributionArrayType>, CanGetLogAverageOf<DistributionArrayType>
|
||||
|
@ -88,7 +88,7 @@ namespace Microsoft.ML.Probabilistic.Models
|
|||
/// <param name="prior">Prior for the array.</param>
|
||||
/// <param name="divideMessages">Use division (the faster default) for calculating messages to batches</param>
|
||||
/// <returns></returns>
|
||||
public static ISharedVariableArray<ItemType, DomainType> Random<ItemType, DistributionArrayType>(ItemType itemPrototype, Range range, DistributionArrayType prior,
|
||||
public static ISharedVariableArray<ItemType, DomainType> Random<ItemType, DistributionArrayType>(ItemType itemPrototype, Microsoft.ML.Probabilistic.Models.Range range, DistributionArrayType prior,
|
||||
bool divideMessages = true)
|
||||
where ItemType : Variable, SettableTo<ItemType>, ICloneable
|
||||
where DistributionArrayType : IDistribution<DomainType>, Sampleable<DomainType>, SettableToProduct<DistributionArrayType>,
|
||||
|
|
|
@ -110,11 +110,11 @@ namespace Microsoft.ML.Probabilistic.Models
|
|||
ICloneable, SettableToUniform, SettableTo<DistributionArrayType>, CanGetLogAverageOf<DistributionArrayType>
|
||||
{
|
||||
/// <summary>
|
||||
/// Range for the array of shared variables
|
||||
/// Microsoft.ML.Probabilistic.Models.Range for the array of shared variables
|
||||
/// </summary>
|
||||
public Range range;
|
||||
public Microsoft.ML.Probabilistic.Models.Range range;
|
||||
|
||||
internal SharedVariableArray(Range range, DistributionArrayType prior, bool divideMessages = true)
|
||||
internal SharedVariableArray(Microsoft.ML.Probabilistic.Models.Range range, DistributionArrayType prior, bool divideMessages = true)
|
||||
: base(prior, divideMessages)
|
||||
{
|
||||
this.range = range;
|
||||
|
@ -234,13 +234,13 @@ namespace Microsoft.ML.Probabilistic.Models
|
|||
where ItemType : Variable, ICloneable, SettableTo<ItemType>
|
||||
{
|
||||
/// <summary>
|
||||
/// Range for the array of shared variables
|
||||
/// Microsoft.ML.Probabilistic.Models.Range for the array of shared variables
|
||||
/// </summary>
|
||||
public Range range;
|
||||
public Microsoft.ML.Probabilistic.Models.Range range;
|
||||
|
||||
private ItemType itemPrototype;
|
||||
|
||||
internal SharedVariableArray(ItemType itemPrototype, Range range, DistributionArrayType prior, bool divideMessages = true)
|
||||
internal SharedVariableArray(ItemType itemPrototype, Microsoft.ML.Probabilistic.Models.Range range, DistributionArrayType prior, bool divideMessages = true)
|
||||
: base(prior, divideMessages)
|
||||
{
|
||||
this.itemPrototype = itemPrototype;
|
||||
|
|
|
@ -75,9 +75,9 @@ namespace Microsoft.ML.Probabilistic.Models
|
|||
/// <summary>
|
||||
/// Ranges for the array of shared variables
|
||||
/// </summary>
|
||||
public Range range0, range1;
|
||||
public Microsoft.ML.Probabilistic.Models.Range range0, range1;
|
||||
|
||||
internal SharedVariableArray2D(Range range0, Range range1, DistributionArrayType prior, bool divideMessages = true)
|
||||
internal SharedVariableArray2D(Microsoft.ML.Probabilistic.Models.Range range0, Microsoft.ML.Probabilistic.Models.Range range1, DistributionArrayType prior, bool divideMessages = true)
|
||||
: base(prior, divideMessages)
|
||||
{
|
||||
this.range0 = range0;
|
||||
|
|
|
@ -269,7 +269,7 @@ namespace Microsoft.ML.Probabilistic.Models
|
|||
{
|
||||
IModelExpression index1 = list1[i];
|
||||
IModelExpression index2 = list2[i];
|
||||
if (index1 is Range || index2 is Range) continue;
|
||||
if (index1 is Microsoft.ML.Probabilistic.Models.Range || index2 is Range) continue;
|
||||
if (index1 == index2) continue;
|
||||
if (!IsConstantScalar(index1)) continue;
|
||||
if (!IsConstantScalar(index2)) continue;
|
||||
|
@ -634,7 +634,7 @@ namespace Microsoft.ML.Probabilistic.Models
|
|||
/// </summary>
|
||||
/// <returns></returns>
|
||||
/// <exception cref="ArgumentException">If the variable has no ValueRange attribute.</exception>
|
||||
public Range GetValueRange()
|
||||
public Microsoft.ML.Probabilistic.Models.Range GetValueRange()
|
||||
{
|
||||
return GetValueRange(true);
|
||||
}
|
||||
|
@ -645,7 +645,7 @@ namespace Microsoft.ML.Probabilistic.Models
|
|||
/// <param name="throwIfMissing">Indicates if a missing attribute should throw an exception.</param>
|
||||
/// <returns></returns>
|
||||
/// <exception cref="ArgumentException">If the variable has no ValueRange attribute and <paramref name="throwIfMissing"/> is true.</exception>
|
||||
public Range GetValueRange(bool throwIfMissing)
|
||||
public Microsoft.ML.Probabilistic.Models.Range GetValueRange(bool throwIfMissing)
|
||||
{
|
||||
List<ValueRange> ranges = new List<ValueRange>(GetAttributes<ValueRange>());
|
||||
if (ranges.Count == 0)
|
||||
|
@ -658,7 +658,7 @@ namespace Microsoft.ML.Probabilistic.Models
|
|||
}
|
||||
else
|
||||
{
|
||||
Range valueRange = ranges[0].Range;
|
||||
Microsoft.ML.Probabilistic.Models.Range valueRange = ranges[0].Range;
|
||||
// the ValueRange may refer to Ranges.
|
||||
// replace all indices of this variable in the ValueRange.
|
||||
Dictionary<Range, Range> rangeReplacements = new Dictionary<Range, Range>();
|
||||
|
@ -682,7 +682,7 @@ namespace Microsoft.ML.Probabilistic.Models
|
|||
/// Sets the ValueRange attribute of this variable, replacing any previously set.
|
||||
/// </summary>
|
||||
/// <param name="valueRange">A range defining the set of values this variable can take on. Only meaningful for Variable<int> and Variable<Vector></param>
|
||||
public void SetValueRange(Range valueRange)
|
||||
public void SetValueRange(Microsoft.ML.Probabilistic.Models.Range valueRange)
|
||||
{
|
||||
List<ValueRange> ranges = new List<ValueRange>(GetAttributes<ValueRange>());
|
||||
if (ranges.Count == 0) AddAttribute(new ValueRange(valueRange));
|
||||
|
@ -901,7 +901,7 @@ namespace Microsoft.ML.Probabilistic.Models
|
|||
return aie;
|
||||
}
|
||||
|
||||
public Range loopRange;
|
||||
public Microsoft.ML.Probabilistic.Models.Range loopRange;
|
||||
|
||||
public bool IsLoopIndex
|
||||
{
|
||||
|
@ -969,8 +969,8 @@ namespace Microsoft.ML.Probabilistic.Models
|
|||
/// <remarks>null if the variable is not an array.</remarks>
|
||||
internal Variable item;
|
||||
public bool IsArray { get { return (item != null); } }
|
||||
public Range Range { get { return indices[0]; } }
|
||||
public Range Ranges { get { return indices; } }
|
||||
public Microsoft.ML.Probabilistic.Models.Range Range { get { return indices[0]; } }
|
||||
public Microsoft.ML.Probabilistic.Models.Range Ranges { get { return indices; } }
|
||||
|
||||
/// <summary>
|
||||
/// Get or set the elements of an array.
|
||||
|
@ -986,7 +986,7 @@ namespace Microsoft.ML.Probabilistic.Models
|
|||
get { throw new NotSupportedException(this + " is not an array"); }
|
||||
set { throw new NotSupportedException(this + " is not an array"); }
|
||||
}
|
||||
public virtual Variable this[Range range1, Range range2]
|
||||
public virtual Variable this[Range range1, Microsoft.ML.Probabilistic.Models.Range range2]
|
||||
{
|
||||
get { throw new NotSupportedException(this + " is not an array"); }
|
||||
set { throw new NotSupportedException(this + " is not an array"); }
|
||||
|
@ -1021,7 +1021,7 @@ namespace Microsoft.ML.Probabilistic.Models
|
|||
/// <returns>A new constant variable.</returns>
|
||||
public static VariableArray<T> Constant<T>(T[] value)
|
||||
{
|
||||
return Constant(value, new Range(value.Length));
|
||||
return Constant(value, new Microsoft.ML.Probabilistic.Models.Range(value.Length));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
@ -1031,8 +1031,8 @@ namespace Microsoft.ML.Probabilistic.Models
|
|||
/// <param name="value">The constant array</param>
|
||||
/// <param name="r">The range associated with this constant array</param>
|
||||
/// <returns>A new constant variable.</returns>
|
||||
//public static ConstantArray<T> Constant<T>(T[] value, Range r) { return new ConstantArray<T>(value, r); }
|
||||
public static VariableArray<T> Constant<T>(T[] value, Range r)
|
||||
//public static ConstantArray<T> Constant<T>(T[] value, Microsoft.ML.Probabilistic.Models.Range r) { return new ConstantArray<T>(value, r); }
|
||||
public static VariableArray<T> Constant<T>(T[] value, Microsoft.ML.Probabilistic.Models.Range r)
|
||||
{
|
||||
VariableArray<T> var = new VariableArray<T>(Constant(default(T)), r);
|
||||
var.ObservedValue = value;
|
||||
|
@ -1054,7 +1054,7 @@ namespace Microsoft.ML.Probabilistic.Models
|
|||
/// <returns>A new constant variable.</returns>
|
||||
public static VariableArray2D<T> Constant<T>(T[,] value)
|
||||
{
|
||||
return Constant(value, new Range(value.GetLength(0)), new Range(value.GetLength(1)));
|
||||
return Constant(value, new Microsoft.ML.Probabilistic.Models.Range(value.GetLength(0)), new Microsoft.ML.Probabilistic.Models.Range(value.GetLength(1)));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
@ -1065,7 +1065,7 @@ namespace Microsoft.ML.Probabilistic.Models
|
|||
/// <param name="r1">The range associated with the first index</param>
|
||||
/// <param name="r2">The range associated with the second index</param>
|
||||
/// <returns>A new constant variable.</returns>
|
||||
public static VariableArray2D<T> Constant<T>(T[,] value, Range r1, Range r2)
|
||||
public static VariableArray2D<T> Constant<T>(T[,] value, Microsoft.ML.Probabilistic.Models.Range r1, Microsoft.ML.Probabilistic.Models.Range r2)
|
||||
{
|
||||
var var = new VariableArray2D<T>(Constant(default(T)), r1, r2);
|
||||
var.ObservedValue = value;
|
||||
|
@ -1088,7 +1088,7 @@ namespace Microsoft.ML.Probabilistic.Models
|
|||
/// <param name="r1">The range associated with the first index</param>
|
||||
/// <param name="r2">The range associated with the second index</param>
|
||||
/// <returns>A new constant jagged array variable.</returns>
|
||||
public static VariableArray<VariableArray<T>, T[][]> Constant<T>(T[][] value, Range r1, Range r2)
|
||||
public static VariableArray<VariableArray<T>, T[][]> Constant<T>(T[][] value, Microsoft.ML.Probabilistic.Models.Range r1, Microsoft.ML.Probabilistic.Models.Range r2)
|
||||
{
|
||||
var var = new VariableArray<VariableArray<T>, T[][]>(Constant(default(T[]), r2), r1);
|
||||
var.ObservedValue = value;
|
||||
|
@ -1114,7 +1114,7 @@ namespace Microsoft.ML.Probabilistic.Models
|
|||
/// <param name="r3">The range associated with the third index</param>
|
||||
/// <returns>A new constant jagged array variable.</returns>
|
||||
/// <returns></returns>
|
||||
public static VariableArray<VariableArray2D<T>, T[][,]> Constant<T>(T[][,] value, Range r1, Range r2, Range r3)
|
||||
public static VariableArray<VariableArray2D<T>, T[][,]> Constant<T>(T[][,] value, Microsoft.ML.Probabilistic.Models.Range r1, Microsoft.ML.Probabilistic.Models.Range r2, Microsoft.ML.Probabilistic.Models.Range r3)
|
||||
{
|
||||
var var = new VariableArray<VariableArray2D<T>, T[][,]>(Constant(default(T[,]), r2, r3), r1);
|
||||
var.ObservedValue = value;
|
||||
|
@ -1141,7 +1141,7 @@ namespace Microsoft.ML.Probabilistic.Models
|
|||
/// <param name="r3">The range associated with the third index</param>
|
||||
/// <returns>A new constant jagged array variable.</returns>
|
||||
/// <returns></returns>
|
||||
public static VariableArray<VariableArray<VariableArray<T>, T[][]>, T[][][]> Constant<T>(T[][][] value, Range r1, Range r2, Range r3)
|
||||
public static VariableArray<VariableArray<VariableArray<T>, T[][]>, T[][][]> Constant<T>(T[][][] value, Microsoft.ML.Probabilistic.Models.Range r1, Microsoft.ML.Probabilistic.Models.Range r2, Microsoft.ML.Probabilistic.Models.Range r3)
|
||||
{
|
||||
var var = new VariableArray<VariableArray<VariableArray<T>, T[][]>, T[][][]>(Constant(default(T[][]), r2, r3), r1);
|
||||
var.ObservedValue = value;
|
||||
|
@ -1165,7 +1165,7 @@ namespace Microsoft.ML.Probabilistic.Models
|
|||
/// <returns>A new constant variable.</returns>
|
||||
public static VariableArray<Variable<T>, IList<T>> Constant<T>(IList<T> value)
|
||||
{
|
||||
return Constant(value, new Range(value.Count));
|
||||
return Constant(value, new Microsoft.ML.Probabilistic.Models.Range(value.Count));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
@ -1175,7 +1175,7 @@ namespace Microsoft.ML.Probabilistic.Models
|
|||
/// <param name="value">The constant list.</param>
|
||||
/// <param name="r">The range associated with this constant list.</param>
|
||||
/// <returns>A new constant variable.</returns>
|
||||
public static VariableArray<Variable<T>, IList<T>> Constant<T>(IList<T> value, Range r)
|
||||
public static VariableArray<Variable<T>, IList<T>> Constant<T>(IList<T> value, Microsoft.ML.Probabilistic.Models.Range r)
|
||||
{
|
||||
var result = new VariableArray<Variable<T>, IList<T>>(Constant(default(T)), r)
|
||||
{
|
||||
|
@ -1201,7 +1201,7 @@ namespace Microsoft.ML.Probabilistic.Models
|
|||
/// <param name="r1">The range associated with the first index.</param>
|
||||
/// <param name="r2">The range associated with the second index.</param>
|
||||
/// <returns>A new constant jagged array variable.</returns>
|
||||
public static VariableArray<VariableArray<Variable<T>, IList<T>>, IList<IList<T>>> Constant<T>(IList<IList<T>> value, Range r1, Range r2)
|
||||
public static VariableArray<VariableArray<Variable<T>, IList<T>>, IList<IList<T>>> Constant<T>(IList<IList<T>> value, Microsoft.ML.Probabilistic.Models.Range r1, Microsoft.ML.Probabilistic.Models.Range r2)
|
||||
{
|
||||
var result = new VariableArray<VariableArray<Variable<T>, IList<T>>, IList<IList<T>>>(Constant(default(IList<T>), r2), r1)
|
||||
{
|
||||
|
@ -1228,7 +1228,7 @@ namespace Microsoft.ML.Probabilistic.Models
|
|||
/// <returns>A new constant variable.</returns>
|
||||
public static VariableArray<Variable<T>, IReadOnlyList<T>> Constant<T>(IReadOnlyList<T> value)
|
||||
{
|
||||
return Constant(value, new Range(value.Count));
|
||||
return Constant(value, new Microsoft.ML.Probabilistic.Models.Range(value.Count));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
@ -1238,7 +1238,7 @@ namespace Microsoft.ML.Probabilistic.Models
|
|||
/// <param name="value">The constant list.</param>
|
||||
/// <param name="r">The range associated with this constant list.</param>
|
||||
/// <returns>A new constant variable.</returns>
|
||||
public static VariableArray<Variable<T>, IReadOnlyList<T>> Constant<T>(IReadOnlyList<T> value, Range r)
|
||||
public static VariableArray<Variable<T>, IReadOnlyList<T>> Constant<T>(IReadOnlyList<T> value, Microsoft.ML.Probabilistic.Models.Range r)
|
||||
{
|
||||
var result = new VariableArray<Variable<T>, IReadOnlyList<T>>(Constant(default(T)), r)
|
||||
{
|
||||
|
@ -1264,7 +1264,7 @@ namespace Microsoft.ML.Probabilistic.Models
|
|||
/// <param name="r1">The range associated with the first index.</param>
|
||||
/// <param name="r2">The range associated with the second index.</param>
|
||||
/// <returns>A new constant jagged array variable.</returns>
|
||||
public static VariableArray<VariableArray<Variable<T>, IReadOnlyList<T>>, IReadOnlyList<IReadOnlyList<T>>> Constant<T>(IReadOnlyList<IReadOnlyList<T>> value, Range r1, Range r2)
|
||||
public static VariableArray<VariableArray<Variable<T>, IReadOnlyList<T>>, IReadOnlyList<IReadOnlyList<T>>> Constant<T>(IReadOnlyList<IReadOnlyList<T>> value, Microsoft.ML.Probabilistic.Models.Range r1, Microsoft.ML.Probabilistic.Models.Range r2)
|
||||
{
|
||||
var result = new VariableArray<VariableArray<Variable<T>, IReadOnlyList<T>>, IReadOnlyList<IReadOnlyList<T>>>(Constant(default(IReadOnlyList<T>), r2), r1)
|
||||
{
|
||||
|
@ -1306,7 +1306,7 @@ namespace Microsoft.ML.Probabilistic.Models
|
|||
/// <remarks>The variable is not constant; its ObservedValue can be changed.</remarks>
|
||||
public static VariableArray<T> Observed<T>(T[] observedValue)
|
||||
{
|
||||
return Observed(observedValue, new Range(observedValue.Length));
|
||||
return Observed(observedValue, new Microsoft.ML.Probabilistic.Models.Range(observedValue.Length));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
@ -1318,7 +1318,7 @@ namespace Microsoft.ML.Probabilistic.Models
|
|||
/// <remarks>The variable is not constant; its ObservedValue can be changed.</remarks>
|
||||
public static VariableArray2D<T> Observed<T>(T[,] observedValue)
|
||||
{
|
||||
return Observed(observedValue, new Range(observedValue.GetLength(0)), new Range(observedValue.GetLength(1)));
|
||||
return Observed(observedValue, new Microsoft.ML.Probabilistic.Models.Range(observedValue.GetLength(0)), new Microsoft.ML.Probabilistic.Models.Range(observedValue.GetLength(1)));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
@ -1329,7 +1329,7 @@ namespace Microsoft.ML.Probabilistic.Models
|
|||
/// <param name="r">The range used to index the array</param>
|
||||
/// <returns>A new variable</returns>
|
||||
/// <remarks>The variable is not constant; its ObservedValue can be changed.</remarks>
|
||||
public static VariableArray<T> Observed<T>(T[] observedValue, Range r)
|
||||
public static VariableArray<T> Observed<T>(T[] observedValue, Microsoft.ML.Probabilistic.Models.Range r)
|
||||
{
|
||||
VariableArray<T> g = new VariableArray<T>(r);
|
||||
g.ObservedValue = observedValue;
|
||||
|
@ -1345,7 +1345,7 @@ namespace Microsoft.ML.Probabilistic.Models
|
|||
/// <param name="r2">The range used for the second index</param>
|
||||
/// <returns>A new variable</returns>
|
||||
/// <remarks>The variable is not constant; its ObservedValue can be changed.</remarks>
|
||||
public static VariableArray<VariableArray<T>, T[][]> Observed<T>(T[][] observedValue, Range r1, Range r2)
|
||||
public static VariableArray<VariableArray<T>, T[][]> Observed<T>(T[][] observedValue, Microsoft.ML.Probabilistic.Models.Range r1, Microsoft.ML.Probabilistic.Models.Range r2)
|
||||
{
|
||||
VariableArray<VariableArray<T>, T[][]> g = new VariableArray<VariableArray<T>, T[][]>(Constant(default(T[]), r2), r1);
|
||||
g.ObservedValue = observedValue;
|
||||
|
@ -1362,7 +1362,7 @@ namespace Microsoft.ML.Probabilistic.Models
|
|||
/// <param name="r3">The range used for the third index</param>
|
||||
/// <returns>A new variable</returns>
|
||||
/// <remarks>The variable is not constant; its ObservedValue can be changed.</remarks>
|
||||
public static VariableArray<VariableArray<VariableArray<T>, T[][]>, T[][][]> Observed<T>(T[][][] observedValue, Range r1, Range r2, Range r3)
|
||||
public static VariableArray<VariableArray<VariableArray<T>, T[][]>, T[][][]> Observed<T>(T[][][] observedValue, Microsoft.ML.Probabilistic.Models.Range r1, Microsoft.ML.Probabilistic.Models.Range r2, Microsoft.ML.Probabilistic.Models.Range r3)
|
||||
{
|
||||
VariableArray<VariableArray<VariableArray<T>, T[][]>, T[][][]> g =
|
||||
new VariableArray<VariableArray<VariableArray<T>, T[][]>, T[][][]>(Constant(default(T[][]), r2, r3), r1);
|
||||
|
@ -1381,7 +1381,7 @@ namespace Microsoft.ML.Probabilistic.Models
|
|||
/// <param name="r4">The range used for the fourth index</param>
|
||||
/// <returns>A new variable</returns>
|
||||
/// <remarks>The variable is not constant; its ObservedValue can be changed.</remarks>
|
||||
public static VariableArray<VariableArray<VariableArray<VariableArray<T>, T[][]>, T[][][]>, T[][][][]> Observed<T>(T[][][][] observedValue, Range r1, Range r2, Range r3, Range r4)
|
||||
public static VariableArray<VariableArray<VariableArray<VariableArray<T>, T[][]>, T[][][]>, T[][][][]> Observed<T>(T[][][][] observedValue, Microsoft.ML.Probabilistic.Models.Range r1, Microsoft.ML.Probabilistic.Models.Range r2, Microsoft.ML.Probabilistic.Models.Range r3, Microsoft.ML.Probabilistic.Models.Range r4)
|
||||
{
|
||||
var g = new VariableArray<VariableArray<VariableArray<VariableArray<T>, T[][]>, T[][][]>, T[][][][]>(Constant(default(T[][][]), r2, r3, r4), r1);
|
||||
g.ObservedValue = observedValue;
|
||||
|
@ -1397,7 +1397,7 @@ namespace Microsoft.ML.Probabilistic.Models
|
|||
/// <param name="r1">The range used for the second index</param>
|
||||
/// <returns>A new variable</returns>
|
||||
/// <remarks>The variable is not constant; its ObservedValue can be changed.</remarks>
|
||||
public static VariableArray2D<T> Observed<T>(T[,] observedValue, Range r0, Range r1)
|
||||
public static VariableArray2D<T> Observed<T>(T[,] observedValue, Microsoft.ML.Probabilistic.Models.Range r0, Microsoft.ML.Probabilistic.Models.Range r1)
|
||||
{
|
||||
VariableArray2D<T> g = new VariableArray2D<T>(r0, r1);
|
||||
g.ObservedValue = observedValue;
|
||||
|
@ -1414,7 +1414,7 @@ namespace Microsoft.ML.Probabilistic.Models
|
|||
/// <remarks>The variable is not constant; its ObservedValue can be changed.</remarks>
|
||||
public static VariableArray<Variable<T>, IList<T>> Observed<T>(IList<T> observedValue)
|
||||
{
|
||||
return Observed(observedValue, new Range(observedValue.Count));
|
||||
return Observed(observedValue, new Microsoft.ML.Probabilistic.Models.Range(observedValue.Count));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
@ -1425,7 +1425,7 @@ namespace Microsoft.ML.Probabilistic.Models
|
|||
/// <param name="r">The range used to index the array.</param>
|
||||
/// <returns>A new variable.</returns>
|
||||
/// <remarks>The variable is not constant; its ObservedValue can be changed.</remarks>
|
||||
public static VariableArray<Variable<T>, IList<T>> Observed<T>(IList<T> observedValue, Range r)
|
||||
public static VariableArray<Variable<T>, IList<T>> Observed<T>(IList<T> observedValue, Microsoft.ML.Probabilistic.Models.Range r)
|
||||
{
|
||||
var result = new VariableArray<Variable<T>, IList<T>>(Constant(default(T)), r)
|
||||
{
|
||||
|
@ -1443,7 +1443,7 @@ namespace Microsoft.ML.Probabilistic.Models
|
|||
/// <param name="r2">The range used for the second index.</param>
|
||||
/// <returns>A new variable.</returns>
|
||||
/// <remarks>The variable is not constant; its ObservedValue can be changed.</remarks>
|
||||
public static VariableArray<VariableArray<Variable<T>, IList<T>>, IList<IList<T>>> Observed<T>(IList<IList<T>> observedValue, Range r1, Range r2)
|
||||
public static VariableArray<VariableArray<Variable<T>, IList<T>>, IList<IList<T>>> Observed<T>(IList<IList<T>> observedValue, Microsoft.ML.Probabilistic.Models.Range r1, Microsoft.ML.Probabilistic.Models.Range r2)
|
||||
{
|
||||
var result = new VariableArray<VariableArray<Variable<T>, IList<T>>, IList<IList<T>>>(Constant(default(IList<T>), r2), r1);
|
||||
result.ObservedValue = observedValue;
|
||||
|
@ -1460,7 +1460,7 @@ namespace Microsoft.ML.Probabilistic.Models
|
|||
/// <remarks>The variable is not constant; its ObservedValue can be changed.</remarks>
|
||||
public static VariableArray<Variable<T>, IReadOnlyList<T>> Observed<T>(IReadOnlyList<T> observedValue)
|
||||
{
|
||||
return Observed(observedValue, new Range(observedValue.Count));
|
||||
return Observed(observedValue, new Microsoft.ML.Probabilistic.Models.Range(observedValue.Count));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
@ -1471,7 +1471,7 @@ namespace Microsoft.ML.Probabilistic.Models
|
|||
/// <param name="r">The range used to index the array.</param>
|
||||
/// <returns>A new variable.</returns>
|
||||
/// <remarks>The variable is not constant; its ObservedValue can be changed.</remarks>
|
||||
public static VariableArray<Variable<T>, IReadOnlyList<T>> Observed<T>(IReadOnlyList<T> observedValue, Range r)
|
||||
public static VariableArray<Variable<T>, IReadOnlyList<T>> Observed<T>(IReadOnlyList<T> observedValue, Microsoft.ML.Probabilistic.Models.Range r)
|
||||
{
|
||||
return new VariableArray<Variable<T>, IReadOnlyList<T>>(Constant(default(T)), r)
|
||||
{
|
||||
|
@ -1488,7 +1488,7 @@ namespace Microsoft.ML.Probabilistic.Models
|
|||
/// <param name="r2">The range used for the second index.</param>
|
||||
/// <returns>A new variable.</returns>
|
||||
/// <remarks>The variable is not constant; its ObservedValue can be changed.</remarks>
|
||||
public static VariableArray<VariableArray<Variable<T>, IReadOnlyList<T>>, IReadOnlyList<IReadOnlyList<T>>> Observed<T>(IReadOnlyList<IReadOnlyList<T>> observedValue, Range r1, Range r2)
|
||||
public static VariableArray<VariableArray<Variable<T>, IReadOnlyList<T>>, IReadOnlyList<IReadOnlyList<T>>> Observed<T>(IReadOnlyList<IReadOnlyList<T>> observedValue, Microsoft.ML.Probabilistic.Models.Range r1, Microsoft.ML.Probabilistic.Models.Range r2)
|
||||
{
|
||||
return new VariableArray<VariableArray<Variable<T>, IReadOnlyList<T>>, IReadOnlyList<IReadOnlyList<T>>>(Constant(default(IReadOnlyList<T>), r2), r1)
|
||||
{
|
||||
|
@ -1551,7 +1551,7 @@ namespace Microsoft.ML.Probabilistic.Models
|
|||
///
|
||||
/// <param name="range"></param>
|
||||
/// <returns></returns>
|
||||
public static ForEachBlock ForEach(Range range)
|
||||
public static ForEachBlock ForEach(Microsoft.ML.Probabilistic.Models.Range range)
|
||||
{
|
||||
return new ForEachBlock(range);
|
||||
}
|
||||
|
@ -1576,7 +1576,7 @@ namespace Microsoft.ML.Probabilistic.Models
|
|||
/// <returns>
|
||||
/// Returns a <c>VariableArray</c> object whose size is specified by <paramref name="r"/>.
|
||||
/// </returns>
|
||||
public static VariableArray<T> Array<T>(Range r)
|
||||
public static VariableArray<T> Array<T>(Microsoft.ML.Probabilistic.Models.Range r)
|
||||
{
|
||||
return new VariableArray<T>(r);
|
||||
}
|
||||
|
@ -1591,7 +1591,7 @@ namespace Microsoft.ML.Probabilistic.Models
|
|||
/// <returns>
|
||||
/// Returns a <c>VariableArray</c> object whose size is specified by <paramref name="r"/>.
|
||||
/// </returns>
|
||||
public static VariableArray<Variable<T>, IList<T>> IList<T>(Range r)
|
||||
public static VariableArray<Variable<T>, IList<T>> IList<T>(Microsoft.ML.Probabilistic.Models.Range r)
|
||||
{
|
||||
return new VariableArray<Variable<T>, IList<T>>(new Variable<T>(), r);
|
||||
}
|
||||
|
@ -1606,7 +1606,7 @@ namespace Microsoft.ML.Probabilistic.Models
|
|||
/// <returns>
|
||||
/// Returns a <c>VariableArray</c> object whose size is specified by <paramref name="r"/>.
|
||||
/// </returns>
|
||||
public static VariableArray<Variable<T>, ISparseList<T>> ISparseList<T>(Range r)
|
||||
public static VariableArray<Variable<T>, ISparseList<T>> ISparseList<T>(Microsoft.ML.Probabilistic.Models.Range r)
|
||||
{
|
||||
return new VariableArray<Variable<T>, ISparseList<T>>(new Variable<T>(), r);
|
||||
}
|
||||
|
@ -1621,7 +1621,7 @@ namespace Microsoft.ML.Probabilistic.Models
|
|||
/// <returns>
|
||||
/// Returns a <c>VariableArray</c> object whose size is specified by <paramref name="r"/>.
|
||||
/// </returns>
|
||||
public static VariableArray<Variable<T>, IArray<T>> IArray<T>(Range r)
|
||||
public static VariableArray<Variable<T>, IArray<T>> IArray<T>(Microsoft.ML.Probabilistic.Models.Range r)
|
||||
{
|
||||
return new VariableArray<Variable<T>, IArray<T>>(new Variable<T>(), r);
|
||||
}
|
||||
|
@ -1639,7 +1639,7 @@ namespace Microsoft.ML.Probabilistic.Models
|
|||
/// <returns>
|
||||
/// Returns a <c>VariableArray2D</c> object whose dimensions are pecified by <paramref name="r1"/> and <paramref name="r2"/>.
|
||||
/// </returns>
|
||||
public static VariableArray2D<T> Array<T>(Range r1, Range r2)
|
||||
public static VariableArray2D<T> Array<T>(Microsoft.ML.Probabilistic.Models.Range r1, Microsoft.ML.Probabilistic.Models.Range r2)
|
||||
{
|
||||
return new VariableArray2D<T>(r1, r2);
|
||||
}
|
||||
|
@ -1657,7 +1657,7 @@ namespace Microsoft.ML.Probabilistic.Models
|
|||
/// <returns>
|
||||
/// Returns a <c>VariableArray2D</c> object whose dimensions are pecified by <paramref name="r1"/> and <paramref name="r2"/>.
|
||||
/// </returns>
|
||||
public static VariableArray2D<Variable<T>, IArray2D<T>> IArray<T>(Range r1, Range r2)
|
||||
public static VariableArray2D<Variable<T>, IArray2D<T>> IArray<T>(Microsoft.ML.Probabilistic.Models.Range r1, Microsoft.ML.Probabilistic.Models.Range r2)
|
||||
{
|
||||
return new VariableArray2D<Variable<T>, IArray2D<T>>(new Variable<T>(), r1, r2);
|
||||
}
|
||||
|
@ -1679,7 +1679,7 @@ namespace Microsoft.ML.Probabilistic.Models
|
|||
/// Returns a <c>VariableArray3D</c> object whose dimensions are pecified by <paramref name="r1"/>,
|
||||
/// <paramref name="r2"/>, and <paramref name="r3"/>.
|
||||
/// </returns>
|
||||
public static VariableArray3D<T> Array<T>(Range r1, Range r2, Range r3)
|
||||
public static VariableArray3D<T> Array<T>(Microsoft.ML.Probabilistic.Models.Range r1, Microsoft.ML.Probabilistic.Models.Range r2, Microsoft.ML.Probabilistic.Models.Range r3)
|
||||
{
|
||||
return new VariableArray3D<T>(r1, r2, r3);
|
||||
}
|
||||
|
@ -1713,7 +1713,7 @@ namespace Microsoft.ML.Probabilistic.Models
|
|||
/// <param name="r">A <c>Range</c> object that is initialized with the array's length.</param>
|
||||
/// <returns>Returns a <c>VariableArray</c> object whose length is defined by <paramref name="r"/>. Each element of the array is
|
||||
/// a <c>VariableArray</c>object whose prototype is defined by <paramref name="array"/>.</returns>
|
||||
public static VariableArray<VariableArray<T>, T[][]> Array<T>(VariableArray<T> array, Range r)
|
||||
public static VariableArray<VariableArray<T>, T[][]> Array<T>(VariableArray<T> array, Microsoft.ML.Probabilistic.Models.Range r)
|
||||
{
|
||||
return new VariableArray<VariableArray<T>, T[][]>(array, r);
|
||||
}
|
||||
|
@ -1726,7 +1726,7 @@ namespace Microsoft.ML.Probabilistic.Models
|
|||
/// <param name="r">A <c>Range</c> object that is initialized with the array's length.</param>
|
||||
/// <returns>Returns a <c>VariableArray</c> object whose length is defined by <paramref name="r"/>. Each element of the array is
|
||||
/// a <c>VariableArray</c>object whose prototype is defined by <paramref name="array"/>.</returns>
|
||||
public static VariableArray<VariableArray<T>, IList<T[]>> IList<T>(VariableArray<T> array, Range r)
|
||||
public static VariableArray<VariableArray<T>, IList<T[]>> IList<T>(VariableArray<T> array, Microsoft.ML.Probabilistic.Models.Range r)
|
||||
{
|
||||
return new VariableArray<VariableArray<T>, IList<T[]>>(array, r);
|
||||
}
|
||||
|
@ -1739,7 +1739,7 @@ namespace Microsoft.ML.Probabilistic.Models
|
|||
/// <param name="r">A <c>Range</c> object that is initialized with the array's length.</param>
|
||||
/// <returns>Returns a <c>VariableArray</c> object whose length is defined by <paramref name="r"/>. Each element of the array is
|
||||
/// a <c>VariableArray</c>object whose prototype is defined by <paramref name="array"/>.</returns>
|
||||
public static VariableArray<VariableArray<T>, IArray<T[]>> IArray<T>(VariableArray<T> array, Range r)
|
||||
public static VariableArray<VariableArray<T>, IArray<T[]>> IArray<T>(VariableArray<T> array, Microsoft.ML.Probabilistic.Models.Range r)
|
||||
{
|
||||
return new VariableArray<VariableArray<T>, IArray<T[]>>(array, r);
|
||||
}
|
||||
|
@ -1754,7 +1754,7 @@ namespace Microsoft.ML.Probabilistic.Models
|
|||
/// Returns a <c>VariableArray</c> object whose length is defined by <paramref name="r"/>. Each element of the array is
|
||||
/// a <c>VariableArray2D</c>object whose prototype is defined by <paramref name="array"/>.
|
||||
/// </returns>
|
||||
public static VariableArray<VariableArray2D<T>, T[][,]> Array<T>(VariableArray2D<T> array, Range r)
|
||||
public static VariableArray<VariableArray2D<T>, T[][,]> Array<T>(VariableArray2D<T> array, Microsoft.ML.Probabilistic.Models.Range r)
|
||||
{
|
||||
return new VariableArray<VariableArray2D<T>, T[][,]>(array, r);
|
||||
}
|
||||
|
@ -1769,7 +1769,7 @@ namespace Microsoft.ML.Probabilistic.Models
|
|||
/// Returns a <c>VariableArray</c> object whose length is defined by <paramref name="r"/>. Each element of the array is
|
||||
/// a <c>VariableArray2D</c>object whose prototype is defined by <paramref name="array"/>.
|
||||
/// </returns>
|
||||
public static VariableArray<VariableArray2D<T>, IArray<T[,]>> IArray<T>(VariableArray2D<T> array, Range r)
|
||||
public static VariableArray<VariableArray2D<T>, IArray<T[,]>> IArray<T>(VariableArray2D<T> array, Microsoft.ML.Probabilistic.Models.Range r)
|
||||
{
|
||||
return new VariableArray<VariableArray2D<T>, IArray<T[,]>>(array, r);
|
||||
}
|
||||
|
@ -1785,7 +1785,7 @@ namespace Microsoft.ML.Probabilistic.Models
|
|||
/// Returns a <c>VariableArray2D</c> object whose dimensions are defined by <paramref name="r1"/> and <paramref name="r2"/>.
|
||||
/// Each element of the array is a <c>VariableArray</c>object whose prototype is defined by <paramref name="array"/>.
|
||||
/// </returns>
|
||||
public static VariableArray2D<VariableArray<T>, T[,][]> Array<T>(VariableArray<T> array, Range r1, Range r2)
|
||||
public static VariableArray2D<VariableArray<T>, T[,][]> Array<T>(VariableArray<T> array, Microsoft.ML.Probabilistic.Models.Range r1, Microsoft.ML.Probabilistic.Models.Range r2)
|
||||
{
|
||||
return new VariableArray2D<VariableArray<T>, T[,][]>(array, r1, r2);
|
||||
}
|
||||
|
@ -1801,7 +1801,7 @@ namespace Microsoft.ML.Probabilistic.Models
|
|||
/// Returns a <c>VariableArray2D</c> object whose dimensions are defined by <paramref name="r1"/> and <paramref name="r2"/>.
|
||||
/// Each element of the array is a <c>VariableArray</c>object whose prototype is defined by <paramref name="array"/>.
|
||||
/// </returns>
|
||||
public static VariableArray2D<VariableArray<T>, IArray2D<T[]>> IArray<T>(VariableArray<T> array, Range r1, Range r2)
|
||||
public static VariableArray2D<VariableArray<T>, IArray2D<T[]>> IArray<T>(VariableArray<T> array, Microsoft.ML.Probabilistic.Models.Range r1, Microsoft.ML.Probabilistic.Models.Range r2)
|
||||
{
|
||||
return new VariableArray2D<VariableArray<T>, IArray2D<T[]>>(array, r1, r2);
|
||||
}
|
||||
|
@ -1819,7 +1819,7 @@ namespace Microsoft.ML.Probabilistic.Models
|
|||
/// and <paramref name="r3"/>.
|
||||
/// Each element of the array is a 1D <c>VariableArray</c>object whose prototype is defined by <paramref name="array"/>.
|
||||
/// </returns>
|
||||
public static VariableArray3D<VariableArray<T>, T[,,][]> Array<T>(VariableArray<T> array, Range r1, Range r2, Range r3)
|
||||
public static VariableArray3D<VariableArray<T>, T[,,][]> Array<T>(VariableArray<T> array, Microsoft.ML.Probabilistic.Models.Range r1, Microsoft.ML.Probabilistic.Models.Range r2, Microsoft.ML.Probabilistic.Models.Range r3)
|
||||
{
|
||||
return new VariableArray3D<VariableArray<T>, T[,,][]>(array, r1, r2, r3);
|
||||
}
|
||||
|
@ -1833,7 +1833,7 @@ namespace Microsoft.ML.Probabilistic.Models
|
|||
/// <param name="r">A <c>Range</c> object that specifies the array length.</param>
|
||||
/// <returns>Returns a <c>VariableArray</c> object whose length is defined by <paramref name="r"/>. Each element of this
|
||||
/// array is a object of type <c>VariableArray<TItem,TArray></c></returns>
|
||||
public static VariableArray<VariableArray<TItem, TArray>, TArray[]> Array<TItem, TArray>(VariableArray<TItem, TArray> array, Range r)
|
||||
public static VariableArray<VariableArray<TItem, TArray>, TArray[]> Array<TItem, TArray>(VariableArray<TItem, TArray> array, Microsoft.ML.Probabilistic.Models.Range r)
|
||||
where TItem : Variable, SettableTo<TItem>, ICloneable
|
||||
{
|
||||
return new VariableArray<VariableArray<TItem, TArray>, TArray[]>(array, r);
|
||||
|
@ -1848,7 +1848,7 @@ namespace Microsoft.ML.Probabilistic.Models
|
|||
/// <param name="r">A <c>Range</c> object that specifies the array length.</param>
|
||||
/// <returns>Returns a <c>VariableArray</c> object whose length is defined by <paramref name="r"/>. Each element of this
|
||||
/// array is a object of type <c>VariableArray<TItem,TArray></c></returns>
|
||||
public static VariableArray<VariableArray<TItem, TArray>, IList<TArray>> IList<TItem, TArray>(VariableArray<TItem, TArray> array, Range r)
|
||||
public static VariableArray<VariableArray<TItem, TArray>, IList<TArray>> IList<TItem, TArray>(VariableArray<TItem, TArray> array, Microsoft.ML.Probabilistic.Models.Range r)
|
||||
where TItem : Variable, SettableTo<TItem>, ICloneable
|
||||
{
|
||||
return new VariableArray<VariableArray<TItem, TArray>, IList<TArray>>(array, r);
|
||||
|
@ -1863,7 +1863,7 @@ namespace Microsoft.ML.Probabilistic.Models
|
|||
/// <param name="r">A <c>Range</c> object that specifies the array length.</param>
|
||||
/// <returns>Returns a <c>VariableArray</c> object whose length is defined by <paramref name="r"/>. Each element of this
|
||||
/// array is a object of type <c>VariableArray<TItem,TArray></c></returns>
|
||||
public static VariableArray<VariableArray<TItem, TArray>, IArray<TArray>> IArray<TItem, TArray>(VariableArray<TItem, TArray> array, Range r)
|
||||
public static VariableArray<VariableArray<TItem, TArray>, IArray<TArray>> IArray<TItem, TArray>(VariableArray<TItem, TArray> array, Microsoft.ML.Probabilistic.Models.Range r)
|
||||
where TItem : Variable, SettableTo<TItem>, ICloneable
|
||||
{
|
||||
return new VariableArray<VariableArray<TItem, TArray>, IArray<TArray>>(array, r);
|
||||
|
@ -1878,7 +1878,7 @@ namespace Microsoft.ML.Probabilistic.Models
|
|||
/// <param name="r">A <c>Range</c> object that is initialized with the array's length.</param>
|
||||
/// <returns>Returns a <c>VariableArray</c> object whose length is also defined by <paramref name="r"/>. Each element of this
|
||||
/// array is a object of type <c>TItem</c> whose prototype is defined by <paramref name="itemPrototype"/>.</returns>
|
||||
public static VariableArray<TItem, TArray> Array<TItem, TArray>(TItem itemPrototype, Range r)
|
||||
public static VariableArray<TItem, TArray> Array<TItem, TArray>(TItem itemPrototype, Microsoft.ML.Probabilistic.Models.Range r)
|
||||
where TItem : Variable, SettableTo<TItem>, ICloneable
|
||||
{
|
||||
return new VariableArray<TItem, TArray>(itemPrototype, r);
|
||||
|
@ -2322,7 +2322,7 @@ namespace Microsoft.ML.Probabilistic.Models
|
|||
/// <returns>A <see cref="SparseBernoulliList"/> distributed random variable</returns>
|
||||
public static VariableArray<Variable<bool>, ISparseList<bool>> BernoulliList(ISparseList<double> probTrue)
|
||||
{
|
||||
var range = new Range(probTrue.Count);
|
||||
var range = new Microsoft.ML.Probabilistic.Models.Range(probTrue.Count);
|
||||
var list = ISparseList<bool>(range);
|
||||
list.SetTo(Variable<ISparseList<bool>>.Random(SparseBernoulliList.FromProbTrue(probTrue)));
|
||||
return list;
|
||||
|
@ -2366,10 +2366,10 @@ namespace Microsoft.ML.Probabilistic.Models
|
|||
/// <summary>
|
||||
/// Creates a random variable whose domain is a fixed-length list of type integer.
|
||||
/// </summary>
|
||||
/// <param name="range">A Range defining the length of the list</param>
|
||||
/// <param name="range">A Microsoft.ML.Probabilistic.Models.Range defining the length of the list</param>
|
||||
/// <param name="probInSubset">The probability of a given integer being in the random list. This is given as random variable over a sparse list - i.e. most of the probabilities are the same.</param>
|
||||
/// <returns>A <see cref="Distributions.BernoulliIntegerSubset"/> distributed random variable</returns>
|
||||
public static VariableArray<Variable<int>, IList<int>> BernoulliIntegerSubset(Range range, Variable<ISparseList<double>> probInSubset)
|
||||
public static VariableArray<Variable<int>, IList<int>> BernoulliIntegerSubset(Microsoft.ML.Probabilistic.Models.Range range, Variable<ISparseList<double>> probInSubset)
|
||||
{
|
||||
var subset = IList<int>(range);
|
||||
subset.SetTo(Distributions.BernoulliIntegerSubset.Sample, probInSubset);
|
||||
|
@ -2379,10 +2379,10 @@ namespace Microsoft.ML.Probabilistic.Models
|
|||
/// <summary>
|
||||
/// Creates a random variable whose domain is a fixed-length list of type integer.
|
||||
/// </summary>
|
||||
/// <param name="range">A Range defining the length of the list</param>
|
||||
/// <param name="range">A Microsoft.ML.Probabilistic.Models.Range defining the length of the list</param>
|
||||
/// <param name="probInSubset">The probability of a given integer being in the random list. This is given as a sparse list - i.e. most of the probabilities are the same.</param>
|
||||
/// <returns>A <see cref="Distributions.BernoulliIntegerSubset"/> distributed random variable</returns>
|
||||
public static VariableArray<Variable<int>, IList<int>> BernoulliIntegerSubset(Range range, ISparseList<double> probInSubset)
|
||||
public static VariableArray<Variable<int>, IList<int>> BernoulliIntegerSubset(Microsoft.ML.Probabilistic.Models.Range range, ISparseList<double> probInSubset)
|
||||
{
|
||||
var subset = IList<int>(range);
|
||||
subset.SetTo(Variable<IList<int>>.Random(Distributions.BernoulliIntegerSubset.FromProbTrue(probInSubset)));
|
||||
|
@ -2445,7 +2445,7 @@ namespace Microsoft.ML.Probabilistic.Models
|
|||
/// <paramref name="probs"/> contains only one element.
|
||||
/// To specify a uniform Discrete distribution, use <c>Variable.DiscreteUniform.</c>
|
||||
/// </exception>
|
||||
public static Variable<int> Discrete(Range valueRange, params double[] probs)
|
||||
public static Variable<int> Discrete(Microsoft.ML.Probabilistic.Models.Range valueRange, params double[] probs)
|
||||
{
|
||||
if (probs.Length == 0) return DiscreteUniform(valueRange);
|
||||
else
|
||||
|
@ -2479,7 +2479,7 @@ namespace Microsoft.ML.Probabilistic.Models
|
|||
/// <param name="v">A <c>Vector</c> object that specifies the probability of each possible value, from [0, probs.Length-1].
|
||||
/// The probabilities should sum to 1.0. If not, the probabilities will be normalized.</param>
|
||||
/// <returns>Returns a random variable that is statistically defined by the specified Discrete distribution.</returns>
|
||||
public static Variable<int> Discrete(Range valueRange, Vector v)
|
||||
public static Variable<int> Discrete(Microsoft.ML.Probabilistic.Models.Range valueRange, Vector v)
|
||||
{
|
||||
if (valueRange.SizeAsInt != v.Count) throw new ArgumentException($"Vector length ({v.Count}) != range.Size ({valueRange.SizeAsInt})");
|
||||
var rv = Discrete(v.ToArray()).Attrib(new ValueRange(valueRange));
|
||||
|
@ -2504,7 +2504,7 @@ namespace Microsoft.ML.Probabilistic.Models
|
|||
/// </summary>
|
||||
/// <param name="range">A <c>Range</c> object specifying the number of possible values.</param>
|
||||
/// <returns>A random integer with an equal probability of taking any value in the range.</returns>
|
||||
public static Variable<int> DiscreteUniform(Range range)
|
||||
public static Variable<int> DiscreteUniform(Microsoft.ML.Probabilistic.Models.Range range)
|
||||
{
|
||||
Variable<int> sample = Variable.New<int>();
|
||||
sample.SetTo(Factor.DiscreteUniform, range.Size);
|
||||
|
@ -2521,7 +2521,7 @@ namespace Microsoft.ML.Probabilistic.Models
|
|||
public static Variable<int> DiscreteUniform(Variable<int> size)
|
||||
{
|
||||
Variable<int> sample = Variable<int>.Factor(Factors.Factor.DiscreteUniform, size);
|
||||
Range valueRange = size.GetValueRange(false);
|
||||
Microsoft.ML.Probabilistic.Models.Range valueRange = size.GetValueRange(false);
|
||||
if (valueRange != null) sample.AddAttribute(new ValueRange(valueRange));
|
||||
return sample;
|
||||
}
|
||||
|
@ -2534,7 +2534,7 @@ namespace Microsoft.ML.Probabilistic.Models
|
|||
/// <param name="size">A random variable that represents the dimension of the discrete distribution.</param>
|
||||
/// <returns>Returns a random variable that is statistically defined by a Discrete distribution with equal
|
||||
/// probabilities for each possible value.</returns>
|
||||
public static Variable<int> DiscreteUniform(Range valueRange, Variable<int> size)
|
||||
public static Variable<int> DiscreteUniform(Microsoft.ML.Probabilistic.Models.Range valueRange, Variable<int> size)
|
||||
{
|
||||
Variable<int> sample = Variable<int>.Factor(Factors.Factor.DiscreteUniform, size);
|
||||
sample.AddAttribute(new ValueRange(valueRange));
|
||||
|
@ -2551,7 +2551,7 @@ namespace Microsoft.ML.Probabilistic.Models
|
|||
public static Variable<int> Discrete(Variable<Vector> probs)
|
||||
{
|
||||
Variable<int> v = Variable<int>.Factor(Factor.Discrete, probs);
|
||||
Range range = probs.GetValueRange(false);
|
||||
Microsoft.ML.Probabilistic.Models.Range range = probs.GetValueRange(false);
|
||||
if (range != null) v.AddAttribute(new ValueRange(range));
|
||||
SparsityAttribute sparsityAttr = probs.GetFirstAttribute<SparsityAttribute>();
|
||||
if (sparsityAttr != null && sparsityAttr.Sparsity != null)
|
||||
|
@ -2567,10 +2567,10 @@ namespace Microsoft.ML.Probabilistic.Models
|
|||
/// <param name="valueRange">A range defining the possible values for the variable.</param>
|
||||
/// <param name="probs">A variable holding the set of probabilities of having each value. Must add up to one.</param>
|
||||
/// <returns>Returns a random variable that is statistically defined by the specified Discrete distribution.</returns>
|
||||
public static Variable<int> Discrete(Range valueRange, Variable<Vector> probs)
|
||||
public static Variable<int> Discrete(Microsoft.ML.Probabilistic.Models.Range valueRange, Variable<Vector> probs)
|
||||
{
|
||||
Variable<int> v = Variable<int>.Factor(Factor.Discrete, probs);
|
||||
Range range2 = probs.GetValueRange(false);
|
||||
Microsoft.ML.Probabilistic.Models.Range range2 = probs.GetValueRange(false);
|
||||
if (range2 != null && !valueRange.IsCompatibleWith(range2))
|
||||
throw new ArgumentException(probs + " has ValueRange '" + range2 + "', which is inconsistent with the provided range '" + valueRange + "'. Try omitting '" +
|
||||
valueRange + "'");
|
||||
|
@ -2592,7 +2592,7 @@ namespace Microsoft.ML.Probabilistic.Models
|
|||
public static Variable<TEnum> EnumDiscrete<TEnum>(Variable<Vector> probs)
|
||||
{
|
||||
var v = Variable<TEnum>.Factor(EnumSupport.DiscreteEnum<TEnum>, probs);
|
||||
Range range = probs.GetValueRange(false);
|
||||
Microsoft.ML.Probabilistic.Models.Range range = probs.GetValueRange(false);
|
||||
if (range != null) v.AddAttribute(new ValueRange(range));
|
||||
return v;
|
||||
}
|
||||
|
@ -2608,7 +2608,7 @@ namespace Microsoft.ML.Probabilistic.Models
|
|||
public static Variable<TEnum> EnumDiscrete<TEnum>(params double[] probs)
|
||||
{
|
||||
int valueCount = Enum.GetValues(typeof(TEnum)).Length;
|
||||
return EnumDiscrete<TEnum>(new Range(valueCount), probs);
|
||||
return EnumDiscrete<TEnum>(new Microsoft.ML.Probabilistic.Models.Range(valueCount), probs);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
@ -2621,7 +2621,7 @@ namespace Microsoft.ML.Probabilistic.Models
|
|||
/// values. The probabilities must sum to one. If not, they will be normalized.</param>
|
||||
/// <returns>Returns a random variable that is statistically defined by the specified Discrete distribution.
|
||||
/// </returns>
|
||||
public static Variable<TEnum> EnumDiscrete<TEnum>(Range valueRange, params double[] probs)
|
||||
public static Variable<TEnum> EnumDiscrete<TEnum>(Microsoft.ML.Probabilistic.Models.Range valueRange, params double[] probs)
|
||||
{
|
||||
if (probs.Length == 0) return EnumUniform<TEnum>(valueRange);
|
||||
int valueCount = Enum.GetValues(typeof(TEnum)).Length;
|
||||
|
@ -2653,7 +2653,7 @@ namespace Microsoft.ML.Probabilistic.Models
|
|||
/// <param name="probs">The vector of probabilities of having each value. Must add up to one.</param>
|
||||
/// <returns>Returns a random variable that is statistically defined by the specified Discrete distribution.
|
||||
/// </returns>
|
||||
public static Variable<TEnum> EnumDiscrete<TEnum>(Range valueRange, Vector probs)
|
||||
public static Variable<TEnum> EnumDiscrete<TEnum>(Microsoft.ML.Probabilistic.Models.Range valueRange, Vector probs)
|
||||
{
|
||||
return EnumDiscrete<TEnum>(valueRange, probs.ToArray());
|
||||
}
|
||||
|
@ -2668,7 +2668,7 @@ namespace Microsoft.ML.Probabilistic.Models
|
|||
public static Variable<TEnum> EnumUniform<TEnum>()
|
||||
{
|
||||
int valueCount = Enum.GetValues(typeof(TEnum)).Length;
|
||||
return EnumUniform<TEnum>(new Range(valueCount));
|
||||
return EnumUniform<TEnum>(new Microsoft.ML.Probabilistic.Models.Range(valueCount));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
@ -2678,7 +2678,7 @@ namespace Microsoft.ML.Probabilistic.Models
|
|||
/// <typeparam name="TEnum">The type of the enum</typeparam>
|
||||
/// <param name="valueRange">A range over the enum values.</param>
|
||||
/// <returns>Enum random variable</returns>
|
||||
public static Variable<TEnum> EnumUniform<TEnum>(Range valueRange)
|
||||
public static Variable<TEnum> EnumUniform<TEnum>(Microsoft.ML.Probabilistic.Models.Range valueRange)
|
||||
{
|
||||
var prior = Variable<DiscreteEnum<TEnum>>.Factor(DiscreteEnum<TEnum>.Uniform).Attrib(new DoNotInfer());
|
||||
return Variable<TEnum>.Random(prior)
|
||||
|
@ -2801,7 +2801,7 @@ namespace Microsoft.ML.Probabilistic.Models
|
|||
/// distribution's dimensionality.</param>
|
||||
/// <returns>Returns a uniform Dirichlet-distributed random variable. The distribution's pseudo-counts are
|
||||
/// all set to 1.</returns>
|
||||
public static Variable<Vector> DirichletUniform(Range valueRange)
|
||||
public static Variable<Vector> DirichletUniform(Microsoft.ML.Probabilistic.Models.Range valueRange)
|
||||
{
|
||||
Variable<Dirichlet> prior = Variable.New<Dirichlet>().Attrib(new DoNotInfer());
|
||||
prior.SetTo(Distributions.Dirichlet.Uniform, valueRange.Size);
|
||||
|
@ -2847,7 +2847,7 @@ namespace Microsoft.ML.Probabilistic.Models
|
|||
/// is applied to all dimensions.</param>
|
||||
/// <returns>Returns a symmetric Dirichlet-distributed random variable with the pseudo-counts
|
||||
/// set to <paramref name="pseudocount"/>.</returns>
|
||||
public static Variable<Vector> DirichletSymmetric(Range valueRange, Variable<double> pseudocount)
|
||||
public static Variable<Vector> DirichletSymmetric(Microsoft.ML.Probabilistic.Models.Range valueRange, Variable<double> pseudocount)
|
||||
{
|
||||
Variable<Vector> v = Variable.New<Vector>();
|
||||
v.SetTo(Factor.DirichletSymmetric, valueRange.Size, pseudocount);
|
||||
|
@ -2875,7 +2875,7 @@ namespace Microsoft.ML.Probabilistic.Models
|
|||
/// distribution's dimensionality.</param>
|
||||
/// <param name="u">An array containing the pseudo-counts.</param>
|
||||
/// <returns>Returns a Dirichlet-distributed random variable of dimension <paramref name="u"/></returns>
|
||||
public static Variable<Vector> Dirichlet(Range valueRange, double[] u)
|
||||
public static Variable<Vector> Dirichlet(Microsoft.ML.Probabilistic.Models.Range valueRange, double[] u)
|
||||
{
|
||||
if (valueRange.SizeAsInt != u.Length)
|
||||
{
|
||||
|
@ -2925,7 +2925,7 @@ namespace Microsoft.ML.Probabilistic.Models
|
|||
/// <returns>Returns a Dirichlet-distributed random variable with the dimensionality specified by
|
||||
/// <paramref name="valueRange"/> and the pseudo-counts specified
|
||||
/// by <paramref name="v"/>.</returns>
|
||||
public static Variable<Vector> Dirichlet(Range valueRange, Vector v)
|
||||
public static Variable<Vector> Dirichlet(Microsoft.ML.Probabilistic.Models.Range valueRange, Vector v)
|
||||
{
|
||||
if (valueRange.SizeAsInt != v.Count)
|
||||
{
|
||||
|
@ -2944,7 +2944,7 @@ namespace Microsoft.ML.Probabilistic.Models
|
|||
/// <returns>Returns a Dirichlet-distributed random variable with the dimensionality specified by
|
||||
/// <paramref name="valueRange"/> and the pseudo-counts specified
|
||||
/// by <paramref name="v"/>.</returns>
|
||||
public static Variable<Vector> Dirichlet(Range valueRange, Variable<Vector> v)
|
||||
public static Variable<Vector> Dirichlet(Microsoft.ML.Probabilistic.Models.Range valueRange, Variable<Vector> v)
|
||||
{
|
||||
return Dirichlet(v).Attrib(new ValueRange(valueRange));
|
||||
}
|
||||
|
@ -3023,7 +3023,7 @@ namespace Microsoft.ML.Probabilistic.Models
|
|||
{
|
||||
var sample = Variable<int>.Factor(Rand.Binomial, Constant(trialCount), probSuccess);
|
||||
// sample ranges from 0 to trialCount
|
||||
Range valueRange = new Range(trialCount + 1);
|
||||
Microsoft.ML.Probabilistic.Models.Range valueRange = new Microsoft.ML.Probabilistic.Models.Range(trialCount + 1);
|
||||
sample.SetValueRange(valueRange);
|
||||
return sample;
|
||||
}
|
||||
|
@ -3039,7 +3039,7 @@ namespace Microsoft.ML.Probabilistic.Models
|
|||
Variable<int> sample = Variable<int>.Factor(Rand.Binomial, trialCount, probSuccess);
|
||||
// if trialCount ranges from 0 to valueRange.Size-1
|
||||
// then sample also ranges from 0 to valueRange.Size-1
|
||||
Range valueRange = trialCount.GetValueRange(false);
|
||||
Microsoft.ML.Probabilistic.Models.Range valueRange = trialCount.GetValueRange(false);
|
||||
if (valueRange != null)
|
||||
sample.SetValueRange(valueRange);
|
||||
return sample;
|
||||
|
@ -3067,7 +3067,7 @@ namespace Microsoft.ML.Probabilistic.Models
|
|||
/// <returns></returns>
|
||||
public static VariableArray<int> Multinomial(Variable<int> trialCount, Variable<Vector> probs)
|
||||
{
|
||||
Range valueRange = probs.GetValueRange();
|
||||
Microsoft.ML.Probabilistic.Models.Range valueRange = probs.GetValueRange();
|
||||
VariableArray<int> samples = Variable.Array<int>(valueRange);
|
||||
// SetTo(Variable.Factor(...)) will not work here
|
||||
samples.SetTo(Rand.Multinomial, trialCount, probs);
|
||||
|
@ -3083,7 +3083,7 @@ namespace Microsoft.ML.Probabilistic.Models
|
|||
public static VariableArray<int> Multinomial(Variable<int> trialCount, Vector probs)
|
||||
{
|
||||
Variable<Vector> probsVar = Constant(probs);
|
||||
Range valueRange = new Range(probs.Count);
|
||||
Microsoft.ML.Probabilistic.Models.Range valueRange = new Microsoft.ML.Probabilistic.Models.Range(probs.Count);
|
||||
probsVar.SetValueRange(valueRange);
|
||||
return Multinomial(trialCount, probsVar);
|
||||
}
|
||||
|
@ -3094,9 +3094,9 @@ namespace Microsoft.ML.Probabilistic.Models
|
|||
/// <param name="trials">A range whose length is the number of trials. This is becomes the ValueRange for each x[i].</param>
|
||||
/// <param name="probs">A variable containing the probability distribution for drawing each value per trial. Must have a ValueRange attribute specifying the number of possible values.</param>
|
||||
/// <returns></returns>
|
||||
public static VariableArray<int> Multinomial(Range trials, Variable<Vector> probs)
|
||||
public static VariableArray<int> Multinomial(Microsoft.ML.Probabilistic.Models.Range trials, Variable<Vector> probs)
|
||||
{
|
||||
Range valueRange = probs.GetValueRange();
|
||||
Microsoft.ML.Probabilistic.Models.Range valueRange = probs.GetValueRange();
|
||||
VariableArray<int> samples = Variable.Array<int>(valueRange);
|
||||
samples.SetValueRange(trials);
|
||||
samples.SetTo(Rand.Multinomial, trials.Size, probs);
|
||||
|
@ -3201,7 +3201,7 @@ namespace Microsoft.ML.Probabilistic.Models
|
|||
/// <returns><c>sum_i a[i]*b[i]</c></returns>
|
||||
public static Variable<double> SumWhere(VariableArray<bool> a, Variable<Vector> b)
|
||||
{
|
||||
Range range = a.Range;
|
||||
Microsoft.ML.Probabilistic.Models.Range range = a.Range;
|
||||
var aDouble = Variable.Double(a[range]);
|
||||
return Variable.InnerProduct((VariableArray<double>)aDouble.ArrayVariable, b);
|
||||
}
|
||||
|
@ -3215,7 +3215,7 @@ namespace Microsoft.ML.Probabilistic.Models
|
|||
public static Variable<double> SumWhere(VariableArray<bool> a, VariableArray<double> b)
|
||||
{
|
||||
var blocks = OpenRangesInExpression(a);
|
||||
Range range = a.Range;
|
||||
Microsoft.ML.Probabilistic.Models.Range range = a.Range;
|
||||
VariableArray<double> products = Variable.Array<double>(range);
|
||||
using (Variable.ForEach(range))
|
||||
{
|
||||
|
@ -3342,7 +3342,7 @@ namespace Microsoft.ML.Probabilistic.Models
|
|||
public static Variable<double> Sum_Expanded(VariableArray<double> array)
|
||||
{
|
||||
var blocks = OpenRangesInExpression(array);
|
||||
Range n = array.Range;
|
||||
Microsoft.ML.Probabilistic.Models.Range n = array.Range;
|
||||
var sumUpTo = Variable.Array<double>(n);
|
||||
sumUpTo.Name = array.ToString() + "_sumUpTo";
|
||||
sumUpTo.AddAttribute(new DoNotInfer());
|
||||
|
@ -3397,7 +3397,7 @@ namespace Microsoft.ML.Probabilistic.Models
|
|||
private static List<Range> GetRangesNotOpen(IModelExpression modelExpressionWithRanges)
|
||||
{
|
||||
List<Range> ranges = new List<Range>();
|
||||
MethodInvoke.ForEachRange(modelExpressionWithRanges, delegate (Range r)
|
||||
MethodInvoke.ForEachRange(modelExpressionWithRanges, delegate (Microsoft.ML.Probabilistic.Models.Range r)
|
||||
{
|
||||
if (!ranges.Contains(r))
|
||||
ranges.Add(r);
|
||||
|
@ -3652,7 +3652,7 @@ namespace Microsoft.ML.Probabilistic.Models
|
|||
/// <param name="vector">A random vector</param>
|
||||
/// <param name="range">The range to use for indexing the array. Must match the length of the vector.</param>
|
||||
/// <returns>A new array whose elements are equal to the elements of the vector</returns>
|
||||
public static VariableArray<double> ArrayFromVector(Variable<Vector> vector, Range range)
|
||||
public static VariableArray<double> ArrayFromVector(Variable<Vector> vector, Microsoft.ML.Probabilistic.Models.Range range)
|
||||
{
|
||||
VariableArray<double> result = Variable.Array<double>(range);
|
||||
// SetTo(Variable.Factor(...)) will not work here
|
||||
|
@ -3669,7 +3669,7 @@ namespace Microsoft.ML.Probabilistic.Models
|
|||
/// <param name="tailRange">The range associated with the tail array</param>
|
||||
/// <param name="tail">On return, holds the remaining elements</param>
|
||||
/// <returns>The initial elements of <paramref name="array"/></returns>
|
||||
public static VariableArray<T> Split<T>(VariableArray<T> array, Range headRange, Range tailRange, out VariableArray<T> tail)
|
||||
public static VariableArray<T> Split<T>(VariableArray<T> array, Microsoft.ML.Probabilistic.Models.Range headRange, Microsoft.ML.Probabilistic.Models.Range tailRange, out VariableArray<T> tail)
|
||||
{
|
||||
VariableArray<T> head = Variable.Array<T>(headRange);
|
||||
tail = Variable.Array<T>(tailRange);
|
||||
|
@ -3687,7 +3687,7 @@ namespace Microsoft.ML.Probabilistic.Models
|
|||
/// <param name="tailRange">The range associated with the tail array</param>
|
||||
/// <param name="tail">On return, holds the remaining elements</param>
|
||||
/// <returns>The initial elements of <paramref name="array"/></returns>
|
||||
public static VariableArray<TItem, T[]> Split<TItem, T>(VariableArray<TItem, T[]> array, Range headRange, Range tailRange, out VariableArray<TItem, T[]> tail)
|
||||
public static VariableArray<TItem, T[]> Split<TItem, T>(VariableArray<TItem, T[]> array, Microsoft.ML.Probabilistic.Models.Range headRange, Microsoft.ML.Probabilistic.Models.Range tailRange, out VariableArray<TItem, T[]> tail)
|
||||
where TItem : Variable, ICloneable, SettableTo<TItem>
|
||||
{
|
||||
VariableArray<TItem, T[]> head = ReplaceRanges(array, headRange);
|
||||
|
@ -3729,7 +3729,7 @@ namespace Microsoft.ML.Probabilistic.Models
|
|||
public static Variable<T> Copy<T>(Variable<T> x)
|
||||
{
|
||||
Variable<T> result = Variable<T>.Factor(Clone.Copy<T>, x);
|
||||
Range valueRange = x.GetValueRange(false);
|
||||
Microsoft.ML.Probabilistic.Models.Range valueRange = x.GetValueRange(false);
|
||||
if (valueRange != null)
|
||||
result.AddAttribute(new ValueRange(valueRange));
|
||||
return result;
|
||||
|
@ -3860,7 +3860,7 @@ namespace Microsoft.ML.Probabilistic.Models
|
|||
public static Variable<T> CutForwardWhen<T>(Variable<T> x, Variable<bool> shouldCut)
|
||||
{
|
||||
Variable<T> result = Variable<T>.Factor(Factors.Cut.ForwardWhen, x, shouldCut);
|
||||
Range valueRange = x.GetValueRange(false);
|
||||
Microsoft.ML.Probabilistic.Models.Range valueRange = x.GetValueRange(false);
|
||||
if (valueRange != null)
|
||||
result.AddAttribute(new ValueRange(valueRange));
|
||||
return result;
|
||||
|
@ -3876,7 +3876,7 @@ namespace Microsoft.ML.Probabilistic.Models
|
|||
public static Variable<T> Cut<T>(Variable<T> x)
|
||||
{
|
||||
Variable<T> result = Variable<T>.Factor(Factors.Cut.Backward, x);
|
||||
Range valueRange = x.GetValueRange(false);
|
||||
Microsoft.ML.Probabilistic.Models.Range valueRange = x.GetValueRange(false);
|
||||
if (valueRange != null)
|
||||
result.AddAttribute(new ValueRange(valueRange));
|
||||
return result;
|
||||
|
@ -3919,7 +3919,7 @@ namespace Microsoft.ML.Probabilistic.Models
|
|||
/// <param name="value">The value to replicate.</param>
|
||||
/// <param name="range">The range used to index the output array.</param>
|
||||
/// <returns>The array of replicated values.</returns>
|
||||
public static VariableArray<T> Replicate<T>(Variable<T> value, Range range)
|
||||
public static VariableArray<T> Replicate<T>(Variable<T> value, Microsoft.ML.Probabilistic.Models.Range range)
|
||||
{
|
||||
var result = Array<T>(range);
|
||||
CreateVariableArray(result, value);
|
||||
|
@ -3934,7 +3934,7 @@ namespace Microsoft.ML.Probabilistic.Models
|
|||
/// <param name="array">The array to replicate.</param>
|
||||
/// <param name="range">The range used to index the output array.</param>
|
||||
/// <returns>The array of replicated arrays.</returns>
|
||||
public static VariableArray<VariableArray<T>, T[][]> Replicate<T>(VariableArray<T> array, Range range)
|
||||
public static VariableArray<VariableArray<T>, T[][]> Replicate<T>(VariableArray<T> array, Microsoft.ML.Probabilistic.Models.Range range)
|
||||
{
|
||||
var result = Array<T>(array, range);
|
||||
CreateVariableArray(result, array);
|
||||
|
@ -3949,7 +3949,7 @@ namespace Microsoft.ML.Probabilistic.Models
|
|||
/// <param name="array">The array to replicate.</param>
|
||||
/// <param name="range">The range used to index the output array.</param>
|
||||
/// <returns>The array of replicated arrays.</returns>
|
||||
public static VariableArray<VariableArray<VariableArray<T>, T[][]>, T[][][]> Replicate<T>(VariableArray<VariableArray<T>, T[][]> array, Range range)
|
||||
public static VariableArray<VariableArray<VariableArray<T>, T[][]>, T[][][]> Replicate<T>(VariableArray<VariableArray<T>, T[][]> array, Microsoft.ML.Probabilistic.Models.Range range)
|
||||
{
|
||||
var result = Array(array, range);
|
||||
CreateVariableArray(result, array);
|
||||
|
@ -3966,7 +3966,7 @@ namespace Microsoft.ML.Probabilistic.Models
|
|||
/// <param name="array">The array to replicate.</param>
|
||||
/// <param name="range">The range used to index the output array.</param>
|
||||
/// <returns>The array of replicated arrays.</returns>
|
||||
public static VariableArray<VariableArray<VariableArray<TItem, T>, T[]>, T[][]> Replicate<TItem, T>(VariableArray<VariableArray<TItem, T>, T[]> array, Range range)
|
||||
public static VariableArray<VariableArray<VariableArray<TItem, T>, T[]>, T[][]> Replicate<TItem, T>(VariableArray<VariableArray<TItem, T>, T[]> array, Microsoft.ML.Probabilistic.Models.Range range)
|
||||
where TItem : Variable, ICloneable, SettableTo<TItem>
|
||||
{
|
||||
var result = Array(array, range);
|
||||
|
@ -4206,7 +4206,7 @@ namespace Microsoft.ML.Probabilistic.Models
|
|||
/// <param name="array"></param>
|
||||
/// <param name="newRange"></param>
|
||||
/// <returns></returns>
|
||||
private static VariableArray<TItem, T[]> ReplaceRanges<TItem, T>(VariableArray<TItem, T[]> array, Range newRange)
|
||||
private static VariableArray<TItem, T[]> ReplaceRanges<TItem, T>(VariableArray<TItem, T[]> array, Microsoft.ML.Probabilistic.Models.Range newRange)
|
||||
where TItem : Variable, ICloneable, SettableTo<TItem>
|
||||
{
|
||||
Dictionary<Range, Range> replacements = new Dictionary<Range, Range>();
|
||||
|
@ -4773,7 +4773,7 @@ namespace Microsoft.ML.Probabilistic.Models
|
|||
/// </remarks>
|
||||
public static Variable<string> StringFormat(Variable<string> format, params Variable<string>[] args)
|
||||
{
|
||||
var argsRange = new Range(args.Length);
|
||||
var argsRange = new Microsoft.ML.Probabilistic.Models.Range(args.Length);
|
||||
VariableArray<string> argsArray = Variable.Array<string>(argsRange);
|
||||
argsArray.AddAttribute(new DoNotInfer());
|
||||
for (int i = 0; i < args.Length; ++i)
|
||||
|
@ -5231,7 +5231,7 @@ namespace Microsoft.ML.Probabilistic.Models
|
|||
/// <returns>A SwitchBlock object which must be closed before inference is performed.</returns>
|
||||
public static SwitchBlock Switch(Variable<int> i)
|
||||
{
|
||||
Range range = i.GetValueRange();
|
||||
Microsoft.ML.Probabilistic.Models.Range range = i.GetValueRange();
|
||||
return new SwitchBlock(i, range);
|
||||
}
|
||||
|
||||
|
@ -5428,7 +5428,7 @@ namespace Microsoft.ML.Probabilistic.Models
|
|||
isReadOnly = that.IsReadOnly;
|
||||
}
|
||||
|
||||
internal Variable(Range range)
|
||||
internal Variable(Microsoft.ML.Probabilistic.Models.Range range)
|
||||
: this()
|
||||
{
|
||||
loopRange = range;
|
||||
|
@ -5617,7 +5617,7 @@ namespace Microsoft.ML.Probabilistic.Models
|
|||
{
|
||||
List<Range> headRanges;
|
||||
List<Range> tailRanges = new List<Range>(ranges.Skip(1, out headRanges));
|
||||
Range headRange = headRanges[0];
|
||||
Microsoft.ML.Probabilistic.Models.Range headRange = headRanges[0];
|
||||
ForEachBlock block = Variable.ForEach(headRange);
|
||||
IVariableArray array = CreateVariableArrayFromItem(item, tailRanges);
|
||||
block.CloseBlock();
|
||||
|
@ -5631,9 +5631,9 @@ namespace Microsoft.ML.Probabilistic.Models
|
|||
// check for jagged dependencies
|
||||
Set<Range> previousRanges = new Set<Range>();
|
||||
bool isJagged = false;
|
||||
foreach (Range range in ranges)
|
||||
foreach (Microsoft.ML.Probabilistic.Models.Range range in ranges)
|
||||
{
|
||||
Models.MethodInvoke.ForEachRange(range.Size, delegate (Range r) { if (previousRanges.Contains(r)) isJagged = true; });
|
||||
Models.MethodInvoke.ForEachRange(range.Size, delegate (Microsoft.ML.Probabilistic.Models.Range r) { if (previousRanges.Contains(r)) isJagged = true; });
|
||||
if (isJagged) break;
|
||||
previousRanges.Add(range);
|
||||
}
|
||||
|
@ -5643,7 +5643,7 @@ namespace Microsoft.ML.Probabilistic.Models
|
|||
List<Range> tailRanges = new List<Range>(ranges.Skip(previousRanges.Count, out headRanges));
|
||||
// open all the headRanges
|
||||
List<ForEachBlock> blocks = new List<ForEachBlock>();
|
||||
foreach (Range r in headRanges)
|
||||
foreach (Microsoft.ML.Probabilistic.Models.Range r in headRanges)
|
||||
{
|
||||
blocks.Add(Variable.ForEach(r));
|
||||
}
|
||||
|
@ -5692,10 +5692,10 @@ namespace Microsoft.ML.Probabilistic.Models
|
|||
containers = ((Variable)varArray).Containers;
|
||||
foreach (IModelExpression ind in inds)
|
||||
{
|
||||
if (ind is Range range)
|
||||
if (ind is Microsoft.ML.Probabilistic.Models.Range range)
|
||||
{
|
||||
Models.MethodInvoke.ForEachRange(range.Size,
|
||||
delegate (Range r)
|
||||
delegate (Microsoft.ML.Probabilistic.Models.Range r)
|
||||
{
|
||||
if (!openRanges.Contains(r))
|
||||
throw new InvalidOperationException("Range '" + range + "' depends on range '" + r + "', but range '" + r +
|
||||
|
@ -5962,7 +5962,7 @@ namespace Microsoft.ML.Probabilistic.Models
|
|||
/// </summary>
|
||||
/// <param name="range">The desired range.</param>
|
||||
/// <returns><c>this</c>, modified to range over the newly created items.</returns>
|
||||
public new Variable<T> ForEach(Range range)
|
||||
public new Variable<T> ForEach(Microsoft.ML.Probabilistic.Models.Range range)
|
||||
{
|
||||
return ForEach(new Range[] { range });
|
||||
}
|
||||
|
@ -5991,7 +5991,7 @@ namespace Microsoft.ML.Probabilistic.Models
|
|||
if (ranges.Length == 0) throw new ArgumentException("range list is empty");
|
||||
List<Range> fullRanges = new List<Range>();
|
||||
MethodInvoke.ForEachRange(this, fullRanges.Add);
|
||||
foreach (Range r in ranges)
|
||||
foreach (Microsoft.ML.Probabilistic.Models.Range r in ranges)
|
||||
{
|
||||
if (fullRanges.Contains(r)) throw new ArgumentException("ForEach is not needed on range '" + r + "' since the expression is already indexed by this range");
|
||||
fullRanges.Add(r);
|
||||
|
@ -6013,7 +6013,7 @@ namespace Microsoft.ML.Probabilistic.Models
|
|||
/// <returns>
|
||||
/// Returns a <c>VariableArray</c> object whose size is specified by <paramref name="r"/>.
|
||||
/// </returns>
|
||||
public static VariableArray<T> Array(Range r)
|
||||
public static VariableArray<T> Array(Microsoft.ML.Probabilistic.Models.Range r)
|
||||
{
|
||||
return new VariableArray<T>(r);
|
||||
}
|
||||
|
|
|
@ -16,9 +16,9 @@ namespace Microsoft.ML.Probabilistic.Models
|
|||
public interface IJaggedVariableArray<TItem> : IVariableArray
|
||||
{
|
||||
/// <summary>
|
||||
/// Range for variable array
|
||||
/// Microsoft.ML.Probabilistic.Models.Range for variable array
|
||||
/// </summary>
|
||||
Range Range { get; }
|
||||
Microsoft.ML.Probabilistic.Models.Range Range { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Sets/Gets element in array given by index expression
|
||||
|
@ -44,14 +44,14 @@ namespace Microsoft.ML.Probabilistic.Models
|
|||
where TItem : Variable, ICloneable, SettableTo<TItem>
|
||||
{
|
||||
/// <summary>
|
||||
/// Range for the array
|
||||
/// Microsoft.ML.Probabilistic.Models.Range for the array
|
||||
/// </summary>
|
||||
public Range Range
|
||||
public Microsoft.ML.Probabilistic.Models.Range Range
|
||||
{
|
||||
get { return Ranges[0]; }
|
||||
}
|
||||
|
||||
internal VariableArray(TItem itemPrototype, Range range)
|
||||
internal VariableArray(TItem itemPrototype, Microsoft.ML.Probabilistic.Models.Range range)
|
||||
: base(itemPrototype, range)
|
||||
{
|
||||
}
|
||||
|
@ -171,7 +171,7 @@ namespace Microsoft.ML.Probabilistic.Models
|
|||
IVariableArray IVariableArray.ReplaceRanges(Dictionary<Range, Range> rangeReplacements, Dictionary<IModelExpression, IModelExpression> expressionReplacements, bool deepCopy)
|
||||
{
|
||||
// must do this replacement first, since it will influence how we replace the itemPrototype
|
||||
Range newRange = Range.Replace(rangeReplacements, expressionReplacements);
|
||||
Microsoft.ML.Probabilistic.Models.Range newRange = Range.Replace(rangeReplacements, expressionReplacements);
|
||||
TItem itemPrototype = (TItem) ((IVariableJaggedArray) this).ItemPrototype;
|
||||
if (itemPrototype is IVariableArray)
|
||||
{
|
||||
|
@ -194,12 +194,12 @@ namespace Microsoft.ML.Probabilistic.Models
|
|||
/// <typeparam name="T"></typeparam>
|
||||
public class VariableArray<T> : VariableArray<Variable<T>, T[]>, IVariableArray<T>, SettableTo<VariableArray<T>>, IVariableArray
|
||||
{
|
||||
internal VariableArray(Range range)
|
||||
internal VariableArray(Microsoft.ML.Probabilistic.Models.Range range)
|
||||
: base(new Variable<T>(), range)
|
||||
{
|
||||
}
|
||||
|
||||
internal VariableArray(Variable<T> itemPrototype, Range range)
|
||||
internal VariableArray(Variable<T> itemPrototype, Microsoft.ML.Probabilistic.Models.Range range)
|
||||
: base(itemPrototype, range)
|
||||
{
|
||||
}
|
||||
|
@ -266,7 +266,7 @@ namespace Microsoft.ML.Probabilistic.Models
|
|||
|
||||
IVariableArray IVariableArray.ReplaceRanges(Dictionary<Range, Range> rangeReplacements, Dictionary<IModelExpression, IModelExpression> expressionReplacements, bool deepCopy)
|
||||
{
|
||||
Range newRange = Range.Replace(rangeReplacements, expressionReplacements);
|
||||
Microsoft.ML.Probabilistic.Models.Range newRange = Range.Replace(rangeReplacements, expressionReplacements);
|
||||
Variable<T> itemPrototype2 = itemPrototype;
|
||||
if (deepCopy)
|
||||
{
|
||||
|
|
|
@ -16,14 +16,14 @@ namespace Microsoft.ML.Probabilistic.Models
|
|||
public interface IVariableArray2D<T> : IVariable, IVariableArray
|
||||
{
|
||||
/// <summary>
|
||||
/// Range for first index
|
||||
/// Microsoft.ML.Probabilistic.Models.Range for first index
|
||||
/// </summary>
|
||||
Range Range0 { get; }
|
||||
Microsoft.ML.Probabilistic.Models.Range Range0 { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Range for second index
|
||||
/// Microsoft.ML.Probabilistic.Models.Range for second index
|
||||
/// </summary>
|
||||
Range Range1 { get; }
|
||||
Microsoft.ML.Probabilistic.Models.Range Range1 { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Sets/Gets element in array given by the index expressions
|
||||
|
@ -43,22 +43,22 @@ namespace Microsoft.ML.Probabilistic.Models
|
|||
where TItem : Variable, ICloneable, SettableTo<TItem>
|
||||
{
|
||||
/// <summary>
|
||||
/// Range for first index
|
||||
/// Microsoft.ML.Probabilistic.Models.Range for first index
|
||||
/// </summary>
|
||||
public Range Range0
|
||||
public Microsoft.ML.Probabilistic.Models.Range Range0
|
||||
{
|
||||
get { return Ranges[0]; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Range for second index
|
||||
/// Microsoft.ML.Probabilistic.Models.Range for second index
|
||||
/// </summary>
|
||||
public Range Range1
|
||||
public Microsoft.ML.Probabilistic.Models.Range Range1
|
||||
{
|
||||
get { return Ranges[1]; }
|
||||
}
|
||||
|
||||
internal VariableArray2D(TItem itemPrototype, Range range0, Range range1)
|
||||
internal VariableArray2D(TItem itemPrototype, Microsoft.ML.Probabilistic.Models.Range range0, Microsoft.ML.Probabilistic.Models.Range range1)
|
||||
: base(itemPrototype, range0, range1)
|
||||
{
|
||||
}
|
||||
|
@ -82,7 +82,7 @@ namespace Microsoft.ML.Probabilistic.Models
|
|||
/// When setting the elements of an array, the right hand side must be a fresh variable with no other uses.
|
||||
/// The right-hand side must be an item variable indexed by exactly the ranges of the array, but possibly in a different order.
|
||||
/// </remarks>
|
||||
public TItem this[Range range0, Range range1]
|
||||
public TItem this[Range range0, Microsoft.ML.Probabilistic.Models.Range range1]
|
||||
{
|
||||
get { return base[range0, range1]; }
|
||||
set { base[range0, range1] = value; }
|
||||
|
@ -114,7 +114,7 @@ namespace Microsoft.ML.Probabilistic.Models
|
|||
/// When setting the elements of an array, the right hand side must be a fresh variable with no other uses.
|
||||
/// The right-hand side must be an item variable indexed by exactly the ranges of the array, but possibly in a different order.
|
||||
/// </remarks>
|
||||
public TItem this[Variable<int> index0, Range index1]
|
||||
public TItem this[Variable<int> index0, Microsoft.ML.Probabilistic.Models.Range index1]
|
||||
{
|
||||
get { return base[index0, index1]; }
|
||||
set { base[index0, index1] = value; }
|
||||
|
@ -190,8 +190,8 @@ namespace Microsoft.ML.Probabilistic.Models
|
|||
IVariableArray IVariableArray.ReplaceRanges(Dictionary<Range, Range> rangeReplacements, Dictionary<IModelExpression, IModelExpression> expressionReplacements, bool deepCopy)
|
||||
{
|
||||
// must do this replacement first, since it will influence how we replace the itemPrototype
|
||||
Range newRange0 = Range0.Replace(rangeReplacements, expressionReplacements);
|
||||
Range newRange1 = Range1.Replace(rangeReplacements, expressionReplacements);
|
||||
Microsoft.ML.Probabilistic.Models.Range newRange0 = Range0.Replace(rangeReplacements, expressionReplacements);
|
||||
Microsoft.ML.Probabilistic.Models.Range newRange1 = Range1.Replace(rangeReplacements, expressionReplacements);
|
||||
TItem itemPrototype = (TItem) ((IVariableJaggedArray) this).ItemPrototype;
|
||||
if (itemPrototype is IVariableArray)
|
||||
{
|
||||
|
@ -213,12 +213,12 @@ namespace Microsoft.ML.Probabilistic.Models
|
|||
/// <typeparam name="T"></typeparam>
|
||||
public class VariableArray2D<T> : VariableArray2D<Variable<T>, T[,]>, IVariableArray2D<T>, SettableTo<VariableArray2D<T>>, IVariableArray
|
||||
{
|
||||
internal VariableArray2D(Range range0, Range range1)
|
||||
internal VariableArray2D(Microsoft.ML.Probabilistic.Models.Range range0, Microsoft.ML.Probabilistic.Models.Range range1)
|
||||
: base(new Variable<T>(), range0, range1)
|
||||
{
|
||||
}
|
||||
|
||||
internal VariableArray2D(Variable<T> itemPrototype, Range range0, Range range1)
|
||||
internal VariableArray2D(Variable<T> itemPrototype, Microsoft.ML.Probabilistic.Models.Range range0, Microsoft.ML.Probabilistic.Models.Range range1)
|
||||
: base(itemPrototype, range0, range1)
|
||||
{
|
||||
}
|
||||
|
@ -285,8 +285,8 @@ namespace Microsoft.ML.Probabilistic.Models
|
|||
|
||||
IVariableArray IVariableArray.ReplaceRanges(Dictionary<Range, Range> rangeReplacements, Dictionary<IModelExpression, IModelExpression> expressionReplacements, bool deepCopy)
|
||||
{
|
||||
Range newRange0 = Range0.Replace(rangeReplacements, expressionReplacements);
|
||||
Range newRange1 = Range1.Replace(rangeReplacements, expressionReplacements);
|
||||
Microsoft.ML.Probabilistic.Models.Range newRange0 = Range0.Replace(rangeReplacements, expressionReplacements);
|
||||
Microsoft.ML.Probabilistic.Models.Range newRange1 = Range1.Replace(rangeReplacements, expressionReplacements);
|
||||
Variable<T> itemPrototype2 = itemPrototype;
|
||||
if (deepCopy)
|
||||
{
|
||||
|
|
|
@ -15,19 +15,19 @@ namespace Microsoft.ML.Probabilistic.Models
|
|||
public interface IVariableArray3D<T> : IVariable, IVariableArray
|
||||
{
|
||||
/// <summary>
|
||||
/// Range for first index
|
||||
/// Microsoft.ML.Probabilistic.Models.Range for first index
|
||||
/// </summary>
|
||||
Range Range0 { get; }
|
||||
Microsoft.ML.Probabilistic.Models.Range Range0 { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Range for second index
|
||||
/// Microsoft.ML.Probabilistic.Models.Range for second index
|
||||
/// </summary>
|
||||
Range Range1 { get; }
|
||||
Microsoft.ML.Probabilistic.Models.Range Range1 { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Range for third index
|
||||
/// Microsoft.ML.Probabilistic.Models.Range for third index
|
||||
/// </summary>
|
||||
Range Range2 { get; }
|
||||
Microsoft.ML.Probabilistic.Models.Range Range2 { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Sets/Gets element in array given by the index expressions
|
||||
|
@ -48,30 +48,30 @@ namespace Microsoft.ML.Probabilistic.Models
|
|||
where TItem : Variable, ICloneable, SettableTo<TItem>
|
||||
{
|
||||
/// <summary>
|
||||
/// Range for first index
|
||||
/// Microsoft.ML.Probabilistic.Models.Range for first index
|
||||
/// </summary>
|
||||
public Range Range0
|
||||
public Microsoft.ML.Probabilistic.Models.Range Range0
|
||||
{
|
||||
get { return Ranges[0]; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Range for second index
|
||||
/// Microsoft.ML.Probabilistic.Models.Range for second index
|
||||
/// </summary>
|
||||
public Range Range1
|
||||
public Microsoft.ML.Probabilistic.Models.Range Range1
|
||||
{
|
||||
get { return Ranges[1]; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Range for third index
|
||||
/// Microsoft.ML.Probabilistic.Models.Range for third index
|
||||
/// </summary>
|
||||
public Range Range2
|
||||
public Microsoft.ML.Probabilistic.Models.Range Range2
|
||||
{
|
||||
get { return Ranges[2]; }
|
||||
}
|
||||
|
||||
internal VariableArray3D(TItem itemPrototype, Range range0, Range range1, Range range2)
|
||||
internal VariableArray3D(TItem itemPrototype, Microsoft.ML.Probabilistic.Models.Range range0, Microsoft.ML.Probabilistic.Models.Range range1, Microsoft.ML.Probabilistic.Models.Range range2)
|
||||
: base(itemPrototype, range0, range1, range2)
|
||||
{
|
||||
}
|
||||
|
@ -96,7 +96,7 @@ namespace Microsoft.ML.Probabilistic.Models
|
|||
/// When setting the elements of an array, the right hand side must be a fresh variable with no other uses.
|
||||
/// The right-hand side must be an item variable indexed by exactly the ranges of the array, but possibly in a different order.
|
||||
/// </remarks>
|
||||
public TItem this[Range range0, Range range1, Range range2]
|
||||
public TItem this[Range range0, Microsoft.ML.Probabilistic.Models.Range range1, Microsoft.ML.Probabilistic.Models.Range range2]
|
||||
{
|
||||
get { return base[range0, range1, range2]; }
|
||||
set { base[range0, range1, range2] = value; }
|
||||
|
@ -113,7 +113,7 @@ namespace Microsoft.ML.Probabilistic.Models
|
|||
/// When setting the elements of an array, the right hand side must be a fresh variable with no other uses.
|
||||
/// The right-hand side must be an item variable indexed by exactly the ranges of the array, but possibly in a different order.
|
||||
/// </remarks>
|
||||
public TItem this[Variable<int> range0, Range range1, Range range2]
|
||||
public TItem this[Variable<int> range0, Microsoft.ML.Probabilistic.Models.Range range1, Microsoft.ML.Probabilistic.Models.Range range2]
|
||||
{
|
||||
get { return base[range0, range1, range2]; }
|
||||
}
|
||||
|
@ -129,7 +129,7 @@ namespace Microsoft.ML.Probabilistic.Models
|
|||
/// When setting the elements of an array, the right hand side must be a fresh variable with no other uses.
|
||||
/// The right-hand side must be an item variable indexed by exactly the ranges of the array, but possibly in a different order.
|
||||
/// </remarks>
|
||||
public TItem this[Variable<int> range0, Variable<int> range1, Range range2]
|
||||
public TItem this[Variable<int> range0, Variable<int> range1, Microsoft.ML.Probabilistic.Models.Range range2]
|
||||
{
|
||||
get { return base[range0, range1, range2]; }
|
||||
}
|
||||
|
@ -161,7 +161,7 @@ namespace Microsoft.ML.Probabilistic.Models
|
|||
/// When setting the elements of an array, the right hand side must be a fresh variable with no other uses.
|
||||
/// The right-hand side must be an item variable indexed by exactly the ranges of the array, but possibly in a different order.
|
||||
/// </remarks>
|
||||
public TItem this[Variable<int> range0, Range range1, Variable<int> range2]
|
||||
public TItem this[Variable<int> range0, Microsoft.ML.Probabilistic.Models.Range range1, Variable<int> range2]
|
||||
{
|
||||
get { return base[range0, range1, range2]; }
|
||||
}
|
||||
|
@ -177,7 +177,7 @@ namespace Microsoft.ML.Probabilistic.Models
|
|||
/// When setting the elements of an array, the right hand side must be a fresh variable with no other uses.
|
||||
/// The right-hand side must be an item variable indexed by exactly the ranges of the array, but possibly in a different order.
|
||||
/// </remarks>
|
||||
public TItem this[Range range0, Variable<int> range1, Range range2]
|
||||
public TItem this[Range range0, Variable<int> range1, Microsoft.ML.Probabilistic.Models.Range range2]
|
||||
{
|
||||
get { return base[range0, range1, range2]; }
|
||||
}
|
||||
|
@ -193,7 +193,7 @@ namespace Microsoft.ML.Probabilistic.Models
|
|||
/// When setting the elements of an array, the right hand side must be a fresh variable with no other uses.
|
||||
/// The right-hand side must be an item variable indexed by exactly the ranges of the array, but possibly in a different order.
|
||||
/// </remarks>
|
||||
public TItem this[Range range0, Range range1, Variable<int> range2]
|
||||
public TItem this[Range range0, Microsoft.ML.Probabilistic.Models.Range range1, Variable<int> range2]
|
||||
{
|
||||
get { return base[range0, range1, range2]; }
|
||||
}
|
||||
|
@ -259,9 +259,9 @@ namespace Microsoft.ML.Probabilistic.Models
|
|||
IVariableArray IVariableArray.ReplaceRanges(Dictionary<Range, Range> rangeReplacements, Dictionary<IModelExpression, IModelExpression> expressionReplacements, bool deepCopy)
|
||||
{
|
||||
// must do this replacement first, since it will influence how we replace the itemPrototype
|
||||
Range newRange0 = Range0.Replace(rangeReplacements, expressionReplacements);
|
||||
Range newRange1 = Range1.Replace(rangeReplacements, expressionReplacements);
|
||||
Range newRange2 = Range2.Replace(rangeReplacements, expressionReplacements);
|
||||
Microsoft.ML.Probabilistic.Models.Range newRange0 = Range0.Replace(rangeReplacements, expressionReplacements);
|
||||
Microsoft.ML.Probabilistic.Models.Range newRange1 = Range1.Replace(rangeReplacements, expressionReplacements);
|
||||
Microsoft.ML.Probabilistic.Models.Range newRange2 = Range2.Replace(rangeReplacements, expressionReplacements);
|
||||
TItem itemPrototype = (TItem) ((IVariableJaggedArray) this).ItemPrototype;
|
||||
if (itemPrototype is IVariableArray)
|
||||
{
|
||||
|
@ -283,12 +283,12 @@ namespace Microsoft.ML.Probabilistic.Models
|
|||
/// <typeparam name="T"></typeparam>
|
||||
public class VariableArray3D<T> : VariableArray3D<Variable<T>, T[,]>, IVariableArray3D<T>, SettableTo<VariableArray3D<T>>
|
||||
{
|
||||
internal VariableArray3D(Range range0, Range range1, Range range2)
|
||||
internal VariableArray3D(Microsoft.ML.Probabilistic.Models.Range range0, Microsoft.ML.Probabilistic.Models.Range range1, Microsoft.ML.Probabilistic.Models.Range range2)
|
||||
: base(new Variable<T>(), range0, range1, range2)
|
||||
{
|
||||
}
|
||||
|
||||
internal VariableArray3D(Variable<T> itemPrototype, Range range0, Range range1, Range range2)
|
||||
internal VariableArray3D(Variable<T> itemPrototype, Microsoft.ML.Probabilistic.Models.Range range0, Microsoft.ML.Probabilistic.Models.Range range1, Microsoft.ML.Probabilistic.Models.Range range2)
|
||||
: base(itemPrototype, range0, range1, range2)
|
||||
{
|
||||
}
|
||||
|
|
|
@ -88,7 +88,7 @@ namespace Microsoft.ML.Probabilistic.Models
|
|||
this.ranges = ranges;
|
||||
this.itemPrototype = itemPrototype;
|
||||
// check that none of the ranges match an open container
|
||||
foreach (Range r in ranges)
|
||||
foreach (Microsoft.ML.Probabilistic.Models.Range r in ranges)
|
||||
{
|
||||
if (r == null) throw new ArgumentNullException("range");
|
||||
foreach (IStatementBlock stBlock in containers)
|
||||
|
|
|
@ -22,11 +22,11 @@
|
|||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="2.10.0" />
|
||||
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="*" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\Compiler\Compiler.csproj" />
|
||||
<ProjectReference Include="..\Runtime\Runtime.csproj" />
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
<PropertyGroup><WarningLevel>0</WarningLevel><TagForRemoval>1</TagForRemoval></PropertyGroup></Project>
|
|
@ -12,7 +12,7 @@
|
|||
<Choose>
|
||||
<When Condition="'$(Configuration)'=='DebugFull' OR '$(Configuration)'=='ReleaseFull'">
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net462</TargetFramework>
|
||||
<TargetFramework>net6.0-windows</TargetFramework>
|
||||
</PropertyGroup>
|
||||
</When>
|
||||
<When Condition="'$(Configuration)'=='DebugCore' OR '$(Configuration)'=='ReleaseCore'">
|
||||
|
@ -22,7 +22,7 @@
|
|||
</When>
|
||||
<Otherwise>
|
||||
<PropertyGroup>
|
||||
<TargetFrameworks>net6.0-windows;net462</TargetFrameworks>
|
||||
<TargetFrameworks>net6.0-windows</TargetFrameworks>
|
||||
</PropertyGroup>
|
||||
</Otherwise>
|
||||
</Choose>
|
||||
|
@ -71,10 +71,10 @@
|
|||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="System.Resources.Extensions" Version="4.6.0" />
|
||||
<PackageReference Include="System.Resources.Extensions" Version="*" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Service Include="{B4F97281-0DBD-4835-9ED8-7DFB966E87FF}" />
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
<PropertyGroup><WarningLevel>0</WarningLevel><TagForRemoval>1</TagForRemoval></PropertyGroup></Project>
|
|
@ -13,7 +13,7 @@
|
|||
<Choose>
|
||||
<When Condition="'$(Configuration)'=='DebugFull' OR '$(Configuration)'=='ReleaseFull'">
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net462</TargetFramework>
|
||||
<TargetFramework>net6.0-windows</TargetFramework>
|
||||
</PropertyGroup>
|
||||
</When>
|
||||
<When Condition="'$(Configuration)'=='DebugCore' OR '$(Configuration)'=='ReleaseCore'">
|
||||
|
@ -23,7 +23,7 @@
|
|||
</When>
|
||||
<Otherwise>
|
||||
<PropertyGroup>
|
||||
<TargetFrameworks>net6.0-windows;net462</TargetFrameworks>
|
||||
<TargetFrameworks>net6.0-windows</TargetFrameworks>
|
||||
</PropertyGroup>
|
||||
</Otherwise>
|
||||
</Choose>
|
||||
|
@ -74,4 +74,4 @@
|
|||
<ItemGroup>
|
||||
<Resource Include="Images\*" />
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
<PropertyGroup><WarningLevel>0</WarningLevel><TagForRemoval>1</TagForRemoval></PropertyGroup></Project>
|
|
@ -12,17 +12,17 @@
|
|||
<Choose>
|
||||
<When Condition="'$(Configuration)'=='DebugFull' OR '$(Configuration)'=='ReleaseFull'">
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net462</TargetFramework>
|
||||
<TargetFramework>net6.0-windows</TargetFramework>
|
||||
</PropertyGroup>
|
||||
</When>
|
||||
<When Condition="'$(Configuration)'=='DebugCore' OR '$(Configuration)'=='ReleaseCore'">
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net6.0</TargetFramework>
|
||||
<TargetFramework>net6.0-windows</TargetFramework>
|
||||
</PropertyGroup>
|
||||
</When>
|
||||
<Otherwise>
|
||||
<PropertyGroup>
|
||||
<TargetFrameworks>net6.0;net462</TargetFrameworks>
|
||||
<TargetFrameworks>net6.0-windows</TargetFrameworks>
|
||||
</PropertyGroup>
|
||||
</Otherwise>
|
||||
</Choose>
|
||||
|
@ -63,4 +63,4 @@
|
|||
</None>
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
<PropertyGroup><WarningLevel>0</WarningLevel><TagForRemoval>1</TagForRemoval></PropertyGroup></Project>
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
<Import Project="$(MSBuildThisFileDirectory)..\..\..\build\common.props" />
|
||||
|
||||
<PropertyGroup>
|
||||
|
@ -11,17 +11,17 @@
|
|||
<Choose>
|
||||
<When Condition="'$(Configuration)'=='DebugFull' OR '$(Configuration)'=='ReleaseFull'">
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net462</TargetFramework>
|
||||
<TargetFramework>net6.0-windows</TargetFramework>
|
||||
</PropertyGroup>
|
||||
</When>
|
||||
<When Condition="'$(Configuration)'=='DebugCore' OR '$(Configuration)'=='ReleaseCore'">
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net6.0</TargetFramework>
|
||||
<TargetFramework>net6.0-windows</TargetFramework>
|
||||
</PropertyGroup>
|
||||
</When>
|
||||
<Otherwise>
|
||||
<PropertyGroup>
|
||||
<TargetFrameworks>net6.0;net462</TargetFrameworks>
|
||||
<TargetFrameworks>net6.0-windows</TargetFrameworks>
|
||||
</PropertyGroup>
|
||||
</Otherwise>
|
||||
</Choose>
|
||||
|
@ -64,4 +64,4 @@
|
|||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</None>
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
<PropertyGroup><WarningLevel>0</WarningLevel><TagForRemoval>1</TagForRemoval></PropertyGroup></Project>
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
|
||||
<PropertyGroup>
|
||||
<OutputType>WinExe</OutputType>
|
||||
<TargetFramework>net462</TargetFramework>
|
||||
<TargetFramework>net6.0-windows</TargetFramework>
|
||||
<Configurations>Debug;DebugFull;DebugCore;Release;ReleaseFull;ReleaseCore</Configurations>
|
||||
<Prefer32Bit>false</Prefer32Bit>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
|
@ -53,4 +53,4 @@
|
|||
<ProjectReference Include="..\..\Compiler\Compiler.csproj" />
|
||||
<ProjectReference Include="..\..\Runtime\Runtime.csproj" />
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
<PropertyGroup><WarningLevel>0</WarningLevel><TagForRemoval>1</TagForRemoval></PropertyGroup></Project>
|
|
@ -11,17 +11,17 @@
|
|||
<Choose>
|
||||
<When Condition="'$(Configuration)'=='DebugFull' OR '$(Configuration)'=='ReleaseFull'">
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net462</TargetFramework>
|
||||
<TargetFramework>net6.0-windows</TargetFramework>
|
||||
</PropertyGroup>
|
||||
</When>
|
||||
<When Condition="'$(Configuration)'=='DebugCore' OR '$(Configuration)'=='ReleaseCore'">
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net6.0</TargetFramework>
|
||||
<TargetFramework>net6.0-windows</TargetFramework>
|
||||
</PropertyGroup>
|
||||
</When>
|
||||
<Otherwise>
|
||||
<PropertyGroup>
|
||||
<TargetFrameworks>net6.0;net462</TargetFrameworks>
|
||||
<TargetFrameworks>net6.0-windows</TargetFrameworks>
|
||||
</PropertyGroup>
|
||||
</Otherwise>
|
||||
</Choose>
|
||||
|
@ -47,4 +47,4 @@
|
|||
<Compile Include="..\..\Shared\SharedAssemblyFileVersion.cs" />
|
||||
<Compile Include="..\..\Shared\SharedAssemblyInfo.cs" />
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
<PropertyGroup><WarningLevel>0</WarningLevel><TagForRemoval>1</TagForRemoval></PropertyGroup></Project>
|
||||
|
|
|
@ -13,17 +13,17 @@
|
|||
<Choose>
|
||||
<When Condition="'$(Configuration)'=='DebugFull' OR '$(Configuration)'=='ReleaseFull'">
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net462</TargetFramework>
|
||||
<TargetFramework>net6.0-windows</TargetFramework>
|
||||
</PropertyGroup>
|
||||
</When>
|
||||
<When Condition="'$(Configuration)'=='DebugCore' OR '$(Configuration)'=='ReleaseCore'">
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net6.0</TargetFramework>
|
||||
<TargetFramework>net6.0-windows</TargetFramework>
|
||||
</PropertyGroup>
|
||||
</When>
|
||||
<Otherwise>
|
||||
<PropertyGroup>
|
||||
<TargetFrameworks>net6.0;net462</TargetFrameworks>
|
||||
<TargetFrameworks>net6.0-windows</TargetFrameworks>
|
||||
</PropertyGroup>
|
||||
</Otherwise>
|
||||
</Choose>
|
||||
|
@ -46,11 +46,11 @@
|
|||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="System.Diagnostics.PerformanceCounter" Version="4.7.0" />
|
||||
<PackageReference Include="System.Diagnostics.PerformanceCounter" Version="*" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Compile Include="..\..\Shared\SharedAssemblyFileVersion.cs" />
|
||||
<Compile Include="..\..\Shared\SharedAssemblyInfo.cs" />
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
<PropertyGroup><WarningLevel>0</WarningLevel><TagForRemoval>1</TagForRemoval></PropertyGroup></Project>
|
|
@ -2,7 +2,7 @@
|
|||
<Import Project="$(MSBuildThisFileDirectory)..\..\..\build\common.props" />
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net462</TargetFramework>
|
||||
<TargetFramework>net6.0-windows</TargetFramework>
|
||||
<Configurations>Debug;DebugFull;DebugCore;Release;ReleaseFull;ReleaseCore</Configurations>
|
||||
<Prefer32Bit>false</Prefer32Bit>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
|
@ -71,4 +71,4 @@
|
|||
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
|
||||
</None>
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
<PropertyGroup><WarningLevel>0</WarningLevel><TagForRemoval>1</TagForRemoval></PropertyGroup></Project>
|
|
@ -13,17 +13,17 @@
|
|||
<Choose>
|
||||
<When Condition="'$(Configuration)'=='DebugFull' OR '$(Configuration)'=='ReleaseFull'">
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net462</TargetFramework>
|
||||
<TargetFramework>net6.0-windows</TargetFramework>
|
||||
</PropertyGroup>
|
||||
</When>
|
||||
<When Condition="'$(Configuration)'=='DebugCore' OR '$(Configuration)'=='ReleaseCore'">
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net6.0</TargetFramework>
|
||||
<TargetFramework>net6.0-windows</TargetFramework>
|
||||
</PropertyGroup>
|
||||
</When>
|
||||
<Otherwise>
|
||||
<PropertyGroup>
|
||||
<TargetFrameworks>net6.0;net462</TargetFrameworks>
|
||||
<TargetFrameworks>net6.0-windows</TargetFrameworks>
|
||||
</PropertyGroup>
|
||||
</Otherwise>
|
||||
</Choose>
|
||||
|
@ -49,4 +49,4 @@
|
|||
<Compile Include="..\..\Shared\SharedAssemblyFileVersion.cs" />
|
||||
<Compile Include="..\..\Shared\SharedAssemblyInfo.cs" />
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
<PropertyGroup><WarningLevel>0</WarningLevel><TagForRemoval>1</TagForRemoval></PropertyGroup></Project>
|
|
@ -1,4 +1,4 @@
|
|||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
<Import Project="$(MSBuildThisFileDirectory)..\..\..\build\common.props" />
|
||||
|
||||
<PropertyGroup>
|
||||
|
@ -12,17 +12,17 @@
|
|||
<Choose>
|
||||
<When Condition="'$(Configuration)'=='DebugFull' OR '$(Configuration)'=='ReleaseFull'">
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net462</TargetFramework>
|
||||
<TargetFramework>net6.0-windows</TargetFramework>
|
||||
</PropertyGroup>
|
||||
</When>
|
||||
<When Condition="'$(Configuration)'=='DebugCore' OR '$(Configuration)'=='ReleaseCore'">
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net6.0</TargetFramework>
|
||||
<TargetFramework>net6.0-windows</TargetFramework>
|
||||
</PropertyGroup>
|
||||
</When>
|
||||
<Otherwise>
|
||||
<PropertyGroup>
|
||||
<TargetFrameworks>net6.0;net462</TargetFrameworks>
|
||||
<TargetFrameworks>net6.0-windows</TargetFrameworks>
|
||||
</PropertyGroup>
|
||||
</Otherwise>
|
||||
</Choose>
|
||||
|
@ -57,4 +57,4 @@
|
|||
<Compile Include="..\..\Shared\SharedAssemblyInfo.cs" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
<PropertyGroup><WarningLevel>0</WarningLevel><TagForRemoval>1</TagForRemoval></PropertyGroup></Project>
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
<Choose>
|
||||
<When Condition="'$(Configuration)'=='DebugFull' OR '$(Configuration)'=='ReleaseFull'">
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net462</TargetFramework>
|
||||
<TargetFramework>net6.0-windows</TargetFramework>
|
||||
</PropertyGroup>
|
||||
</When>
|
||||
<When Condition="'$(Configuration)'=='DebugCore' OR '$(Configuration)'=='ReleaseCore'">
|
||||
|
@ -23,12 +23,12 @@
|
|||
<TargetFramework>net6.0-windows</TargetFramework>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(IsWindows)'!='true'">
|
||||
<TargetFramework>net6.0</TargetFramework>
|
||||
<TargetFramework>net6.0-windows</TargetFramework>
|
||||
</PropertyGroup>
|
||||
</When>
|
||||
<Otherwise>
|
||||
<PropertyGroup Condition="'$(IsWindows)'=='true'">
|
||||
<TargetFrameworks>net6.0-windows;net462</TargetFrameworks>
|
||||
<TargetFrameworks>net6.0-windows</TargetFrameworks>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(IsWindows)'!='true'">
|
||||
<TargetFramework>net6.0;net462</TargetFramework>
|
||||
|
@ -67,7 +67,14 @@
|
|||
</ItemGroup>
|
||||
|
||||
<ItemGroup Condition="'$(IsWindows)'=='true'">
|
||||
<PackageReference Include="OxyPlot.Wpf" Version="2.0.0" />
|
||||
<PackageReference Include="OxyPlot.Wpf" Version="*">
|
||||
<!-- JOTIMS TODO VALIDATE -->
|
||||
<NoWarn>NU1701</NoWarn>
|
||||
</PackageReference>
|
||||
<PackageReference Include="OxyPlot.Core" Version="*">
|
||||
<!-- JOTIMS TODO VALIDATE -->
|
||||
<NoWarn>NU1701</NoWarn>
|
||||
</PackageReference>
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
@ -75,4 +82,4 @@
|
|||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</None>
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
<PropertyGroup><WarningLevel>0</WarningLevel><TagForRemoval>1</TagForRemoval></PropertyGroup></Project>
|
||||
|
|
|
@ -33,4 +33,4 @@
|
|||
<Compile Include="..\..\Shared\SharedAssemblyFileVersion.cs" />
|
||||
<Compile Include="..\..\Shared\SharedAssemblyInfo.cs" />
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
<PropertyGroup><WarningLevel>0</WarningLevel><TagForRemoval>1</TagForRemoval></PropertyGroup></Project>
|
|
@ -14,17 +14,17 @@
|
|||
<Choose>
|
||||
<When Condition="'$(Configuration)'=='DebugFull' OR '$(Configuration)'=='ReleaseFull'">
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net462</TargetFramework>
|
||||
<TargetFramework>net6.0-windows</TargetFramework>
|
||||
</PropertyGroup>
|
||||
</When>
|
||||
<When Condition="'$(Configuration)'=='DebugCore' OR '$(Configuration)'=='ReleaseCore'">
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net6.0</TargetFramework>
|
||||
<TargetFramework>net6.0-windows</TargetFramework>
|
||||
</PropertyGroup>
|
||||
</When>
|
||||
<Otherwise>
|
||||
<PropertyGroup>
|
||||
<TargetFrameworks>net6.0;net462</TargetFrameworks>
|
||||
<TargetFrameworks>net6.0-windows</TargetFrameworks>
|
||||
<!-- No need to generate code twice -->
|
||||
<IgnorePostBuildNetCore>true</IgnorePostBuildNetCore>
|
||||
</PropertyGroup>
|
||||
|
@ -84,4 +84,4 @@
|
|||
<Target Name="PostBuildNetCore" AfterTargets="PostBuildEvent" Condition="'$(RunPostBuildNetCore)' == 'true'">
|
||||
<Exec Command="dotnet "$(TargetPath)" "$([System.IO.Path]::Combine($(SolutionDir),'src', 'Learners', 'Classifier', 'BayesPointMachineClassifierInternal', 'GeneratedAlgorithms'))"" />
|
||||
</Target>
|
||||
</Project>
|
||||
<PropertyGroup><WarningLevel>0</WarningLevel><TagForRemoval>1</TagForRemoval></PropertyGroup></Project>
|
|
@ -32,4 +32,4 @@
|
|||
<Compile Include="..\..\Shared\SharedAssemblyFileVersion.cs" />
|
||||
<Compile Include="..\..\Shared\SharedAssemblyInfo.cs" />
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
<PropertyGroup><WarningLevel>0</WarningLevel><TagForRemoval>1</TagForRemoval></PropertyGroup></Project>
|
|
@ -43,4 +43,4 @@
|
|||
<ProjectReference Include="..\Classifier\Classifier.csproj" />
|
||||
<ProjectReference Include="..\Recommender\Recommender.csproj" />
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
<PropertyGroup><WarningLevel>0</WarningLevel><TagForRemoval>1</TagForRemoval></PropertyGroup></Project>
|
|
@ -33,4 +33,4 @@
|
|||
<Compile Include="..\..\Shared\SharedAssemblyFileVersion.cs" />
|
||||
<Compile Include="..\..\Shared\SharedAssemblyInfo.cs" />
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
<PropertyGroup><WarningLevel>0</WarningLevel><TagForRemoval>1</TagForRemoval></PropertyGroup></Project>
|
|
@ -14,17 +14,17 @@
|
|||
<Choose>
|
||||
<When Condition="'$(Configuration)'=='DebugFull' OR '$(Configuration)'=='ReleaseFull'">
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net462</TargetFramework>
|
||||
<TargetFramework>net6.0-windows</TargetFramework>
|
||||
</PropertyGroup>
|
||||
</When>
|
||||
<When Condition="'$(Configuration)'=='DebugCore' OR '$(Configuration)'=='ReleaseCore'">
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net6.0</TargetFramework>
|
||||
<TargetFramework>net6.0-windows</TargetFramework>
|
||||
</PropertyGroup>
|
||||
</When>
|
||||
<Otherwise>
|
||||
<PropertyGroup>
|
||||
<TargetFrameworks>net6.0;net462</TargetFrameworks>
|
||||
<TargetFrameworks>net6.0-windows</TargetFrameworks>
|
||||
<!-- No need to generate code twice -->
|
||||
<IgnorePostBuildNetCore>true</IgnorePostBuildNetCore>
|
||||
</PropertyGroup>
|
||||
|
@ -81,4 +81,4 @@
|
|||
<Target Name="PostBuildNetCore" AfterTargets="PostBuildEvent" Condition="'$(RunPostBuildNetCore)' == 'true'">
|
||||
<Exec Command="dotnet "$(TargetPath)" "$([System.IO.Path]::Combine($(SolutionDir),'src', 'Learners', 'Recommender', 'MatchboxRecommenderInternal', 'GeneratedAlgorithms'))"" />
|
||||
</Target>
|
||||
</Project>
|
||||
<PropertyGroup><WarningLevel>0</WarningLevel><TagForRemoval>1</TagForRemoval></PropertyGroup></Project>
|
|
@ -13,17 +13,17 @@
|
|||
<Choose>
|
||||
<When Condition="'$(Configuration)'=='DebugFull' OR '$(Configuration)'=='ReleaseFull'">
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net462</TargetFramework>
|
||||
<TargetFramework>net6.0-windows</TargetFramework>
|
||||
</PropertyGroup>
|
||||
</When>
|
||||
<When Condition="'$(Configuration)'=='DebugCore' OR '$(Configuration)'=='ReleaseCore'">
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net6.0</TargetFramework>
|
||||
<TargetFramework>net6.0-windows</TargetFramework>
|
||||
</PropertyGroup>
|
||||
</When>
|
||||
<Otherwise>
|
||||
<PropertyGroup>
|
||||
<TargetFrameworks>net6.0;net462</TargetFrameworks>
|
||||
<TargetFrameworks>net6.0-windows</TargetFrameworks>
|
||||
</PropertyGroup>
|
||||
</Otherwise>
|
||||
</Choose>
|
||||
|
@ -47,4 +47,4 @@
|
|||
<Compile Include="..\..\..\Shared\SharedAssemblyFileVersion.cs" />
|
||||
<Compile Include="..\..\..\Shared\SharedAssemblyInfo.cs" />
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
<PropertyGroup><WarningLevel>0</WarningLevel><TagForRemoval>1</TagForRemoval></PropertyGroup></Project>
|
|
@ -31,4 +31,4 @@
|
|||
<Compile Include="..\..\..\Shared\SharedAssemblyFileVersion.cs" />
|
||||
<Compile Include="..\..\..\Shared\SharedAssemblyInfo.cs" />
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
<PropertyGroup><WarningLevel>0</WarningLevel><TagForRemoval>1</TagForRemoval></PropertyGroup></Project>
|
|
@ -15,17 +15,17 @@
|
|||
<Choose>
|
||||
<When Condition="'$(Configuration)'=='DebugFull' OR '$(Configuration)'=='ReleaseFull'">
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net462</TargetFramework>
|
||||
<TargetFramework>net6.0-windows</TargetFramework>
|
||||
</PropertyGroup>
|
||||
</When>
|
||||
<When Condition="'$(Configuration)'=='DebugCore' OR '$(Configuration)'=='ReleaseCore'">
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net6.0</TargetFramework>
|
||||
<TargetFramework>net6.0-windows</TargetFramework>
|
||||
</PropertyGroup>
|
||||
</When>
|
||||
<Otherwise>
|
||||
<PropertyGroup>
|
||||
<TargetFrameworks>net6.0;net462</TargetFrameworks>
|
||||
<TargetFrameworks>net6.0-windows</TargetFrameworks>
|
||||
</PropertyGroup>
|
||||
</Otherwise>
|
||||
</Choose>
|
||||
|
@ -38,11 +38,11 @@
|
|||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="ExcelDataReader" Version="3.4.0" />
|
||||
<PackageReference Include="ExcelDataReader" Version="*" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup Condition="$(DefineConstants.Contains('NETCOREAPP'))">
|
||||
<PackageReference Include="System.Text.Encoding.CodePages" Version="4.5.0" />
|
||||
<PackageReference Include="System.Text.Encoding.CodePages" Version="*" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
@ -80,4 +80,4 @@
|
|||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</None>
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
<PropertyGroup><WarningLevel>0</WarningLevel><TagForRemoval>1</TagForRemoval></PropertyGroup></Project>
|
|
@ -37,4 +37,4 @@
|
|||
<_Parameter1>$(AssemblyNamePrefix)Microsoft.ML.Probabilistic.Compiler,PublicKey=0024000004800000940000000602000000240000525341310004000001000100551f07a755a3e3f2901fa321ab631d13d6192b4e6ac9c87279500f49d6635cde6902587752eff20402f46f6ea9c3d80e827580a799840aaab9a49b1d2597e4c1798ee93c5cb66851e9d22f4d6e8110571f4a2e59f1d760f7be04fb10e7dc43ee7ed2831907731427b9815c5fe7f4888f9933ee7a1ad5d1f293fd8ab834fac1be</_Parameter1>
|
||||
</AssemblyAttribute>
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
<PropertyGroup><WarningLevel>0</WarningLevel><TagForRemoval>1</TagForRemoval></PropertyGroup></Project>
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
|
||||
<PropertyGroup>
|
||||
<OutputType>Exe</OutputType>
|
||||
<TargetFramework>net6.0</TargetFramework>
|
||||
<TargetFramework>net6.0-windows</TargetFramework>
|
||||
<RootNamespace>Microsoft.ML.Probabilistic.Tools.BuildFactorDoc</RootNamespace>
|
||||
<AssemblyName>Microsoft.ML.Probabilistic.Tools.BuildFactorDoc</AssemblyName>
|
||||
</PropertyGroup>
|
||||
|
@ -12,4 +12,4 @@
|
|||
<ProjectReference Include="..\..\Compiler\Compiler.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
<PropertyGroup><WarningLevel>0</WarningLevel><TagForRemoval>1</TagForRemoval></PropertyGroup></Project>
|
||||
|
|
|
@ -3,9 +3,9 @@
|
|||
|
||||
<PropertyGroup>
|
||||
<OutputType>Exe</OutputType>
|
||||
<TargetFramework>net6.0</TargetFramework>
|
||||
<TargetFramework>net6.0-windows</TargetFramework>
|
||||
<AssemblyName>Microsoft.ML.Probabilistic.Tools.PrepareSource</AssemblyName>
|
||||
<RootNamespace>Microsoft.ML.Probabilistic.Tools.PrepareSource</RootNamespace>
|
||||
</PropertyGroup>
|
||||
|
||||
</Project>
|
||||
<PropertyGroup><WarningLevel>0</WarningLevel><TagForRemoval>1</TagForRemoval></PropertyGroup></Project>
|
||||
|
|
|
@ -15,17 +15,17 @@
|
|||
<Choose>
|
||||
<When Condition="'$(Configuration)'=='DebugFull' OR '$(Configuration)'=='ReleaseFull'">
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net462</TargetFramework>
|
||||
<TargetFramework>net6.0-windows</TargetFramework>
|
||||
</PropertyGroup>
|
||||
</When>
|
||||
<When Condition="'$(Configuration)'=='DebugCore' OR '$(Configuration)'=='ReleaseCore'">
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net6.0</TargetFramework>
|
||||
<TargetFramework>net6.0-windows</TargetFramework>
|
||||
</PropertyGroup>
|
||||
</When>
|
||||
<Otherwise>
|
||||
<PropertyGroup>
|
||||
<TargetFrameworks>net6.0;net462</TargetFrameworks>
|
||||
<TargetFrameworks>net6.0-windows</TargetFrameworks>
|
||||
<AddSyntheticProjectReferencesForSolutionDependencies>false</AddSyntheticProjectReferencesForSolutionDependencies>
|
||||
</PropertyGroup>
|
||||
</Otherwise>
|
||||
|
@ -138,4 +138,4 @@
|
|||
<DependentUpon>ExamplesViewer.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
<PropertyGroup><WarningLevel>0</WarningLevel><TagForRemoval>1</TagForRemoval></PropertyGroup></Project>
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
<Import Project="$(MSBuildThisFileDirectory)..\..\..\build\nuget-properties.props" />
|
||||
|
||||
<PropertyGroup>
|
||||
<Description>Infer.NET is a framework for running Bayesian inference in graphical models. It can also be used for probabilistic programming. This package contains visualization tools for exploring and analyzing models on Windows platform.</Description>
|
||||
<TargetFramework>net462</TargetFramework>
|
||||
<TargetFramework>net6.0-windows</TargetFramework>
|
||||
<AssemblyName>Microsoft.ML.Probabilistic.Compiler.Visualizers.Windows</AssemblyName>
|
||||
<PackageId>Microsoft.ML.Probabilistic.Visualizers.Windows$(NuGetPackageIdSuffix)</PackageId>
|
||||
<DefineConstants>TRACE;SUPPRESS_XMLDOC_WARNINGS, SUPPRESS_UNREACHABLE_CODE_WARNINGS, SUPPRESS_AMBIGUOUS_REFERENCE_WARNINGS</DefineConstants>
|
||||
|
@ -26,12 +26,6 @@
|
|||
<Optimize>true</Optimize>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.Msagl" Version="1.1.1" />
|
||||
<PackageReference Include="Microsoft.Msagl.Drawing" Version="1.1.1" />
|
||||
<PackageReference Include="Microsoft.Msagl.GraphViewerGdi" Version="1.1.1" />
|
||||
</ItemGroup>
|
||||
|
||||
<PropertyGroup Condition=" $(DefineConstants.Contains('INCLUDE_TRANSFORM_BROWSER'))">
|
||||
<UseWpf>true</UseWpf>
|
||||
<LanguageTargets Condition="Exists('$(MSBuildExtensionsPath)\$(VisualStudioVersion)\Bin\Microsoft.CSharp.targets')">$(MSBuildExtensionsPath)\$(VisualStudioVersion)\Bin\Microsoft.CSharp.targets</LanguageTargets>
|
||||
|
@ -51,10 +45,13 @@
|
|||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\..\..\..\..\automatic-graph-layout2\GraphLayout\Drawing\AutomaticGraphLayout.Drawing.csproj" />
|
||||
<ProjectReference Include="..\..\..\..\..\automatic-graph-layout2\GraphLayout\MSAGL\AutomaticGraphLayout.csproj" />
|
||||
<ProjectReference Include="..\..\..\..\..\automatic-graph-layout2\GraphLayout\tools\GraphViewerGDI\GraphViewerGDI.csproj" />
|
||||
<ProjectReference Include="..\..\Compiler\Compiler.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
<PropertyGroup>
|
||||
<DocumentationFile>bin\$(Configuration)\$(TargetFramework)\$(AssemblyNamePrefix)Microsoft.ML.Probabilistic.Compiler.Visualizers.Windows.xml</DocumentationFile>
|
||||
</PropertyGroup>
|
||||
</Project>
|
||||
<PropertyGroup><WarningLevel>0</WarningLevel><TagForRemoval>1</TagForRemoval></PropertyGroup></Project>
|
||||
|
|
|
@ -10,17 +10,17 @@
|
|||
<Choose>
|
||||
<When Condition="'$(Configuration)'=='DebugFull' OR '$(Configuration)'=='ReleaseFull'">
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net462</TargetFramework>
|
||||
<TargetFramework>net6.0-windows</TargetFramework>
|
||||
</PropertyGroup>
|
||||
</When>
|
||||
<When Condition="'$(Configuration)'=='DebugCore' OR '$(Configuration)'=='ReleaseCore'">
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net6.0</TargetFramework>
|
||||
<TargetFramework>net6.0-windows</TargetFramework>
|
||||
</PropertyGroup>
|
||||
</When>
|
||||
<Otherwise>
|
||||
<PropertyGroup>
|
||||
<TargetFrameworks>net6.0;net462</TargetFrameworks>
|
||||
<TargetFrameworks>net6.0-windows</TargetFrameworks>
|
||||
</PropertyGroup>
|
||||
</Otherwise>
|
||||
</Choose>
|
||||
|
@ -38,20 +38,20 @@
|
|||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.6.1" />
|
||||
<PackageReference Include="xunit" Version="2.4.1" />
|
||||
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.2">
|
||||
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="*" />
|
||||
<PackageReference Include="xunit" Version="*" />
|
||||
<PackageReference Include="xunit.runner.visualstudio" Version="*">
|
||||
<PrivateAssets>all</PrivateAssets>
|
||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||
</PackageReference>
|
||||
<PackageReference Include="xunit.abstractions" Version="2.0.3" />
|
||||
<PackageReference Include="xunit.analyzers" Version="0.10.0" />
|
||||
<PackageReference Include="xunit.assert" Version="2.4.1" />
|
||||
<PackageReference Include="xunit.core" Version="2.4.1" />
|
||||
<PackageReference Include="xunit.extensibility.core" Version="2.4.1" />
|
||||
<PackageReference Include="xunit.extensibility.execution" Version="2.4.1" />
|
||||
<PackageReference Include="xunit.runner.console" Version="2.4.1" />
|
||||
<PackageReference Include="xunit.runner.utility" Version="2.4.1" />
|
||||
<PackageReference Include="xunit.abstractions" Version="*" />
|
||||
<PackageReference Include="xunit.analyzers" Version="*" />
|
||||
<PackageReference Include="xunit.assert" Version="*" />
|
||||
<PackageReference Include="xunit.core" Version="*" />
|
||||
<PackageReference Include="xunit.extensibility.core" Version="*" />
|
||||
<PackageReference Include="xunit.extensibility.execution" Version="*" />
|
||||
<PackageReference Include="xunit.runner.console" Version="*" />
|
||||
<PackageReference Include="xunit.runner.utility" Version="*" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
@ -134,4 +134,4 @@
|
|||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</None>
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
<PropertyGroup><WarningLevel>0</WarningLevel><TagForRemoval>1</TagForRemoval></PropertyGroup></Project>
|
|
@ -13,17 +13,17 @@
|
|||
<Choose>
|
||||
<When Condition="'$(Configuration)'=='DebugFull' OR '$(Configuration)'=='ReleaseFull'">
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net462</TargetFramework>
|
||||
<TargetFramework>net6.0-windows</TargetFramework>
|
||||
</PropertyGroup>
|
||||
</When>
|
||||
<When Condition="'$(Configuration)'=='DebugCore' OR '$(Configuration)'=='ReleaseCore'">
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net6.0</TargetFramework>
|
||||
<TargetFramework>net6.0-windows</TargetFramework>
|
||||
</PropertyGroup>
|
||||
</When>
|
||||
<Otherwise>
|
||||
<PropertyGroup>
|
||||
<TargetFrameworks>net6.0;net462</TargetFrameworks>
|
||||
<TargetFrameworks>net6.0-windows</TargetFrameworks>
|
||||
</PropertyGroup>
|
||||
</Otherwise>
|
||||
</Choose>
|
||||
|
@ -49,4 +49,4 @@
|
|||
<ProjectReference Include="..\LearnersTests\LearnersTests.csproj" />
|
||||
<ProjectReference Include="..\..\..\src\Learners\Recommender\Recommender.csproj" />
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
<PropertyGroup><WarningLevel>0</WarningLevel><TagForRemoval>1</TagForRemoval></PropertyGroup></Project>
|
|
@ -4,10 +4,10 @@
|
|||
<PropertyGroup>
|
||||
<Configurations>Debug;Release;DebugFull;ReleaseFull</Configurations>
|
||||
<OutputType>Exe</OutputType>
|
||||
<TargetFrameworks>net462</TargetFrameworks>
|
||||
<TargetFrameworks>net6.0-windows</TargetFrameworks>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\Tests\Tests.csproj" />
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
<PropertyGroup><WarningLevel>0</WarningLevel><TagForRemoval>1</TagForRemoval></PropertyGroup></Project>
|
|
@ -15,17 +15,17 @@
|
|||
<Choose>
|
||||
<When Condition="'$(Configuration)'=='DebugFull' OR '$(Configuration)'=='ReleaseFull'">
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net462</TargetFramework>
|
||||
<TargetFramework>net6.0-windows</TargetFramework>
|
||||
</PropertyGroup>
|
||||
</When>
|
||||
<When Condition="'$(Configuration)'=='DebugCore' OR '$(Configuration)'=='ReleaseCore'">
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net6.0</TargetFramework>
|
||||
<TargetFramework>net6.0-windows</TargetFramework>
|
||||
</PropertyGroup>
|
||||
</When>
|
||||
<Otherwise>
|
||||
<PropertyGroup>
|
||||
<TargetFrameworks>net6.0;net462</TargetFrameworks>
|
||||
<TargetFrameworks>net6.0-windows</TargetFrameworks>
|
||||
</PropertyGroup>
|
||||
</Otherwise>
|
||||
</Choose>
|
||||
|
@ -65,4 +65,4 @@
|
|||
<ItemGroup Condition="$(DefineConstants.Contains('NETCOREAPP'))">
|
||||
<Compile Remove="Properties/**" />
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
<PropertyGroup><WarningLevel>0</WarningLevel><TagForRemoval>1</TagForRemoval></PropertyGroup></Project>
|
||||
|
|
|
@ -14,17 +14,17 @@
|
|||
<Choose>
|
||||
<When Condition="'$(Configuration)'=='DebugFull' OR '$(Configuration)'=='ReleaseFull'">
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net472</TargetFramework>
|
||||
<TargetFramework>net6.0-windows</TargetFramework>
|
||||
</PropertyGroup>
|
||||
</When>
|
||||
<When Condition="'$(Configuration)'=='DebugCore' OR '$(Configuration)'=='ReleaseCore'">
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net6.0</TargetFramework>
|
||||
<TargetFramework>net6.0-windows</TargetFramework>
|
||||
</PropertyGroup>
|
||||
</When>
|
||||
<Otherwise>
|
||||
<PropertyGroup>
|
||||
<TargetFrameworks>net50;net472</TargetFrameworks>
|
||||
<TargetFrameworks>net6.0-windows;net472</TargetFrameworks>
|
||||
</PropertyGroup>
|
||||
</Otherwise>
|
||||
</Choose>
|
||||
|
|
|
@ -12,17 +12,17 @@
|
|||
<Choose>
|
||||
<When Condition="'$(Configuration)'=='DebugFull' OR '$(Configuration)'=='ReleaseFull'">
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net462</TargetFramework>
|
||||
<TargetFramework>net6.0-windows</TargetFramework>
|
||||
</PropertyGroup>
|
||||
</When>
|
||||
<When Condition="'$(Configuration)'=='DebugCore' OR '$(Configuration)'=='ReleaseCore'">
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net6.0</TargetFramework>
|
||||
<TargetFramework>net6.0-windows</TargetFramework>
|
||||
</PropertyGroup>
|
||||
</When>
|
||||
<Otherwise>
|
||||
<PropertyGroup>
|
||||
<TargetFrameworks>net6.0;net462</TargetFrameworks>
|
||||
<TargetFrameworks>net6.0-windows</TargetFrameworks>
|
||||
</PropertyGroup>
|
||||
</Otherwise>
|
||||
</Choose>
|
||||
|
@ -50,11 +50,11 @@
|
|||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.6.1" />
|
||||
<PackageReference Include="xunit" Version="2.4.1" />
|
||||
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.2">
|
||||
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="*" />
|
||||
<PackageReference Include="xunit" Version="*" />
|
||||
<PackageReference Include="xunit.runner.visualstudio" Version="*">
|
||||
<PrivateAssets>all</PrivateAssets>
|
||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||
</PackageReference>
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
<PropertyGroup><WarningLevel>0</WarningLevel><TagForRemoval>1</TagForRemoval></PropertyGroup></Project>
|
|
@ -22,12 +22,12 @@ namespace Microsoft.ML.Probabilistic.Tests
|
|||
public void WeightedAverageTest()
|
||||
{
|
||||
Assert.Equal(Environment.Is64BitProcess ? 3.86361619394904E-311 : 3.86361619394162E-311, MMath.WeightedAverage(0.82912896852490248, 2.5484859206000203E-311, 3.50752234977395E-313, 31.087830618727477));
|
||||
Assert.Equal(MMath.WeightedAverage(0.1, double.MinValue, 0.01, double.MinValue), double.MinValue);
|
||||
Assert.Equal(MMath.WeightedAverage(0.1, -double.Epsilon, double.MaxValue, -double.Epsilon), -double.Epsilon);
|
||||
Assert.Equal(double.MinValue, MMath.WeightedAverage(0.1, double.MinValue, 0.01, double.MinValue));
|
||||
Assert.Equal(-double.Epsilon, MMath.WeightedAverage(0.1, -double.Epsilon, double.MaxValue, -double.Epsilon));
|
||||
Assert.Equal(MMath.WeightedAverage(1e-100, 2e-250, 1e-100, 4e-250), MMath.Average(2e-250, 4e-250));
|
||||
Assert.Equal(MMath.WeightedAverage(1e100, 2e250, 1e100, 4e250), MMath.Average(2e250, 4e250));
|
||||
Assert.Equal(MMath.WeightedAverage(0, 0, 0.1, -double.Epsilon), -double.Epsilon);
|
||||
Assert.Equal(MMath.WeightedAverage(0.1, -double.Epsilon, 0, double.NegativeInfinity), -double.Epsilon);
|
||||
Assert.Equal(-double.Epsilon, MMath.WeightedAverage(0, 0, 0.1, -double.Epsilon));
|
||||
Assert.Equal(-double.Epsilon, MMath.WeightedAverage(0.1, -double.Epsilon, 0, double.NegativeInfinity));
|
||||
Assert.False(double.IsNaN(MMath.WeightedAverage(1.7976931348623157E+308, double.NegativeInfinity, 4.94065645841247E-324, double.NegativeInfinity)));
|
||||
Assert.False(double.IsNaN(MMath.WeightedAverage(0.01, double.NegativeInfinity, double.MaxValue, double.MaxValue)));
|
||||
Assert.False(double.IsNaN(MMath.WeightedAverage(0.01, double.NegativeInfinity, double.Epsilon, double.NegativeInfinity)));
|
||||
|
|
|
@ -691,7 +691,7 @@ namespace Microsoft.ML.Probabilistic.Tests
|
|||
|
||||
x.ObservedValue = 0.5;
|
||||
evActual = engine.Infer<Bernoulli>(evidence).LogOdds;
|
||||
Assert.Equal(evActual, double.NegativeInfinity);
|
||||
Assert.Equal(double.NegativeInfinity, evActual);
|
||||
|
||||
x.ObservedValue = 1;
|
||||
evActual = engine.Infer<Bernoulli>(evidence).LogOdds;
|
||||
|
|
|
@ -928,8 +928,8 @@ namespace Microsoft.ML.Probabilistic.Tests
|
|||
StringDistribution pointMass2 = StringDistribution.PointMass(Point);
|
||||
Assert.True(pointMass1.IsPointMass);
|
||||
Assert.True(pointMass2.IsPointMass);
|
||||
Assert.Equal(pointMass1.Point, Point);
|
||||
Assert.Equal(pointMass2.Point, Point);
|
||||
Assert.Equal(Point, pointMass1.Point);
|
||||
Assert.Equal(Point, pointMass2.Point);
|
||||
StringInferenceTestUtilities.TestProbability(pointMass1, 1.0, Point);
|
||||
StringInferenceTestUtilities.TestProbability(pointMass2, 1.0, Point);
|
||||
StringInferenceTestUtilities.TestProbability(pointMass1, 0.0, string.Empty, "x", "hello", "world");
|
||||
|
|
|
@ -13,17 +13,17 @@
|
|||
<Choose>
|
||||
<When Condition="'$(Configuration)'=='DebugFull' OR '$(Configuration)'=='ReleaseFull'">
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net462</TargetFramework>
|
||||
<TargetFramework>net6.0-windows</TargetFramework>
|
||||
</PropertyGroup>
|
||||
</When>
|
||||
<When Condition="'$(Configuration)'=='DebugCore' OR '$(Configuration)'=='ReleaseCore'">
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net6.0</TargetFramework>
|
||||
<TargetFramework>net6.0-windows</TargetFramework>
|
||||
</PropertyGroup>
|
||||
</When>
|
||||
<Otherwise>
|
||||
<PropertyGroup>
|
||||
<TargetFrameworks>net6.0;net462</TargetFrameworks>
|
||||
<TargetFrameworks>net6.0-windows</TargetFrameworks>
|
||||
</PropertyGroup>
|
||||
</Otherwise>
|
||||
</Choose>
|
||||
|
@ -41,21 +41,21 @@
|
|||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.6.1" />
|
||||
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
|
||||
<PackageReference Include="xunit" Version="2.4.1" />
|
||||
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.2">
|
||||
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="*" />
|
||||
<PackageReference Include="Newtonsoft.Json" Version="*" />
|
||||
<PackageReference Include="xunit" Version="*" />
|
||||
<PackageReference Include="xunit.runner.visualstudio" Version="*">
|
||||
<PrivateAssets>all</PrivateAssets>
|
||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||
</PackageReference>
|
||||
<PackageReference Include="xunit.abstractions" Version="2.0.3" />
|
||||
<PackageReference Include="xunit.analyzers" Version="0.10.0" />
|
||||
<PackageReference Include="xunit.assert" Version="2.4.1" />
|
||||
<PackageReference Include="xunit.core" Version="2.4.1" />
|
||||
<PackageReference Include="xunit.extensibility.core" Version="2.4.1" />
|
||||
<PackageReference Include="xunit.extensibility.execution" Version="2.4.1" />
|
||||
<PackageReference Include="xunit.runner.console" Version="2.4.1" />
|
||||
<PackageReference Include="xunit.runner.utility" Version="2.4.1" />
|
||||
<PackageReference Include="xunit.abstractions" Version="*" />
|
||||
<PackageReference Include="xunit.analyzers" Version="*" />
|
||||
<PackageReference Include="xunit.assert" Version="*" />
|
||||
<PackageReference Include="xunit.core" Version="*" />
|
||||
<PackageReference Include="xunit.extensibility.core" Version="*" />
|
||||
<PackageReference Include="xunit.extensibility.execution" Version="*" />
|
||||
<PackageReference Include="xunit.runner.console" Version="*" />
|
||||
<PackageReference Include="xunit.runner.utility" Version="*" />
|
||||
<ProjectReference Include="..\..\src\Compiler\Compiler.csproj" />
|
||||
<ProjectReference Include="..\..\src\Csoft\Csoft.csproj" />
|
||||
<ProjectReference Include="..\..\src\Runtime\Runtime.csproj" />
|
||||
|
@ -66,8 +66,8 @@
|
|||
</ItemGroup>
|
||||
|
||||
<ItemGroup Condition="$(DefineConstants.Contains('NETCOREAPP'))">
|
||||
<PackageReference Include="Microsoft.CSharp" Version="4.5.0" />
|
||||
<PackageReference Include="System.Dynamic.Runtime" Version="4.3.0" />
|
||||
<PackageReference Include="Microsoft.CSharp" Version="*" />
|
||||
<PackageReference Include="System.Dynamic.Runtime" Version="*" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
@ -96,4 +96,4 @@
|
|||
<ItemGroup>
|
||||
<EmbeddedResource Include="@(Compile)" />
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
<PropertyGroup><WarningLevel>0</WarningLevel><TagForRemoval>1</TagForRemoval></PropertyGroup></Project>
|
||||
|
|
Загрузка…
Ссылка в новой задаче