Exemple #1
0
 /// <summary>
 /// The deep copy constructor
 /// </summary>
 /// <param name="source">Source instance</param>
 public FeedForwardNetworkSettings(FeedForwardNetworkSettings source)
 {
     OutputLayerActivation = null;
     OutputRange           = null;
     if (source.OutputLayerActivation != null)
     {
         OutputLayerActivation = ActivationFactory.DeepCloneActivationSettings(source.OutputLayerActivation);
         OutputRange           = source.OutputRange.DeepClone();
     }
     RegressionMethod      = source.RegressionMethod;
     HiddenLayerCollection = new List <HiddenLayerSettings>(source.HiddenLayerCollection.Count);
     foreach (HiddenLayerSettings shls in source.HiddenLayerCollection)
     {
         HiddenLayerCollection.Add(shls.DeepClone());
     }
     LinRegrTrainerCfg = null;
     RPropTrainerCfg   = null;
     if (source.LinRegrTrainerCfg != null)
     {
         LinRegrTrainerCfg = source.LinRegrTrainerCfg.DeepClone();
     }
     if (source.RPropTrainerCfg != null)
     {
         RPropTrainerCfg = source.RPropTrainerCfg.DeepClone();
     }
     return;
 }
Exemple #2
0
 //Constructors
 /// <summary>
 /// Creates an initialized instance
 /// </summary>
 /// <param name="numOfNeurons">Number of hidden layer neurons</param>
 /// <param name="activationCfg">Layer activation configuration</param>
 public HiddenLayerSettings(int numOfNeurons, RCNetBaseSettings activationCfg)
 {
     NumOfNeurons  = numOfNeurons;
     ActivationCfg = ActivationFactory.DeepCloneActivationSettings(activationCfg);
     Check();
     return;
 }
Exemple #3
0
 /// <summary>
 /// The deep copy constructor
 /// </summary>
 /// <param name="source">Source instance</param>
 public FeedForwardNetworkSettings(FeedForwardNetworkSettings source)
 {
     OutputActivationCfg = ActivationFactory.DeepCloneActivationSettings(source.OutputActivationCfg);
     OutputRange         = source.OutputRange.DeepClone();
     HiddenLayersCfg     = (HiddenLayersSettings)source.HiddenLayersCfg.DeepClone();
     TrainerCfg          = source.TrainerCfg.DeepClone();
     return;
 }
Exemple #4
0
 /// <summary>
 /// Copy constructor
 /// </summary>
 /// <param name="source">Source instance</param>
 public HiddenLayerSettings(HiddenLayerSettings source)
 {
     NumOfNeurons = source.NumOfNeurons;
     Activation   = null;
     if (source.Activation != null)
     {
         Activation = ActivationFactory.DeepCloneActivationSettings(source.Activation);
     }
     return;
 }
Exemple #5
0
 /// <summary>
 /// The deep copy constructor
 /// </summary>
 /// <param name="source">Source instance</param>
 public NeuronGroupSettings(NeuronGroupSettings source)
 {
     Name            = source.Name;
     Role            = source.Role;
     RelativeShare   = source.RelativeShare;
     AugmentedStates = source.AugmentedStates;
     Count           = source.Count;
     ActivationCfg   = ActivationFactory.DeepCloneActivationSettings(source.ActivationCfg);
     BiasCfg         = source.BiasCfg.DeepClone();
     return;
 }
Exemple #6
0
 //Constructors
 /// <summary>
 /// Creates an initialized instance
 /// </summary>
 /// <param name="outputActivationCfg">Output layer activation configuration</param>
 /// <param name="hiddenLayersCfg">Hidden layers configuration. Hidden layers are optional.</param>
 /// <param name="trainerCfg">Configuration of associated trainer</param>
 public FeedForwardNetworkSettings(RCNetBaseSettings outputActivationCfg,
                                   HiddenLayersSettings hiddenLayersCfg,
                                   RCNetBaseSettings trainerCfg
                                   )
 {
     OutputActivationCfg = ActivationFactory.DeepCloneActivationSettings(outputActivationCfg);
     OutputRange         = ActivationFactory.GetInfo(OutputActivationCfg, out _, out _);
     HiddenLayersCfg     = hiddenLayersCfg == null ? new HiddenLayersSettings() : (HiddenLayersSettings)hiddenLayersCfg.DeepClone();
     TrainerCfg          = trainerCfg.DeepClone();
     Check();
     return;
 }
Exemple #7
0
 //Constructors
 /// <summary>
 /// The deep copy constructor
 /// </summary>
 /// <param name="source">Source instance</param>
 public NeuronGroupSettings(NeuronGroupSettings source)
 {
     Name                     = source.Name;
     Role                     = source.Role;
     RelativeShare            = source.RelativeShare;
     ReadoutNeuronsDensity    = source.ReadoutNeuronsDensity;
     Count                    = source.Count;
     ActivationType           = source.ActivationType;
     ActivationCfg            = ActivationFactory.DeepCloneActivationSettings(source.ActivationCfg);
     SignalingRestriction     = source.SignalingRestriction;
     BiasCfg                  = source.BiasCfg?.DeepClone();
     AnalogFiringThreshold    = source.AnalogFiringThreshold;
     RetainmentNeuronsDensity = source.RetainmentNeuronsDensity;
     RetainmentStrengthCfg    = source.RetainmentStrengthCfg?.DeepClone();
     PredictorsCfg            = source.PredictorsCfg?.DeepClone();
     return;
 }
Exemple #8
0
 /// <summary>
 /// Copy constructor
 /// </summary>
 /// <param name="source">Source instance</param>
 public HiddenLayerSettings(HiddenLayerSettings source)
 {
     NumOfNeurons  = source.NumOfNeurons;
     ActivationCfg = ActivationFactory.DeepCloneActivationSettings(source.ActivationCfg);
     return;
 }