Example #1
0
        public float GetProbablity(List <float> instance)
        {
            float  prob = 1;
            string line = pose_name;

            byte [] bytes = BitConverter.GetBytes((int)mask);

            //byte [] bytes = BitConverter.GetBytes(mask);
            BitArray bits = new BitArray(bytes);

            Debug.Log("Converted to bits");

            //only look at the relevant angles
            for (int i = 0; i < instance.Count; i++)
            {
                if (bits[i])                //check if this feature is active in our mask


                //DEBUGGING :
                {
                    Debug.Log("looking at joint mask " + i);


                    feature feat     = features[i];
                    float   new_prob = feat.CalculateProbability(instance[i]);
                    line += " " + new_prob;

                    if (new_prob < .1f)
                    {
                        new_prob = .1f;
                    }
                    prob *= new_prob;
                }
            }

            /*for(int i = 0; i < features.Count && i < instance.Count; i++){
             *      feature feat = features[i];
             *      float new_prob = feat.CalculateProbability(instance[i]);
             *
             *      Debug.Log(new_prob);
             *
             *      line += " " + new_prob;
             *
             *      if(new_prob < .1f)
             *              new_prob = .1f;
             *      prob*=new_prob;
             * }*/

            line += ": " + prob;
            Debug.Log(line);
            return(prob);
        }
        public float GetProbablity(List <float> instance)
        {
            float  prob = 1;
            string line = pose_name;

            for (int i = 0; i < features.Count && i < instance.Count; i++)
            {
                feature feat     = features[i];
                float   new_prob = feat.CalculateProbability(instance[i]);

                line += " " + new_prob;

//					features[i].CalculateProbablity(instance[i]);
                if (new_prob < .1f)
                {
                    new_prob = .1f;
                }
                prob *= new_prob;
            }

            line += ": " + prob;
            //Debug.Log(line);
            return(prob);
        }