public class DenseTransformer extends Object implements ExampleTransformer
OnnxTensor
.Modifier and Type | Field and Description |
---|---|
static int |
THRESHOLD
Feature size beyond which a warning is generated (as ONNX requires dense features and large feature spaces are memory hungry).
|
static int |
WARNING_THRESHOLD
Number of times the feature size warning should be printed.
|
Constructor and Description |
---|
DenseTransformer() |
Modifier and Type | Method and Description |
---|---|
com.oracle.labs.mlrg.olcut.provenance.ConfiguredObjectProvenance |
getProvenance() |
String |
toString() |
ai.onnxruntime.OnnxTensor |
transform(ai.onnxruntime.OrtEnvironment env,
List<SparseVector> vectors)
Converts a list of
SparseVector s representing a batch of features into a OnnxTensor . |
ai.onnxruntime.OnnxTensor |
transform(ai.onnxruntime.OrtEnvironment env,
SparseVector vector)
Converts a
SparseVector representing the features into a OnnxTensor . |
public static final int THRESHOLD
public static final int WARNING_THRESHOLD
public ai.onnxruntime.OnnxTensor transform(ai.onnxruntime.OrtEnvironment env, SparseVector vector) throws ai.onnxruntime.OrtException
ExampleTransformer
SparseVector
representing the features into a OnnxTensor
.
It generates it as a single example minibatch.
transform
in interface ExampleTransformer
env
- The OrtEnvironment to create the tensor in.vector
- The features to convert.ai.onnxruntime.OrtException
- if the transformation failed.public ai.onnxruntime.OnnxTensor transform(ai.onnxruntime.OrtEnvironment env, List<SparseVector> vectors) throws ai.onnxruntime.OrtException
ExampleTransformer
SparseVector
s representing a batch of features into a OnnxTensor
.transform
in interface ExampleTransformer
env
- The OrtEnvironment to create the tensor in.vectors
- The batch of features to convert.ai.onnxruntime.OrtException
- if the transformation failed.public com.oracle.labs.mlrg.olcut.provenance.ConfiguredObjectProvenance getProvenance()
getProvenance
in interface com.oracle.labs.mlrg.olcut.provenance.Provenancable<com.oracle.labs.mlrg.olcut.provenance.ConfiguredObjectProvenance>
Copyright © 2015–2021 Oracle and/or its affiliates. All rights reserved.