Skip to content

Commit 71e7ff3

Browse files
authored
remove lotus references. (#252)
1 parent 5dc7848 commit 71e7ff3

File tree

9 files changed

+2
-6456
lines changed

9 files changed

+2
-6456
lines changed

src/Microsoft.ML.Data/Model/Onnx/OnnxContext.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
namespace Microsoft.ML.Runtime.Model.Onnx
1212
{
1313
/// <summary>
14-
/// A context for defining a lotusIR output.
14+
/// A context for defining a ONNX output.
1515
/// </summary>
1616
public sealed class OnnxContext
1717
{

src/Microsoft.ML.Data/Prediction/Calibrator.cs

-2
Original file line numberDiff line numberDiff line change
@@ -1349,8 +1349,6 @@ private static VersionInfo GetVersionInfo()
13491349
public Double ParamA { get; }
13501350
public Double ParamB { get; }
13511351
public bool CanSavePfa => true;
1352-
public bool CanSaveLotusVNext => true;
1353-
13541352
public bool CanSaveOnnx => true;
13551353

13561354
public PlattCalibrator(IHostEnvironment env, Double paramA, Double paramB)

src/Microsoft.ML.Data/Transforms/TransformBase.cs

-2
Original file line numberDiff line numberDiff line change
@@ -471,8 +471,6 @@ private sealed class ColumnTmp : OneToOneColumn
471471

472472
public virtual bool CanSaveOnnx => false;
473473

474-
public virtual bool CanSaveLotusVNext => false;
475-
476474
protected OneToOneTransformBase(IHostEnvironment env, string name, OneToOneColumn[] column,
477475
IDataView input, Func<ColumnType, string> testType)
478476
: base(env, name, input)

src/Microsoft.ML.FastTree/FastTree.cs

+1-24
Original file line numberDiff line numberDiff line change
@@ -2789,8 +2789,7 @@ public abstract class FastTreePredictionWrapper :
27892789
IWhatTheFeatureValueMapper,
27902790
ICanGetSummaryAsIRow,
27912791
ISingleCanSavePfa,
2792-
ISingleCanSaveOnnx/*,
2793-
ISingleCanSaveLotusVNext*/
2792+
ISingleCanSaveOnnx
27942793
{
27952794
//The below two properties are necessary for tree Visualizer
27962795
public Ensemble TrainedEnsemble { get; }
@@ -2816,7 +2815,6 @@ public abstract class FastTreePredictionWrapper :
28162815
public ColumnType OutputType => NumberType.Float;
28172816
public bool CanSavePfa => true;
28182817
public bool CanSaveOnnx => true;
2819-
public bool CanSaveLotusVNext => true;
28202818

28212819
protected internal FastTreePredictionWrapper(IHostEnvironment env, string name, Ensemble trainedEnsemble, int numFeatures, string innerArgs)
28222820
: base(env, name)
@@ -3134,27 +3132,6 @@ public virtual bool SaveAsOnnx(OnnxContext ctx, string[] outputNames, string fea
31343132
return true;
31353133
}
31363134

3137-
/*public void SaveAsLotusVNext(LotusVNextContext ctx, string featuresVariableName, string outputColumnName)
3138-
{
3139-
Host.CheckValue(ctx, nameof(ctx));
3140-
Host.CheckValue(featuresVariableName, nameof(featuresVariableName));
3141-
var tempVariables = new List<string>();
3142-
foreach (RegressionTree tree in TrainedEnsemble.Trees)
3143-
{
3144-
var tempVariable = ctx.DeclareVariable(null, LotusVNextUtils.MakeFloatLiteral(0));
3145-
tempVariables.Add(tempVariable);
3146-
tree.SaveAsLotusVNext(ctx, featuresVariableName, tempVariable);
3147-
}
3148-
3149-
var sumExpression = LotusVNextUtils.MakeVariableReference(tempVariables[0]);
3150-
for (int i = 1; i < tempVariables.Count; i++)
3151-
sumExpression = LotusVNextUtils.MakeCall("plus",
3152-
sumExpression,
3153-
LotusVNextUtils.MakeVariableReference(tempVariables[i]));
3154-
3155-
ctx.DeclareVariable(outputColumnName, sumExpression);
3156-
}*/
3157-
31583135
public void SaveSummary(TextWriter writer, RoleMappedSchema schema)
31593136
{
31603137
writer.WriteLine();

src/Microsoft.ML.FastTree/TreeEnsemble/RegressionTree.cs

-51
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,6 @@
1313
using Microsoft.ML.Runtime.Data;
1414
using Microsoft.ML.Runtime.Internal.Utilities;
1515
using Microsoft.ML.Runtime.Model;
16-
/*LOTUS
17-
using Microsoft.ML.Runtime.Model.LotusVNext;
18-
using LotusvNext.Expressions;*/
1916
using Microsoft.ML.Runtime.Model.Pfa;
2017
using Microsoft.ML.Runtime.Internal.Internallearn;
2118
using Newtonsoft.Json.Linq;
@@ -1295,54 +1292,6 @@ private JToken AsPfaCore(JToken feat, int node)
12951292
return PfaUtils.If(PfaUtils.Call("<=", PfaUtils.Index(feat, SplitFeatures[node]), RawThresholds[node]), lte, gt);
12961293
}
12971294

1298-
/*LOTUS
1299-
internal void SaveAsLotusVNext(LotusVNextContext ctx, string featuresVariableName, string treeOutputVariable)
1300-
{
1301-
ctx.AddExpression(SaveAsLotusVNext(0, featuresVariableName, treeOutputVariable));
1302-
}
1303-
1304-
private Expression SaveAsLotusVNext(int node, string featuresVariableName, string treeOutputVariable)
1305-
{
1306-
if (node < 0)
1307-
{
1308-
return LotusVNextUtils.MakeSet(treeOutputVariable,
1309-
LotusVNextUtils.MakeFloatLiteral((float)LeafValue(~node)));
1310-
}
1311-
1312-
Expression cond;
1313-
if (CategoricalSplit[node])
1314-
{
1315-
cond = LotusVNextUtils.MakeCall("gt",
1316-
LotusVNextUtils.MakeAttr(featuresVariableName, CategoricalSplitFeatures[node][0]),
1317-
LotusVNextUtils.MakeFloatLiteral(0.5f)
1318-
);
1319-
1320-
for (int i = 1; i < CategoricalSplitFeatures[node].Length; i++)
1321-
{
1322-
cond = LotusVNextUtils.MakeCall("or",
1323-
cond,
1324-
LotusVNextUtils.MakeCall("gt",
1325-
LotusVNextUtils.MakeAttr(featuresVariableName, CategoricalSplitFeatures[node][i]),
1326-
LotusVNextUtils.MakeFloatLiteral(0.5f)
1327-
)
1328-
);
1329-
}
1330-
}
1331-
else
1332-
{
1333-
cond = LotusVNextUtils.MakeCall("gt",
1334-
LotusVNextUtils.MakeAttr(featuresVariableName, SplitFeature(node)),
1335-
LotusVNextUtils.MakeFloatLiteral(RawThreshold(node))
1336-
);
1337-
}
1338-
1339-
return LotusVNextUtils.MakeIf(
1340-
cond,
1341-
new[] { SaveAsLotusVNext(GetGtChildForNode(node), featuresVariableName, treeOutputVariable) },
1342-
new[] { SaveAsLotusVNext(GetLteChildForNode(node), featuresVariableName, treeOutputVariable) }
1343-
);
1344-
}*/
1345-
13461295
public FeatureToGainMap GainMap
13471296
{
13481297
get

src/Microsoft.ML.Transforms/NormalizeTransform.cs

-1
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,6 @@ public string TestType(ColumnType type)
9393

9494
public override bool CanSavePfa => true;
9595
public override bool CanSaveOnnx => true;
96-
public override bool CanSaveLotusVNext => true;
9796
public const string LoaderSignature = "NormalizeTransform";
9897
internal const string LoaderSignatureOld = "NormalizeFunction";
9998
private static VersionInfo GetVersionInfo()

0 commit comments

Comments
 (0)