Class MLP

    • Field Detail

      • OPTIMIZER_RMSPROP_RESET

        public static final int OPTIMIZER_RMSPROP_RESET
        See Also:
        Constant Field Values
      • OPTIMIZER_ADAGRAD_RESET

        public static final int OPTIMIZER_ADAGRAD_RESET
        See Also:
        Constant Field Values
      • samplesSeen

        protected long samplesSeen
      • trainedCount

        protected long trainedCount
      • learningRateOption

        public FloatOption learningRateOption
      • backPropLossThreshold

        public FloatOption backPropLossThreshold
      • useOneHotEncode

        public FlagOption useOneHotEncode
      • useNormalization

        public FlagOption useNormalization
      • numberOfNeuronsInEachLayerInLog2

        public IntOption numberOfNeuronsInEachLayerInLog2
      • numberOfLayers

        public IntOption numberOfLayers
      • miniBatchSize

        public IntOption miniBatchSize
      • djlRandomSeed

        public IntOption djlRandomSeed
      • deltaForADWIN

        public double deltaForADWIN
      • lossEstimator

        public ADWIN lossEstimator
      • modelName

        public String modelName
      • nnmodel

        protected ai.djl.Model nnmodel
      • trainer

        protected ai.djl.training.Trainer trainer
      • featureValuesArraySize

        protected int featureValuesArraySize
    • Constructor Detail

      • MLP

        public MLP()
    • Method Detail

      • resetLearningImpl

        public void resetLearningImpl()
        Description copied from class: AbstractClassifier
        Resets this classifier. It must be similar to starting a new classifier from scratch.

        The reason for ...Impl methods: ease programmer burden by not requiring them to remember calls to super in overridden methods. Note that this will produce compiler errors if not overridden.
        Specified by:
        resetLearningImpl in class AbstractClassifier
      • trainOnMiniBatch

        public void trainOnMiniBatch​(moa.classifiers.deeplearning.MiniBatch batch,
                                     boolean trainNet)
      • trainOnInstanceImpl

        public void trainOnInstanceImpl​(Instance inst)
        Description copied from class: AbstractClassifier
        Trains this classifier incrementally using the given instance.

        The reason for ...Impl methods: ease programmer burden by not requiring them to remember calls to super in overridden methods. Note that this will produce compiler errors if not overridden.
        Specified by:
        trainOnInstanceImpl in class AbstractClassifier
        Parameters:
        inst - the instance to be used for training
      • getVotesForFeatureValues

        public double[] getVotesForFeatureValues​(Instance inst,
                                                 double[] featureValues)
      • getVotesForFeatureValues

        public double[] getVotesForFeatureValues​(Instance inst)
      • getVotesForInstance

        public double[] getVotesForInstance​(Instance inst)
        Description copied from interface: Classifier
        Predicts the class memberships for a given instance. If an instance is unclassified, the returned array elements must be all zero.
        Specified by:
        getVotesForInstance in interface Classifier
        Specified by:
        getVotesForInstance in class AbstractClassifier
        Parameters:
        inst - the instance to be classified
        Returns:
        an array containing the estimated membership probabilities of the test instance in each class
      • getModelMeasurementsImpl

        protected Measurement[] getModelMeasurementsImpl()
        Description copied from class: AbstractClassifier
        Gets the current measurements of this classifier.

        The reason for ...Impl methods: ease programmer burden by not requiring them to remember calls to super in overridden methods. Note that this will produce compiler errors if not overridden.
        Specified by:
        getModelMeasurementsImpl in class AbstractClassifier
        Returns:
        an array of measurements to be used in evaluation tasks
      • getModelDescription

        public void getModelDescription​(StringBuilder out,
                                        int indent)
        Description copied from class: AbstractClassifier
        Returns a string representation of the model.
        Specified by:
        getModelDescription in class AbstractClassifier
        Parameters:
        out - the stringbuilder to add the description
        indent - the number of characters to indent
      • isRandomizable

        public boolean isRandomizable()
        Description copied from interface: Learner
        Gets whether this learner needs a random seed. Examples of methods that needs a random seed are bagging and boosting.
        Specified by:
        isRandomizable in interface Learner<Example<Instance>>
        Returns:
        true if the learner needs a random seed.
      • getFeatureValuesArraySize

        public static int getFeatureValuesArraySize​(Instance inst,
                                                    boolean useOneHotEncoding)
      • getNormalizedValue

        public static double getNormalizedValue​(double value,
                                                double sumOfValues,
                                                double sumOfSquares,
                                                long samplesSeen)
      • setFeatureValuesArray

        public static void setFeatureValuesArray​(Instance inst,
                                                 double[] featureValuesArrayToSet,
                                                 boolean useOneHotEncoding,
                                                 boolean testing,
                                                 MLP.NormalizeInfo[] normalizeInfo,
                                                 long samplesSeen)
      • initializeNetwork

        public void initializeNetwork​(Instance inst)
      • getLossEstimation

        public double getLossEstimation()
      • setModel

        protected void setModel()
      • setTrainer

        protected void setTrainer()