Esempio n. 1
0
        public void TestGetKeyByFieldName()
        {
            Parameters.KEY expected = Parameters.KEY.POTENTIAL_PCT;
            Assert.AreEqual(expected, Parameters.KEY.GetKeyByFieldName("potentialPct"));

            Assert.IsFalse(expected.Equals(Parameters.KEY.GetKeyByFieldName("random")));
        }
Esempio n. 2
0
        private Parameters GetDefaultParameters(Parameters p, Parameters.KEY key, Object value)
        {
            Parameters retVal = p == null?GetDefaultParameters() : p;

            retVal.SetParameterByKey(key, value);

            return(retVal);
        }
Esempio n. 3
0
        /// <summary>
        /// Adds the ability to alter a given parameter in place during a fluent
        /// creation statement. This {@code Layer}'s {@link Parameters} object is
        /// copied and then the specified key/value pair are set on the internal
        /// copy. This call does not affect the original Parameters object so that
        /// local modifications may be made without having to reset them afterward
        /// for subsequent use with another network structure.
        /// </summary>
        /// <param name="key">The parameter key</param>
        /// <param name="value">The value of the parameter</param>
        /// <returns>this Layer instance (in fluent-style)</returns>
        public ILayer AlterParameter(Parameters.KEY key, object value)
        {
            if (IsClosed())
            {
                throw new InvalidOperationException("Layer already \"closed\"");
            }

            // Preserve any input dimensions that might have been set prior to this
            // in
            // previous layers
            int[] inputDims = (int[])Params.GetParameterByKey(Parameters.KEY.INPUT_DIMENSIONS);

            Params = Params.Copy();
            Params.SetParameterByKey(key, value);
            Params.SetParameterByKey(Parameters.KEY.INPUT_DIMENSIONS, inputDims);

            if (key == Parameters.KEY.AUTO_CLASSIFY)
            {
                AutoCreateClassifiers = value != null && ((bool)value);
                // Note the addition of a classifier
                AlgoContentMask |= LayerMask.ClaClassifier;
            }
            return(this);
        }
Esempio n. 4
0
 public void TestGetMinMax()
 {
     Parameters.KEY synPermActInc = Parameters.KEY.SYN_PERM_ACTIVE_INC;
     Assert.AreEqual(0.0, synPermActInc.GetMin());
     Assert.AreEqual(1.0, synPermActInc.GetMax());
 }