Class BaseLabels

    • Constructor Detail

      • BaseLabels

        protected BaseLabels​(String textResource)
                      throws IOException
        No need to override anything with this constructor.
        Parameters:
        textResource - name of a resource containing labels as a list in a text file.
        Throws:
        IOException
    • Method Detail

      • getLabel

        public String getLabel​(int n)
        Description copied from interface: Labels
        Returns the description of the nth class from the classes of a dataset.
        Specified by:
        getLabel in interface Labels
        Returns:
        label description
      • decodePredictions

        public List<List<ClassPrediction>> decodePredictions​(INDArray predictions,
                                                             int n)
        Description copied from interface: Labels
        Given predictions from the trained model this method will return a list of the top n matches and the respective probabilities.
        Specified by:
        decodePredictions in interface Labels
        Parameters:
        predictions - raw
        Returns:
        decoded predictions
      • getURL

        protected abstract URL getURL()
        Returns:
        URL of the resource to download
      • resourceName

        protected abstract String resourceName()
        Returns:
        Name of the resource (used for inferring local storage parent directory)
      • resourceMD5

        protected abstract String resourceMD5()
        Returns:
        MD5 of the resource at getURL()
      • getResourceFile

        protected File getResourceFile()
        Download the resource at getURL() to the local resource directory, and return the local copy as a File
        Returns:
        File of the local resource