示例#1
0
        static float CalcCPUCT(int n)
        {
            float CPUCT_EXTRA = (CPUCT_FACTOR == 0) ? 0 : CPUCT_FACTOR *FastLog.Ln((n + CPUCT_BASE + 1.0f) / CPUCT_BASE); // ?? should parentN be min 1.0f as above

            float thisCPUCT = CPUCT + CPUCT_EXTRA;

            return(thisCPUCT);
        }
示例#2
0
        /// <summary>
        /// Calculators CPUCT coefficient for a node with specified characteristics.
        /// </summary>
        /// <param name="parentIsRoot"></param>
        /// <param name="dualSelectorMode"></param>
        /// <param name="selectorID"></param>
        /// <param name="parentN"></param>
        /// <returns></returns>
        public float CalcCPUCT(bool parentIsRoot, bool dualSelectorMode, int selectorID, float parentN)
        {
            if (parentIsRoot)
            {
                float CPUCT_EXTRA = (CPUCTFactorAtRoot == 0) ? 0 : CPUCTFactorAtRoot *FastLog.Ln((parentN + CPUCTBaseAtRoot + 1.0f) / CPUCTBaseAtRoot);

                float thisCPUCT  = CPUCTAtRoot + CPUCT_EXTRA;
                float cpuctValue = CPUCTForSelector(dualSelectorMode, selectorID, thisCPUCT);
                return(cpuctValue);
            }
            else
            {
                float CPUCT_EXTRA = (CPUCTFactor == 0) ? 0 : CPUCTFactor *FastLog.Ln((parentN + CPUCTBase + 1.0f) / CPUCTBase);

                float thisCPUCT  = CPUCT + CPUCT_EXTRA;
                float cpuctValue = CPUCTForSelector(dualSelectorMode, selectorID, thisCPUCT);
                return(cpuctValue);
            }
        }