5555 <Docs >
5656 <param name =" model" >Model that needs to be converted to ONNX format.</param >
5757 <summary >
58- <a href =" https://onnx.ai/" >ONNX</a > is an intermediate representation format
59- for machine learning models. It is used to make models portable such that you can
60- train a model using a toolkit and run it in another tookit's runtime, for example,
61- you can create a model using ML.NET, export it to an ONNX-ML model file,
62- then load and run that ONNX-ML model in Windows ML, on an UWP Windows 10 app.
63-
64- This API converts an ML.NET model to ONNX-ML format by inspecting the transform pipeline
65- from the end, checking for components that know how to save themselves as ONNX.
66- The first item in the transform pipeline that does not know how to save itself
67- as ONNX, is considered the "input" to the ONNX pipeline. (Ideally this would be the
68- original loader itself, but this may not be possible if the user used unsavable
69- transforms in defining the pipe.) All the columns in the source that are a type the
70- ONNX knows how to deal with will be tracked. Intermediate transformations of the
71- data appearing as new columns will appear in the output block of the ONNX, with names
72- derived from the corresponding column names. The ONNX JSON will be serialized to a
73- path defined through the Json option.
74-
75- This API supports the following arguments:
76- <see cref =" P:Microsoft.ML.Models.OnnxConverter.Onnx" /> indicates the file to write the ONNX protocol buffer file to. This is optional.
77- <see cref =" P:Microsoft.ML.Models.OnnxConverter.Json" /> indicates the file to write the JSON representation of the ONNX model. This is optional.
78- <see cref =" P:Microsoft.ML.Models.OnnxConverter.Name" /> indicates the name property in the ONNX model. If left unspecified, it will
79- be the extension-less name of the file specified in the onnx indicates the protocol buffer file
80- to write the ONNX representation to.
81- <see cref =" P:Microsoft.ML.Models.OnnxConverter.Domain" /> indicates the domain name of the model. ONNX uses reverse domain name space indicators.
82- For example com.microsoft.cognitiveservices. This is a required field.
83- <see cref =" P:Microsoft.ML.Models.OnnxConverter.InputsToDrop" /> is a string array of input column names to omit from the input mapping.
84- A common scenario might be to drop the label column, for instance, since it may not be practically
85- useful for the pipeline. Note that any columns depending on these naturally cannot be saved.
86- <see cref =" P:Microsoft.ML.Models.OnnxConverter.OutputsToDrop" /> is similar, except for the output schema. Note that the pipeline handler
87- is currently not intelligent enough to drop intermediate calculations that produce this value: this will
88- merely omit that value from the actual output.
89-
90- Transforms that can be exported to ONNX
91- 1. Concat
92- 2. KeyToVector
93- 3. NAReplace
94- 4. Normalize
95- 5. Term
96- 6. Categorical
97-
98- Learners that can be exported to ONNX
99- 1. FastTree
100- 2. LightGBM
101- 3. Logistic Regression
102-
103- See <a href =" https://github.com/dotnet/machinelearning/blob/master/test/Microsoft.ML.Tests/OnnxTests.cs" />
104- for an example on how to train a model and then convert that model to ONNX.
58+ Converts an ML.NET model to ONNX-ML format.
10559 </summary >
10660 <remarks >
10761 <para >
297251 </Docs >
298252 </Member >
299253 </Members >
300- </Type >
254+ </Type >
0 commit comments