Class TabularTranslator

    • Constructor Summary

      Constructors 
      Constructor Description
      TabularTranslator​(ai.djl.Model model, java.util.Map<java.lang.String,​?> arguments)
      Constructs a tabular translator for a model.
      TabularTranslator​(java.util.List<Feature> features, java.util.List<Feature> labels)
      Constructs a TabularTranslator with the given features and labels.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      ai.djl.translate.TranslatorOptions getExpansions()
      java.util.List<Feature> getFeatures()
      Returns the features for the translator.
      java.util.List<Feature> getLabels()
      Returns the labels for the translator.
      ai.djl.ndarray.NDList processInput​(ai.djl.translate.TranslatorContext ctx, ListFeatures input)
      TabularResults 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 Detail

      • TabularTranslator

        public TabularTranslator​(java.util.List<Feature> features,
                                 java.util.List<Feature> labels)
        Constructs a TabularTranslator with the given features and labels.
        Parameters:
        features - the features for inputs
        labels - the labels for outputs
      • TabularTranslator

        public TabularTranslator​(ai.djl.Model model,
                                 java.util.Map<java.lang.String,​?> arguments)
        Constructs a tabular translator for a model.
        Parameters:
        model - the model
        arguments - the arguments to build the translator with
    • Method Detail

      • processOutput

        public TabularResults processOutput​(ai.djl.translate.TranslatorContext ctx,
                                            ai.djl.ndarray.NDList list)
                                     throws java.lang.Exception
        Specified by:
        processOutput in interface ai.djl.translate.PostProcessor<TabularResults>
        Throws:
        java.lang.Exception
      • processInput

        public ai.djl.ndarray.NDList processInput​(ai.djl.translate.TranslatorContext ctx,
                                                  ListFeatures input)
                                           throws java.lang.Exception
        Specified by:
        processInput in interface ai.djl.translate.PreProcessor<ListFeatures>
        Throws:
        java.lang.Exception
      • getExpansions

        public ai.djl.translate.TranslatorOptions getExpansions()
        Specified by:
        getExpansions in interface ai.djl.translate.Translator<ListFeatures,​TabularResults>
      • getFeatures

        public java.util.List<Feature> getFeatures()
        Returns the features for the translator.
        Returns:
        the features for the translator
      • getLabels

        public java.util.List<Feature> getLabels()
        Returns the labels for the translator.
        Returns:
        the labels for the translator