Class LogPrior

    • Constructor Detail

      • LogPrior

        public LogPrior()
      • LogPrior

        public LogPrior​(int intPrior)
      • LogPrior

        public LogPrior​(int intPrior,
                        double sigma,
                        double epsilon)
      • LogPrior

        public LogPrior​(double[] C)
        IMPORTANT NOTE: This constructor allows non-uniform regularization, but it transforms the inputs C (like the machine learning people like) to sigma (like we NLP folks like). C = 1/\sigma^2
    • Method Detail

      • getAdaptationPrior

        public static LogPrior getAdaptationPrior​(double[] means,
                                                  LogPrior otherPrior)
      • getSigma

        public double getSigma()
      • getSigmaSquared

        public double getSigmaSquared()
      • getSigmaSquaredM

        public double[] getSigmaSquaredM()
      • getEpsilon

        public double getEpsilon()
      • setSigma

        public void setSigma​(double sigma)
      • setSigmaSquared

        public void setSigmaSquared​(double sigmaSq)
      • setSigmaSquaredM

        public void setSigmaSquaredM​(double[] sigmaSq)
      • setEpsilon

        public void setEpsilon​(double epsilon)
      • computeStochastic

        public double computeStochastic​(double[] x,
                                        double[] grad,
                                        double fractionOfData)
      • compute

        public double compute​(double[] x,
                              double[] grad)
        Adjust the given grad array by adding the prior's gradient component and return the value of the logPrior
        Parameters:
        x - the input point
        grad - the gradient array
        Returns:
        the value