Beispiel #1
0
 /// <summary>
 /// Creates an instance of Trapezoid transfer function with the specified
 /// properties.
 /// </summary>
 /// <param name="properties"></param>
 public Trapezoid(Properties properties)
 {
     this.LeftLow = (Double)properties.GetProperty("transferFunction.leftLow");
     this.LeftHigh = (Double)properties.GetProperty("transferFunction.leftHigh");
     this.RightLow = (Double)properties.GetProperty("transferFunction.rightLow");
     this.RightHigh = (Double)properties.GetProperty("transferFunction.rightHigh");
 }
Beispiel #2
0
 /// <summary>
 /// Creates an instance of Ramp transfer function with specified properties.
 /// </summary>
 /// <param name="properties"></param>
 public Ramp(Properties properties)
 {
     this.Slope = (Double)properties.GetProperty("transferFunction.slope");
     this.YHigh = (Double)properties.GetProperty("transferFunction.yHigh");
     this.YLow = (Double)properties.GetProperty("transferFunction.yLow");
     this.XHigh = (Double)properties.GetProperty("transferFunction.xHigh");
     this.XLow = (Double)properties.GetProperty("transferFunction.xLow");
 }
Beispiel #3
0
        /// <summary>
        /// Creates and returns instance of transfer function 
        /// </summary>
        /// <param name="tfProperties">transfer function properties</param>
        /// <returns>returns transfer function</returns>
        private static TransferFunction CreateTransferFunction(Properties tfProperties)
        {
            TransferFunction transferFunction = null;

            Type tfClass = (Type)tfProperties.GetProperty("transferFunction");

            ParameterInfo[] paramTypes = null;

            ConstructorInfo[] cons = tfClass.GetConstructors();
            for (int i = 0; i < cons.Length; i++)
            {
                paramTypes = cons[i].GetParameters();

                // use constructor with one parameter of Properties type
                if ((paramTypes.Length == 1) && (paramTypes[0].GetType() == typeof(Properties)))
                {
                    Type[] argTypes = new Type[1];
                    argTypes[0] = typeof(Properties);
                    ConstructorInfo ct = tfClass.GetConstructor(argTypes);

                    Object[] argList = new Object[1];
                    argList[0] = tfProperties;
                    transferFunction = (TransferFunction)ct.Invoke(argList);
                    break;
                }
                else if (paramTypes.Length == 0)
                { // use constructor without params
                    transferFunction = (TransferFunction)Activator.CreateInstance(tfClass);
                    break;
                }
            }

            return transferFunction;
        }
Beispiel #4
0
 /// <summary>
 /// Creates an instance of Tanh neuron transfer function with the
 /// specified properties. 
 /// </summary>
 /// <param name="properties">properties of the Tanh function</param>
 public Tanh(Properties properties)
 {
     this.Slope = (Double)properties.GetProperty("transferFunction.slope");
 }
Beispiel #5
0
 /// <summary>
 /// Returns the properties of this function 
 /// </summary>
 /// <returns>properties of this function</returns>
 public Properties GetProperties()
 {
     Properties properties = new Properties();
     properties.SetProperty("transferFunction.yHigh", YHigh);
     properties.SetProperty("transferFunction.yLow", YLow);
     return properties;
 }
Beispiel #6
0
 /// <summary>
 /// Creates an instance of Step transfer function with specified properties
 /// </summary>
 /// <param name="properties"></param>
 public Step(Properties properties)
 {
     this.YHigh = (Double)properties.GetProperty("transferFunction.yHigh");
     this.YLow = (Double)properties.GetProperty("transferFunction.yLow");
 }
 public Properties GetTransferFunctionProperties()
 {
     Properties tfProperties = new Properties();
     foreach (String name in this.Keys)
     {
         if (name.IndexOf("transferFunction") != -1)
         {
             tfProperties.SetProperty(name, this.Get(name));
         }
     }
     return tfProperties;
 }
Beispiel #8
0
 /// <summary>
 /// Returns the properties of this function 
 /// </summary>
 /// <returns>properties of this function</returns>
 public Properties GetProperties()
 {
     Properties properties = new Properties();
     properties.SetProperty("transferFunction", TransferFunctionType.SGN.GetTypeCode());
     return properties;
 }
Beispiel #9
0
 /// <summary>
 /// Creates an instance of Gaussian neuron transfer function with the
 /// specified properties. 
 /// </summary>
 /// <param name="properties">properties of the Gaussian function</param>
 public Gaussian(Properties properties)
 {
     this.Sigma = (Double)properties.GetProperty("transferFunction.sigma");
 }