Skip to content

Remove Lotus references. #252

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 31, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/Microsoft.ML.Data/Model/Onnx/OnnxContext.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
namespace Microsoft.ML.Runtime.Model.Onnx
{
/// <summary>
/// A context for defining a lotusIR output.
/// A context for defining a ONNX output.
/// </summary>
public sealed class OnnxContext
{
Expand Down
2 changes: 0 additions & 2 deletions src/Microsoft.ML.Data/Prediction/Calibrator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1349,8 +1349,6 @@ private static VersionInfo GetVersionInfo()
public Double ParamA { get; }
public Double ParamB { get; }
public bool CanSavePfa => true;
public bool CanSaveLotusVNext => true;

public bool CanSaveOnnx => true;

public PlattCalibrator(IHostEnvironment env, Double paramA, Double paramB)
Expand Down
2 changes: 0 additions & 2 deletions src/Microsoft.ML.Data/Transforms/TransformBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -471,8 +471,6 @@ private sealed class ColumnTmp : OneToOneColumn

public virtual bool CanSaveOnnx => false;

public virtual bool CanSaveLotusVNext => false;

protected OneToOneTransformBase(IHostEnvironment env, string name, OneToOneColumn[] column,
IDataView input, Func<ColumnType, string> testType)
: base(env, name, input)
Expand Down
25 changes: 1 addition & 24 deletions src/Microsoft.ML.FastTree/FastTree.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2789,8 +2789,7 @@ public abstract class FastTreePredictionWrapper :
IWhatTheFeatureValueMapper,
ICanGetSummaryAsIRow,
ISingleCanSavePfa,
ISingleCanSaveOnnx/*,
ISingleCanSaveLotusVNext*/
ISingleCanSaveOnnx
{
//The below two properties are necessary for tree Visualizer
public Ensemble TrainedEnsemble { get; }
Expand All @@ -2816,7 +2815,6 @@ public abstract class FastTreePredictionWrapper :
public ColumnType OutputType => NumberType.Float;
public bool CanSavePfa => true;
public bool CanSaveOnnx => true;
public bool CanSaveLotusVNext => true;

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

/*public void SaveAsLotusVNext(LotusVNextContext ctx, string featuresVariableName, string outputColumnName)
{
Host.CheckValue(ctx, nameof(ctx));
Host.CheckValue(featuresVariableName, nameof(featuresVariableName));
var tempVariables = new List<string>();
foreach (RegressionTree tree in TrainedEnsemble.Trees)
{
var tempVariable = ctx.DeclareVariable(null, LotusVNextUtils.MakeFloatLiteral(0));
tempVariables.Add(tempVariable);
tree.SaveAsLotusVNext(ctx, featuresVariableName, tempVariable);
}

var sumExpression = LotusVNextUtils.MakeVariableReference(tempVariables[0]);
for (int i = 1; i < tempVariables.Count; i++)
sumExpression = LotusVNextUtils.MakeCall("plus",
sumExpression,
LotusVNextUtils.MakeVariableReference(tempVariables[i]));

ctx.DeclareVariable(outputColumnName, sumExpression);
}*/

public void SaveSummary(TextWriter writer, RoleMappedSchema schema)
{
writer.WriteLine();
Expand Down
51 changes: 0 additions & 51 deletions src/Microsoft.ML.FastTree/TreeEnsemble/RegressionTree.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,6 @@
using Microsoft.ML.Runtime.Data;
using Microsoft.ML.Runtime.Internal.Utilities;
using Microsoft.ML.Runtime.Model;
/*LOTUS
using Microsoft.ML.Runtime.Model.LotusVNext;
using LotusvNext.Expressions;*/
using Microsoft.ML.Runtime.Model.Pfa;
using Microsoft.ML.Runtime.Internal.Internallearn;
using Newtonsoft.Json.Linq;
Expand Down Expand Up @@ -1295,54 +1292,6 @@ private JToken AsPfaCore(JToken feat, int node)
return PfaUtils.If(PfaUtils.Call("<=", PfaUtils.Index(feat, SplitFeatures[node]), RawThresholds[node]), lte, gt);
}

/*LOTUS
internal void SaveAsLotusVNext(LotusVNextContext ctx, string featuresVariableName, string treeOutputVariable)
{
ctx.AddExpression(SaveAsLotusVNext(0, featuresVariableName, treeOutputVariable));
}

private Expression SaveAsLotusVNext(int node, string featuresVariableName, string treeOutputVariable)
{
if (node < 0)
{
return LotusVNextUtils.MakeSet(treeOutputVariable,
LotusVNextUtils.MakeFloatLiteral((float)LeafValue(~node)));
}

Expression cond;
if (CategoricalSplit[node])
{
cond = LotusVNextUtils.MakeCall("gt",
LotusVNextUtils.MakeAttr(featuresVariableName, CategoricalSplitFeatures[node][0]),
LotusVNextUtils.MakeFloatLiteral(0.5f)
);

for (int i = 1; i < CategoricalSplitFeatures[node].Length; i++)
{
cond = LotusVNextUtils.MakeCall("or",
cond,
LotusVNextUtils.MakeCall("gt",
LotusVNextUtils.MakeAttr(featuresVariableName, CategoricalSplitFeatures[node][i]),
LotusVNextUtils.MakeFloatLiteral(0.5f)
)
);
}
}
else
{
cond = LotusVNextUtils.MakeCall("gt",
LotusVNextUtils.MakeAttr(featuresVariableName, SplitFeature(node)),
LotusVNextUtils.MakeFloatLiteral(RawThreshold(node))
);
}

return LotusVNextUtils.MakeIf(
cond,
new[] { SaveAsLotusVNext(GetGtChildForNode(node), featuresVariableName, treeOutputVariable) },
new[] { SaveAsLotusVNext(GetLteChildForNode(node), featuresVariableName, treeOutputVariable) }
);
}*/

public FeatureToGainMap GainMap
{
get
Expand Down
1 change: 0 additions & 1 deletion src/Microsoft.ML.Transforms/NormalizeTransform.cs
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,6 @@ public string TestType(ColumnType type)

public override bool CanSavePfa => true;
public override bool CanSaveOnnx => true;
public override bool CanSaveLotusVNext => true;
public const string LoaderSignature = "NormalizeTransform";
internal const string LoaderSignatureOld = "NormalizeFunction";
private static VersionInfo GetVersionInfo()
Expand Down
Loading