Language

CustomMappingCatalog.StatefulCustomMapping<TSrc,TDst,TState> メソッド

定義

StatefulCustomMappingEstimator<TSrc,TDst,TState>を作成します。これにより、入力列のカスタム マッピングが出力列に適用され、カーソルごとの状態が許可されます。

public static Microsoft.ML.Transforms.StatefulCustomMappingEstimator<TSrc,TDst,TState> StatefulCustomMapping<TSrc,TDst,TState>(this Microsoft.ML.TransformsCatalog catalog, Action<TSrc,TDst,TState> mapAction, Action<TState> stateInitAction, string contractName) where TSrc : class, new() where TDst : class, new() where TState : class, new();
static member StatefulCustomMapping : Microsoft.ML.TransformsCatalog * Action<'Src, 'Dst, 'State (requires 'Src : null and 'Src : (new : unit -> 'Src) and 'Dst : null and 'Dst : (new : unit -> 'Dst) and 'State : null and 'State : (new : unit -> 'State))> * Action<'State (requires 'State : null and 'State : (new : unit -> 'State))> * string -> Microsoft.ML.Transforms.StatefulCustomMappingEstimator<'Src, 'Dst, 'State (requires 'Src : null and 'Src : (new : unit -> 'Src) and 'Dst : null and 'Dst : (new : unit -> 'Dst) and 'State : null and 'State : (new : unit -> 'State))> (requires 'Src : null and 'Src : (new : unit -> 'Src) and 'Dst : null and 'Dst : (new : unit -> 'Dst) and 'State : null and 'State : (new : unit -> 'State))
<Extension()>
Public Function StatefulCustomMapping(Of TSrc As {Class, New}, TDst As {Class, New}, TState As {Class, New}) (catalog As TransformsCatalog, mapAction As Action(Of TSrc, TDst, TState), stateInitAction As Action(Of TState), contractName As String) As StatefulCustomMappingEstimator(Of TSrc, TDst, TState)

型パラメーター

TSrc

受信データから取得する列を定義するクラス。

TDst

データに追加する新しい列を定義するクラス。

TState

カーソルごとの状態を記述する型。

パラメーター

catalog
TransformsCatalog

変換カタログ。

mapAction
Action<TSrc,TDst,TState>

マッピング アクション。 入力オブジェクトと出力オブジェクトに加えて、アクションには、表示または変更できる状態オブジェクトが与えられます。 結果のトランスフォーマーを保存可能にする必要がある場合、mapActionを定義するクラスはStatefulCustomMappingFactory<TSrc,TDst,TState>を実装する必要があり、指定されたcontractNameでCustomMappingFactoryAttributeAttributeで修飾する必要があります。 クラスを含むアセンブリは、 RegisterAssembly(Assembly, Boolean)を使用して読み込まれる環境に登録する必要があります。

stateInitAction
Action<TState>

状態オブジェクトを初期化するアクション。カーソルが初期化される前に 1 回呼び出されます。

contractName
String

モデルの読み込みに ML.NET によって使用されるコントラクト名。 nullを指定した場合、結果のトランスフォーマーは保存できなくなります。

返品

適用対象