/
TensorflowCatalog.xml
154 lines (152 loc) · 12 KB
/
TensorflowCatalog.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
<Type Name="TensorflowCatalog" FullName="Microsoft.ML.TensorflowCatalog">
<TypeSignature Language="C#" Value="public static class TensorflowCatalog" />
<TypeSignature Language="ILAsm" Value=".class public auto ansi abstract sealed beforefieldinit TensorflowCatalog extends System.Object" />
<TypeSignature Language="DocId" Value="T:Microsoft.ML.TensorflowCatalog" />
<TypeSignature Language="VB.NET" Value="Public Module TensorflowCatalog" />
<TypeSignature Language="F#" Value="type TensorflowCatalog = class" />
<AssemblyInfo>
<AssemblyName>Microsoft.ML.TensorFlow</AssemblyName>
<AssemblyVersion>1.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Base>
<BaseTypeName>System.Object</BaseTypeName>
</Base>
<Interfaces />
<Docs>
<summary>
The <see cref="T:Microsoft.ML.Transforms.TensorFlowTransformer" /> is used in following two scenarios.
<list type="number"><item><description>
Scoring with pretrained <a href="https://www.tensorflow.org/">TensorFlow</a> model: In this mode, the transform extracts hidden layers' values from a pre-trained Tensorflow model and uses outputs as features in ML.Net pipeline.
</description></item><item><description>
Retraining of <a href="https://www.tensorflow.org/">TensorFlow</a> model: In this mode, the transform retrains a TensorFlow model using the user data passed through ML.Net pipeline. Once the model is trained, it's outputs can be used as features for scoring.
</description></item></list></summary>
<remarks>
<para>
The TensorFlowTransform extracts specified outputs using a pre-trained <a href="https://www.tensorflow.org">Tensorflow</a> model.
Optionally, it can further retrain TensorFlow model on user data to adjust model parameters on the user data ( also know as "Transfer Learning").
</para>
<para>
For scoring, the transform takes as inputs the pre-trained Tensorflow model, the names of the input nodes, and names of the output nodes whose values we want to extract.
For retraining, the transform also requires training related parameters such as the names of optimization operation in the TensorFlow graph, the name of the learning rate operation in the graph and its value, name of the operations in the graph to compute loss and performance metric etc.
</para>
<para>
This transform requires the <a href="https://dotnet.myget.org/feed/dotnet-core/package/nuget/Microsoft.ML.TensorFlow">Microsoft.ML.TensorFlow</a> nuget to be installed.
The TensorFlowTransform has the following assumptions regarding input, output, processing of data, and retraining.
</para>
<list type="number">
<item>
<description>
For the input model, currently the TensorFlowTransform supports both the <a href="https://www.tensorflow.org/mobile/prepare_models">Frozen model</a> format and also the <a href="https://www.tensorflow.org/guide/saved_model#build_and_load_a_savedmodel">SavedModel</a> format.
However, retraining of the model is only possible for the <a href="https://www.tensorflow.org/guide/saved_model#build_and_load_a_savedmodel">SavedModel</a> format.
<a href="https://www.tensorflow.org/guide/checkpoints">Checkpoint</a> format is currently neither supported for scoring nor for retraining due lack of TensorFlow C-API support for loading it.
</description>
</item>
<item>
<description>The transform supports scoring only one example at a time. However, retraining can be performed in batches.</description>
</item>
<item>
<description>Advanced transfer learning/fine tuning scenarios (e.g. adding more layers into the network, changing the shape of inputs, freezing the layers which do not need to be updated during retraining process etc.) are currently not possible due to lack of support for network/graph manipulation inside the model using TensorFlow C-API.</description>
</item>
<item>
<description>The name of input column(s) should match the name of input(s) in TensorFlow model.</description>
</item>
<item>
<description>The name of each output column should match one of the operations in the TensorFlow graph.</description>
</item>
<item>
<description>Currently, double, float, long, int, short, sbyte, ulong, uint, ushort, byte and bool are the acceptable data types for input/output.</description>
</item>
<item>
<description>Upon success, the transform will introduce a new column in <see cref="T:Microsoft.ML.IDataView" /> corresponding to each output column specified.</description>
</item>
</list>
<para>
The inputs and outputs of a TensorFlow model can be obtained using the <see cref="M:Microsoft.ML.Transforms.TensorFlowModel.GetModelSchema" /> or <a href="https://github.com/tensorflow/tensorflow/tree/master/tensorflow/tools/graph_transforms/README.md#inspecting-graphs">summarize_graph</a> tools.
</para>
</remarks>
<altmember cref="M:Microsoft.ML.Transforms.TensorFlowModel.ScoreTensorFlowModel(System.String,System.String,System.Boolean)" />
<altmember cref="M:Microsoft.ML.Transforms.TensorFlowModel.ScoreTensorFlowModel(System.String[],System.String[],System.Boolean)" />
</Docs>
<Members>
<Member MemberName="LoadTensorFlowModel">
<MemberSignature Language="C#" Value="public static Microsoft.ML.Transforms.TensorFlowModel LoadTensorFlowModel (this Microsoft.ML.ModelOperationsCatalog catalog, string modelLocation);" />
<MemberSignature Language="ILAsm" Value=".method public static hidebysig class Microsoft.ML.Transforms.TensorFlowModel LoadTensorFlowModel(class Microsoft.ML.ModelOperationsCatalog catalog, string modelLocation) cil managed" />
<MemberSignature Language="DocId" Value="M:Microsoft.ML.TensorflowCatalog.LoadTensorFlowModel(Microsoft.ML.ModelOperationsCatalog,System.String)" />
<MemberSignature Language="VB.NET" Value="<Extension()>
Public Function LoadTensorFlowModel (catalog As ModelOperationsCatalog, modelLocation As String) As TensorFlowModel" />
<MemberSignature Language="F#" Value="static member LoadTensorFlowModel : Microsoft.ML.ModelOperationsCatalog * string -> Microsoft.ML.Transforms.TensorFlowModel" Usage="Microsoft.ML.TensorflowCatalog.LoadTensorFlowModel (catalog, modelLocation)" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>Microsoft.ML.TensorFlow</AssemblyName>
<AssemblyVersion>1.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>Microsoft.ML.Transforms.TensorFlowModel</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="catalog" Type="Microsoft.ML.ModelOperationsCatalog" RefType="this" />
<Parameter Name="modelLocation" Type="System.String" />
</Parameters>
<Docs>
<param name="catalog">The transform's catalog.</param>
<param name="modelLocation">Location of the TensorFlow model.</param>
<summary>
Load TensorFlow model into memory. This is the convenience method that allows the model to be loaded once and subsequently use it for querying schema and creation of
<see cref="T:Microsoft.ML.Transforms.TensorFlowEstimator" /> using <see cref="M:Microsoft.ML.Transforms.TensorFlowModel.ScoreTensorFlowModel(System.String,System.String,System.Boolean)" />.
usage of this API requires additional NuGet dependencies on TensorFlow redist, see linked document for more information.
<see cref="T:Microsoft.ML.Transforms.TensorFlowModel" /> also holds references to unmanaged resources that need to be freed either with an explicit
call to Dispose() or implicitly by declaring the variable with the "using" syntax/>
<format type="text/markdown"><![CDATA[
[!include[io](~/../docs/samples/docs/api-reference/tensorflow-usage.md)]
]]></format></summary>
<returns>To be added.</returns>
<remarks>To be added.</remarks>
<example>
<format type="text/markdown"><![CDATA[
[!code-csharp[LoadTensorFlowModel](~/../docs/samples/docs/samples/Microsoft.ML.Samples/Dynamic/TensorFlow/TextClassification.cs)]
]]></format>
</example>
</Docs>
</Member>
<Member MemberName="LoadTensorFlowModel">
<MemberSignature Language="C#" Value="public static Microsoft.ML.Transforms.TensorFlowModel LoadTensorFlowModel (this Microsoft.ML.ModelOperationsCatalog catalog, string modelLocation, bool treatOutputAsBatched);" />
<MemberSignature Language="ILAsm" Value=".method public static hidebysig class Microsoft.ML.Transforms.TensorFlowModel LoadTensorFlowModel(class Microsoft.ML.ModelOperationsCatalog catalog, string modelLocation, bool treatOutputAsBatched) cil managed" />
<MemberSignature Language="DocId" Value="M:Microsoft.ML.TensorflowCatalog.LoadTensorFlowModel(Microsoft.ML.ModelOperationsCatalog,System.String,System.Boolean)" />
<MemberSignature Language="VB.NET" Value="<Extension()>
Public Function LoadTensorFlowModel (catalog As ModelOperationsCatalog, modelLocation As String, treatOutputAsBatched As Boolean) As TensorFlowModel" />
<MemberSignature Language="F#" Value="static member LoadTensorFlowModel : Microsoft.ML.ModelOperationsCatalog * string * bool -> Microsoft.ML.Transforms.TensorFlowModel" Usage="Microsoft.ML.TensorflowCatalog.LoadTensorFlowModel (catalog, modelLocation, treatOutputAsBatched)" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>Microsoft.ML.TensorFlow</AssemblyName>
<AssemblyVersion>1.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>Microsoft.ML.Transforms.TensorFlowModel</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="catalog" Type="Microsoft.ML.ModelOperationsCatalog" RefType="this" Index="0" FrameworkAlternate="ml-dotnet;ml-dotnet-1.5.0;ml-dotnet-1.6.0;ml-dotnet-1.7.0;ml-dotnet-2.0.0" />
<Parameter Name="modelLocation" Type="System.String" Index="1" FrameworkAlternate="ml-dotnet;ml-dotnet-1.5.0;ml-dotnet-1.6.0;ml-dotnet-1.7.0;ml-dotnet-2.0.0" />
<Parameter Name="treatOutputAsBatched" Type="System.Boolean" Index="2" FrameworkAlternate="ml-dotnet;ml-dotnet-1.5.0;ml-dotnet-1.6.0;ml-dotnet-1.7.0;ml-dotnet-2.0.0" />
</Parameters>
<Docs>
<param name="catalog">The transform's catalog.</param>
<param name="modelLocation">Location of the TensorFlow model.</param>
<param name="treatOutputAsBatched">If the first dimension of the output is unknown, should it be treated as batched or not.</param>
<summary>
Load TensorFlow model into memory. This is the convenience method that allows the model to be loaded once and subsequently use it for querying schema and creation of
<see cref="T:Microsoft.ML.Transforms.TensorFlowEstimator" /> using <see cref="M:Microsoft.ML.Transforms.TensorFlowModel.ScoreTensorFlowModel(System.String,System.String,System.Boolean)" />.
usage of this API requires additional NuGet dependencies on TensorFlow redist, see linked document for more information.
<see cref="T:Microsoft.ML.Transforms.TensorFlowModel" /> also holds references to unmanaged resources that need to be freed either with an explicit
call to Dispose() or implicitly by declaring the variable with the "using" syntax/>
<format type="text/markdown"><![CDATA[
[!include[io](~/../docs/samples/docs/api-reference/tensorflow-usage.md)]
]]></format></summary>
<returns>To be added.</returns>
<remarks>To be added.</remarks>
<example>
<format type="text/markdown"><![CDATA[
[!code-csharp[LoadTensorFlowModel](~/../docs/samples/docs/samples/Microsoft.ML.Samples/Dynamic/TensorFlow/TextClassification.cs)]
]]></format>
</example>
</Docs>
</Member>
</Members>
</Type>