Пример #1
0
        public SVR_Q(SVMProblem prob, SVMParam param)
            : base(prob.ProblemSize, prob.x, param)
        {
            l     = prob.ProblemSize;
            cache = new Cache(l, (long)(param.CacheSizeInMB * (1 << 20)));
            QD    = new double[2 * l];
            sign  = new int[2 * l];
            index = new int[2 * l];
            for (int k = 0; k < l; k++)
            {
                sign[k]      = 1;
                sign[k + l]  = -1;
                index[k]     = k;
                index[k + l] = k;
                QD[k]        = kernel_function(k, k);
                QD[k + l]    = QD[k];
            }
            buffer = new float[2][];
            for (int i = 0; i < buffer.Length; ++i)
            {
                buffer[i] = new float[2 * l];
            }

            next_buffer = 0;
        }
Пример #2
0
 public ONE_CLASS_Q(SVMProblem prob, SVMParam param)
     : base(prob.ProblemSize, prob.x, param)
 {
     cache = new Cache(prob.ProblemSize, (long)(param.CacheSizeInMB * (1 << 20)));
     QD    = new double[prob.ProblemSize];
     for (int i = 0; i < prob.ProblemSize; i++)
     {
         QD[i] = kernel_function(i, i);
     }
 }
Пример #3
0
 public SVC_Q(SVMProblem prob, SVMParam param, int[] y_)
     : base(prob.ProblemSize, prob.x, param)
 {
     y     = (int[])y_.Clone();
     cache = new Cache(prob.ProblemSize, (long)(param.CacheSizeInMB * (1 << 20)));
     QD    = new double[prob.ProblemSize];
     for (int i = 0; i < prob.ProblemSize; i++)
     {
         QD[i] = kernel_function(i, i);
     }
 }