-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add obj-detection automl sweeper (#6633)
* add wrapper * add more options * disable format check for generated code
- Loading branch information
1 parent
cb2e495
commit e30555c
Showing
7 changed files
with
132 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
61 changes: 61 additions & 0 deletions
61
src/Microsoft.ML.AutoML/CodeGen/object_detection_search_space.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
{ | ||
"$schema": "./search-space-schema.json#", | ||
"name": "object_detection_option", | ||
"search_space": [ | ||
{ | ||
"name": "LabelColumnName", | ||
"type": "string", | ||
"default": "Label" | ||
}, | ||
{ | ||
"name": "PredictedLabelColumnName", | ||
"type": "string", | ||
"default": "PredictedLabel" | ||
}, | ||
{ | ||
"name": "PredictedBoundingBoxColumnName", | ||
"type": "string", | ||
"default": "PredictedBoundingBoxes" | ||
}, | ||
{ | ||
"name": "BoundingBoxColumnName", | ||
"type": "string", | ||
"default": "BoundingBoxes" | ||
}, | ||
{ | ||
"name": "ImageColumnName", | ||
"type": "string", | ||
"default": "Image" | ||
}, | ||
{ | ||
"name": "ScoreColumnName", | ||
"type": "string", | ||
"default": "Score" | ||
}, | ||
{ | ||
"name": "MaxEpoch", | ||
"type": "integer", | ||
"default": 10 | ||
}, | ||
{ | ||
"name": "InitLearningRate", | ||
"type": "double", | ||
"default": 1.0 | ||
}, | ||
{ | ||
"name": "WeightDecay", | ||
"type": "double", | ||
"default": 0.0 | ||
}, | ||
{ | ||
"name": "IOUThreshold", | ||
"type": "double", | ||
"default": 0.5 | ||
}, | ||
{ | ||
"name": "ScoreThreshold", | ||
"type": "double", | ||
"default": 0.5 | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
35 changes: 35 additions & 0 deletions
35
src/Microsoft.ML.AutoML/SweepableEstimator/Estimators/ObjectDetection.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
// Licensed to the .NET Foundation under one or more agreements. | ||
// The .NET Foundation licenses this file to you under the MIT license. | ||
// See the LICENSE file in the project root for more information. | ||
|
||
using System; | ||
using System.Collections.Generic; | ||
using System.Text; | ||
using Microsoft.ML.TorchSharp; | ||
using Microsoft.ML.TorchSharp.AutoFormerV2; | ||
|
||
namespace Microsoft.ML.AutoML.CodeGen | ||
{ | ||
internal partial class ObjectDetectionMulti | ||
{ | ||
public override IEstimator<ITransformer> BuildFromOption(MLContext context, ObjectDetectionOption param) | ||
{ | ||
var option = new ObjectDetectionTrainer.Options | ||
{ | ||
LabelColumnName = param.LabelColumnName, | ||
PredictedLabelColumnName = param.PredictedLabelColumnName, | ||
BoundingBoxColumnName = param.BoundingBoxColumnName, | ||
ImageColumnName = param.ImageColumnName, | ||
ScoreColumnName = param.ScoreColumnName, | ||
MaxEpoch = param.MaxEpoch, | ||
InitLearningRate = param.InitLearningRate, | ||
WeightDecay = param.WeightDecay, | ||
PredictedBoundingBoxColumnName = param.PredictedBoundingBoxColumnName, | ||
ScoreThreshold = param.ScoreThreshold, | ||
IOUThreshold = param.IOUThreshold, | ||
}; | ||
|
||
return context.MulticlassClassification.Trainers.ObjectDetection(option); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters