예제 #1
0
        //Methods
        /// <inheritdoc/>
        protected override void Check()
        {
            if (Name.Length == 0)
            {
                throw new ArgumentException($"Name can not be empty.", "Name");
            }
            Type activationType = ActivationCfg.GetType();

            if (activationType != typeof(AFAnalogSQNLSettings) &&
                activationType != typeof(AFAnalogElliotSettings) &&
                activationType != typeof(AFAnalogGaussianSettings) &&
                activationType != typeof(AFAnalogISRUSettings) &&
                activationType != typeof(AFAnalogSigmoidSettings) &&
                activationType != typeof(AFAnalogSincSettings) &&
                activationType != typeof(AFAnalogSinusoidSettings) &&
                activationType != typeof(AFAnalogTanHSettings)
                )
            {
                throw new ArgumentException($"Not allowed Activation settings {activationType.Name}.", "ActivationCfg");
            }
            if (FiringThreshold < 0 || FiringThreshold > 1)
            {
                throw new ArgumentException($"Invalid FiringThreshold {FiringThreshold.ToString(CultureInfo.InvariantCulture)}. FiringThreshold must be GE to 0 and LE to 1.", "FiringThreshold");
            }
            if (ThresholdMaxRefDeepness < 1)
            {
                throw new ArgumentException($"Invalid ThresholdMaxRefDeepness {ThresholdMaxRefDeepness.ToString(CultureInfo.InvariantCulture)}. ThresholdMaxRefDeepness must be GT 1.", "ThresholdMaxRefDeepness");
            }
            return;
        }
예제 #2
0
        //Methods
        /// <summary>
        /// Checks consistency
        /// </summary>
        protected override void Check()
        {
            if (Name.Length == 0)
            {
                throw new ArgumentException($"Name can not be empty.", "Name");
            }
            Type activationType = ActivationCfg.GetType();

            if (activationType != typeof(SimpleIFSettings) &&
                activationType != typeof(LeakyIFSettings) &&
                activationType != typeof(ExpIFSettings) &&
                activationType != typeof(AdExpIFSettings) &&
                activationType != typeof(IzhikevichIFSettings) &&
                activationType != typeof(AutoIzhikevichIFSettings)
                )
            {
                throw new ArgumentException($"Not allowed activation type {activationType.Name}.", "ActivationCfg");
            }
            return;
        }