Class IgnoreCountsTrainer

  • All Implemented Interfaces:
    DistributionTrainer

    public class IgnoreCountsTrainer
    extends java.lang.Object
    implements DistributionTrainer
    A distribution trainer that just ignores all counts.
    Since:
    1.0
    Author:
    Matthew Pocock
    • Constructor Detail

      • IgnoreCountsTrainer

        protected IgnoreCountsTrainer()
        Constructor intended for sub-classes.
    • Method Detail

      • getCount

        public double getCount​(DistributionTrainerContext dtc,
                               AtomicSymbol sym)
                        throws IllegalSymbolException
        Description copied from interface: DistributionTrainer

        Get the current count for this state.

        This method may be called multiple times with the same symbol. Each time it should return the agregate of the counts added with addCount since the last invocation of clearCounts.

        Specified by:
        getCount in interface DistributionTrainer
        Parameters:
        dtc - the DistributionTrainerContext within which the count was added
        sym - the Symbol seen
        Returns:
        the agregate of the counts
        Throws:
        IllegalSymbolException - if sym is not recognised
      • train

        public void train​(DistributionTrainerContext dtc,
                          double weight)
        Description copied from interface: DistributionTrainer

        Trains the Distribution, given a null model.

        This will use the information collected with multiple addCount calls, and the null model to generate the new weights.

        This method should not modify the underlying counts.

        Specified by:
        train in interface DistributionTrainer
        Parameters:
        dtc - the context to use
        weight - how many lots of the null model to add
      • getInstance

        public static IgnoreCountsTrainer getInstance()
        Returns the global singleton instance of the IgnoreCountsTrainer.
        Returns:
        the singleton instance of this trainer