Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add source generator to generate search space class for all trainers/…
…transformers (#6090) * add source generator * add Search Space Json * fix comments * migrate to system.text.json * use culture invariant * pack search space in automl * fix comments * eof
- Loading branch information
1 parent
ea8ced0
commit 3055403
Showing
41 changed files
with
1,514 additions
and
13 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
27 changes: 27 additions & 0 deletions
27
src/Microsoft.ML.AutoML/CodeGen/apply_onnx_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,27 @@ | ||
{ | ||
"$schema": "./search-space-schema.json#", | ||
"name": "apply_onnx_model_option", | ||
"search_space": [ | ||
{ | ||
"name": "ModelFile", | ||
"type": "string" | ||
}, | ||
{ | ||
"name": "GpuDeviceId", | ||
"type": "integer" | ||
}, | ||
{ | ||
"name": "FallbackToCpu", | ||
"type": "boolean", | ||
"default": false | ||
}, | ||
{ | ||
"name": "OutputColumnName", | ||
"type": "string" | ||
}, | ||
{ | ||
"name": "InputColumnName", | ||
"type": "string" | ||
} | ||
] | ||
} |
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,7 @@ | ||
{ | ||
"EstimatorFactoryGenerator": false, | ||
"CodeGenCatalogGenerator": false, | ||
"EstimatorTypeGenerator": false, | ||
"SearchSpaceGenerator": true, | ||
"SweepableEstimatorGenerator": false | ||
} |
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,14 @@ | ||
{ | ||
"$schema": "./search-space-schema.json#", | ||
"name": "concat_option", | ||
"search_space": [ | ||
{ | ||
"name": "InputColumnNames", | ||
"type": "strings" | ||
}, | ||
{ | ||
"name": "OutputColumnName", | ||
"type": "string" | ||
} | ||
] | ||
} |
30 changes: 30 additions & 0 deletions
30
src/Microsoft.ML.AutoML/CodeGen/extra_pixels_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,30 @@ | ||
{ | ||
"$schema": "./search-space-schema.json#", | ||
"name": "extract_pixels_option", | ||
"search_space": [ | ||
{ | ||
"name": "OutputColumnName", | ||
"type": "string", | ||
"default": "Output" | ||
}, | ||
{ | ||
"name": "InputColumnName", | ||
"type": "string" | ||
}, | ||
{ | ||
"name": "ColorsToExtract", | ||
"type": "colorBits", | ||
"default": "ColorBits.Rgb" | ||
}, | ||
{ | ||
"name": "OrderOfExtraction", | ||
"type": "colorsOrder", | ||
"default": "ColorsOrder.ARGB" | ||
}, | ||
{ | ||
"name": "OutputAsFloatArray", | ||
"type": "boolean", | ||
"default": true | ||
} | ||
] | ||
} |
50 changes: 50 additions & 0 deletions
50
src/Microsoft.ML.AutoML/CodeGen/fast_forest_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,50 @@ | ||
{ | ||
"$schema": "./search-space-schema.json#", | ||
"name": "fast_forest_option", | ||
"search_space": [ | ||
{ | ||
"name": "NumberOfTrees", | ||
"type": "integer", | ||
"default": 4, | ||
"search_space": { | ||
"min": 4, | ||
"max": 32768, | ||
"log_base": true | ||
} | ||
}, | ||
{ | ||
"name": "NumberOfLeaves", | ||
"type": "integer", | ||
"default": 4, | ||
"search_space": { | ||
"min": 4, | ||
"max": 32768, | ||
"log_base": true | ||
} | ||
}, | ||
{ | ||
"name": "FeatureFraction", | ||
"type": "float", | ||
"default": 1, | ||
"search_space": { | ||
"min": 2e-10, | ||
"max": 1, | ||
"log_base": false | ||
} | ||
}, | ||
{ | ||
"name": "LabelColumnName", | ||
"type": "string", | ||
"default": "Label" | ||
}, | ||
{ | ||
"name": "FeatureColumnName", | ||
"type": "string", | ||
"default": "Feature" | ||
}, | ||
{ | ||
"name": "ExampleWeightColumnName", | ||
"type": "string" | ||
} | ||
] | ||
} |
80 changes: 80 additions & 0 deletions
80
src/Microsoft.ML.AutoML/CodeGen/fast_tree_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,80 @@ | ||
{ | ||
"$schema": "./search-space-schema.json#", | ||
"name": "fast_tree_option", | ||
"search_space": [ | ||
{ | ||
"name": "NumberOfLeaves", | ||
"type": "integer", | ||
"default": 4, | ||
"search_space": { | ||
"log_base": true, | ||
"min": 4, | ||
"max": 32768 | ||
} | ||
}, | ||
{ | ||
"name": "MinimumExampleCountPerLeaf", | ||
"type": "integer", | ||
"default": 20, | ||
"search_space": { | ||
"log_base": true, | ||
"min": 2, | ||
"max": 128 | ||
} | ||
}, | ||
{ | ||
"name": "NumberOfTrees", | ||
"type": "integer", | ||
"default": 4, | ||
"search_space": { | ||
"min": 4, | ||
"max": 32768, | ||
"log_base": true | ||
} | ||
}, | ||
{ | ||
"name": "MaximumBinCountPerFeature", | ||
"type": "integer", | ||
"default": 256, | ||
"search_space": { | ||
"min": 8, | ||
"max": 1024, | ||
"log_base": true | ||
} | ||
}, | ||
{ | ||
"name": "FeatureFraction", | ||
"type": "double", | ||
"default": 1, | ||
"search_space": { | ||
"min": 2e-10, | ||
"max": 1, | ||
"log_base": false | ||
} | ||
}, | ||
{ | ||
"name": "LearningRate", | ||
"type": "double", | ||
"default": 0.1, | ||
"search_space": { | ||
"min": 2e-10, | ||
"max": 1, | ||
"log_base": true | ||
} | ||
}, | ||
{ | ||
"name": "LabelColumnName", | ||
"type": "string", | ||
"default": "Label" | ||
}, | ||
{ | ||
"name": "FeatureColumnName", | ||
"type": "string", | ||
"default": "Feature" | ||
}, | ||
{ | ||
"name": "ExampleWeightColumnName", | ||
"type": "string" | ||
} | ||
] | ||
} |
14 changes: 14 additions & 0 deletions
14
src/Microsoft.ML.AutoML/CodeGen/featurize_text_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,14 @@ | ||
{ | ||
"$schema": "./search-space-schema.json#", | ||
"name": "featurize_text_option", | ||
"search_space": [ | ||
{ | ||
"name": "InputColumnName", | ||
"type": "string" | ||
}, | ||
{ | ||
"name": "OutputColumnName", | ||
"type": "string" | ||
} | ||
] | ||
} |
21 changes: 21 additions & 0 deletions
21
src/Microsoft.ML.AutoML/CodeGen/image_classification_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,21 @@ | ||
{ | ||
"$schema": "./search-space-schema.json#", | ||
"name": "image_classification_option", | ||
"search_space": [ | ||
{ | ||
"name": "LabelColumnName", | ||
"type": "string", | ||
"default": "Label" | ||
}, | ||
{ | ||
"name": "ScoreColumnName", | ||
"type": "string", | ||
"default": "Score" | ||
}, | ||
{ | ||
"name": "FeatureColumnName", | ||
"type": "string", | ||
"default": "Feature" | ||
} | ||
] | ||
} |
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,40 @@ | ||
{ | ||
"$schema": "./search-space-schema.json#", | ||
"name": "lbfgs_option", | ||
"search_space": [ | ||
{ | ||
"name": "L1Regularization", | ||
"type": "float", | ||
"default": 1, | ||
"search_space": { | ||
"min": 0.03125, | ||
"max": 32768, | ||
"log_base": true | ||
} | ||
}, | ||
{ | ||
"name": "L2Regularization", | ||
"type": "float", | ||
"default": 1, | ||
"search_space": { | ||
"min": 0.03125, | ||
"max": 32768, | ||
"log_base": true | ||
} | ||
}, | ||
{ | ||
"name": "LabelColumnName", | ||
"type": "string", | ||
"default": "Label" | ||
}, | ||
{ | ||
"name": "FeatureColumnName", | ||
"type": "string", | ||
"default": "Feature" | ||
}, | ||
{ | ||
"name": "ExampleWeightColumnName", | ||
"type": "string" | ||
} | ||
] | ||
} |
Oops, something went wrong.