Class BaseDataFetcher

    • Field Detail

      • log

        protected static final org.slf4j.Logger log
      • cursor

        protected int cursor
      • numOutcomes

        protected int numOutcomes
      • inputColumns

        protected int inputColumns
      • totalExamples

        protected int totalExamples
      • topLevelDir

        protected File topLevelDir
    • Constructor Detail

      • BaseDataFetcher

        public BaseDataFetcher()
    • Method Detail

      • topLevelDir

        public File topLevelDir()
        Description copied from interface: DataSetFetcher
        The top level directory to download datasets from This will usually be the default dl4j resources directory at user home/.deeplearning4j
        Specified by:
        topLevelDir in interface DataSetFetcher
        Returns:
      • setTopLevelDir

        public void setTopLevelDir​(File topLevelDir)
        Description copied from interface: DataSetFetcher
        For file download datasets this sets a top level directory outside the default
        Specified by:
        setTopLevelDir in interface DataSetFetcher
        Parameters:
        topLevelDir - the top level directory to use
      • createInputMatrix

        protected INDArray createInputMatrix​(int numRows)
        Creates a feature vector
        Parameters:
        numRows - the number of examples
        Returns:
        a feature vector
      • createOutputVector

        protected INDArray createOutputVector​(int outcomeLabel)
        Creates an output label matrix
        Parameters:
        outcomeLabel - the outcome label to use
        Returns:
        a binary vector where 1 is transform to the index specified by outcomeLabel
      • createOutputMatrix

        protected INDArray createOutputMatrix​(int numRows)
      • initializeCurrFromList

        protected void initializeCurrFromList​(List<DataSet> examples)
        Initializes this data transform fetcher from the passed in datasets
        Parameters:
        examples - the examples to use
      • hasMore

        public boolean hasMore()
        Description copied from interface: DataSetFetcher
        Whether the dataset has more to load
        Specified by:
        hasMore in interface DataSetFetcher
        Returns:
        whether the data applyTransformToDestination has more to load
      • next

        public DataSet next()
        Description copied from interface: DataSetFetcher
        Returns the next data applyTransformToDestination
        Specified by:
        next in interface DataSetFetcher
        Returns:
        the next dataset
      • totalOutcomes

        public int totalOutcomes()
        Description copied from interface: DataSetFetcher
        The number of labels for a dataset
        Specified by:
        totalOutcomes in interface DataSetFetcher
        Returns:
        the number of labels for a dataset
      • inputColumns

        public int inputColumns()
        Description copied from interface: DataSetFetcher
        The length of a feature vector for an individual example
        Specified by:
        inputColumns in interface DataSetFetcher
        Returns:
        the length of a feature vector for an individual example
      • totalExamples

        public int totalExamples()
        Description copied from interface: DataSetFetcher
        The total number of examples
        Specified by:
        totalExamples in interface DataSetFetcher
        Returns:
        the total number of examples
      • reset

        public void reset()
        Description copied from interface: DataSetFetcher
        Returns the fetcher back to the beginning of the dataset
        Specified by:
        reset in interface DataSetFetcher
      • cursor

        public int cursor()
        Description copied from interface: DataSetFetcher
        Direct access to a number represenative of iterating through a dataset
        Specified by:
        cursor in interface DataSetFetcher
        Returns:
        a cursor similar to an index