/// <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; }
//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; }
//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; }
//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); }
/// <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; }
/// <summary> /// Creates the deep copy instance of this instance /// </summary> public ReadoutLayerSettings DeepClone() { ReadoutLayerSettings clone = new ReadoutLayerSettings(this); return(clone); }
//Constructor /// <summary> /// Creates an uninitialized instance /// </summary> /// <param name="settings">Readout layer configuration</param> public ReadoutLayer(ReadoutLayerSettings settings) { Settings = (ReadoutLayerSettings)settings.DeepClone(); Reset(); return; }
/// <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; }
//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; }