Package ai.djl.basicdataset.tabular
Class TabularTranslator
java.lang.Object
ai.djl.basicdataset.tabular.TabularTranslator
- All Implemented Interfaces:
ai.djl.translate.PostProcessor<TabularResults>
,ai.djl.translate.PreProcessor<ListFeatures>
,ai.djl.translate.Translator<ListFeatures,
TabularResults>
public class TabularTranslator
extends Object
implements ai.djl.translate.Translator<ListFeatures,TabularResults>
A
Translator
that can be used for Application.Tabular
tasks.-
Constructor Summary
ConstructorDescriptionTabularTranslator
(ai.djl.Model model, Map<String, ?> arguments) Constructs a tabular translator for a model.TabularTranslator
(List<Feature> features, List<Feature> labels) Constructs aTabularTranslator
with the given features and labels. -
Method Summary
Modifier and TypeMethodDescriptionai.djl.translate.TranslatorOptions
Returns the features for the translator.Returns the labels for the translator.ai.djl.ndarray.NDList
processInput
(ai.djl.translate.TranslatorContext ctx, ListFeatures input) processOutput
(ai.djl.translate.TranslatorContext ctx, ai.djl.ndarray.NDList list) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface ai.djl.translate.Translator
getBatchifier, prepare, toBatchTranslator, toBatchTranslator
-
Constructor Details
-
TabularTranslator
Constructs aTabularTranslator
with the given features and labels.- Parameters:
features
- the features for inputslabels
- the labels for outputs
-
TabularTranslator
Constructs a tabular translator for a model.- Parameters:
model
- the modelarguments
- the arguments to build the translator with
-
-
Method Details
-
processOutput
public TabularResults processOutput(ai.djl.translate.TranslatorContext ctx, ai.djl.ndarray.NDList list) throws Exception - Specified by:
processOutput
in interfaceai.djl.translate.PostProcessor<TabularResults>
- Throws:
Exception
-
processInput
public ai.djl.ndarray.NDList processInput(ai.djl.translate.TranslatorContext ctx, ListFeatures input) throws Exception - Specified by:
processInput
in interfaceai.djl.translate.PreProcessor<ListFeatures>
- Throws:
Exception
-
getExpansions
public ai.djl.translate.TranslatorOptions getExpansions()- Specified by:
getExpansions
in interfaceai.djl.translate.Translator<ListFeatures,
TabularResults>
-
getFeatures
Returns the features for the translator.- Returns:
- the features for the translator
-
getLabels
Returns the labels for the translator.- Returns:
- the labels for the translator
-