示例#1
0
 /// <summary>
 /// The deep copy constructor
 /// </summary>
 /// <param name="source">Source instance</param>
 public ReadoutLayerSettings(ReadoutLayerSettings source)
 {
     //Copy
     TestDataRatio            = source.TestDataRatio;
     NumOfFolds               = source.NumOfFolds;
     ReadoutUnitCfgCollection = new List <ReadoutUnitSettings>();
     foreach (ReadoutUnitSettings rus in source.ReadoutUnitCfgCollection)
     {
         ReadoutUnitCfgCollection.Add(rus.DeepClone());
     }
     return;
 }
示例#2
0
 //Constructor
 /// <summary>
 /// Creates an uninitialized instance
 /// </summary>
 /// <param name="settings">Readout layer configuration</param>
 /// <param name="dataRange">Range of input/output data</param>
 public ReadoutLayer(ReadoutLayerSettings settings, Interval dataRange)
 {
     _settings  = settings.DeepClone();
     _dataRange = dataRange.DeepClone();
     foreach (ReadoutLayerSettings.ReadoutUnitSettings rus in _settings.ReadoutUnitCfgCollection)
     {
         if (!rus.OutputRange.BelongsTo(_dataRange.Min) || !rus.OutputRange.BelongsTo(_dataRange.Max))
         {
             throw new Exception($"Readout unit {rus.Name} does not support data range <{_dataRange.Min}; {_dataRange.Max}>.");
         }
     }
     //Clusters
     _clusterCollection = new ReadoutUnit[_settings.ReadoutUnitCfgCollection.Count][];
     _clusterErrStatisticsCollection = new List <ClusterErrStatistics>();
     return;
 }
示例#3
0
 //Constructor
 /// <summary>
 /// Creates an uninitialized instance
 /// </summary>
 /// <param name="settings">Readout layer configuration</param>
 public ReadoutLayer(ReadoutLayerSettings settings)
 {
     _settings = settings.DeepClone();
     _predictorNormalizerCollection = null;
     _outputNormalizerCollection    = null;
     _predictorsMapper = null;
     foreach (ReadoutLayerSettings.ReadoutUnitSettings rus in _settings.ReadoutUnitCfgCollection)
     {
         if (!rus.OutputRange.BelongsTo(DataRange.Min) || !rus.OutputRange.BelongsTo(DataRange.Max))
         {
             throw new Exception($"Readout unit {rus.Name} does not support data range <{DataRange.Min}; {DataRange.Max}>.");
         }
     }
     //Clusters
     _clusterCollection = new ReadoutUnit[_settings.ReadoutUnitCfgCollection.Count][];
     _clusterErrStatisticsCollection = new List <ClusterErrStatistics>();
     return;
 }
示例#4
0
        //Methods
        /// <summary>
        /// See the base.
        /// </summary>
        public override bool Equals(object obj)
        {
            if (obj == null)
            {
                return(false);
            }
            ReadoutLayerSettings cmpSettings = obj as ReadoutLayerSettings;

            if (TestDataRatio != cmpSettings.TestDataRatio ||
                NumOfFolds != cmpSettings.NumOfFolds ||
                ReadoutUnitCfgCollection.Count != cmpSettings.ReadoutUnitCfgCollection.Count
                )
            {
                return(false);
            }
            for (int i = 0; i < ReadoutUnitCfgCollection.Count; i++)
            {
                if (!ReadoutUnitCfgCollection[i].Equals(cmpSettings.ReadoutUnitCfgCollection[i]))
                {
                    return(false);
                }
            }
            return(true);
        }
示例#5
0
 /// <summary>
 /// The deep copy constructor.
 /// </summary>
 /// <param name="source">The source instance.</param>
 public ReadoutLayerSettings(ReadoutLayerSettings source)
     : this(source.TaskDefaultsCfg, source.ReadoutUnitsCfg, source.OneTakesAllGroupsCfg)
 {
     return;
 }
示例#6
0
        /// <summary>
        /// Creates the deep copy instance of this instance
        /// </summary>
        public ReadoutLayerSettings DeepClone()
        {
            ReadoutLayerSettings clone = new ReadoutLayerSettings(this);

            return(clone);
        }
示例#7
0
文件: ReadoutLayer.cs 项目: thild/NET
 //Constructor
 /// <summary>
 /// Creates an uninitialized instance
 /// </summary>
 /// <param name="settings">Readout layer configuration</param>
 public ReadoutLayer(ReadoutLayerSettings settings)
 {
     Settings = (ReadoutLayerSettings)settings.DeepClone();
     Reset();
     return;
 }
示例#8
0
 /// <summary>
 /// The deep copy constructor
 /// </summary>
 /// <param name="source">Source instance</param>
 public ReadoutLayerSettings(ReadoutLayerSettings source)
     : this(source.ReadoutUnitsCfg, source.TestDataRatio, source.Folds, source.Repetitions, source.DefaultNetworksCfg)
 {
     return;
 }
示例#9
0
 //Constructor
 /// <summary>
 /// Creates an uninitialized instance.
 /// </summary>
 /// <param name="readoutLayerCfg">The readout layer configuration.</param>
 public ReadoutLayer(ReadoutLayerSettings readoutLayerCfg)
 {
     ReadoutLayerCfg = (ReadoutLayerSettings)readoutLayerCfg.DeepClone();
     Reset();
     return;
 }