/// <summary> /// Resets the readout layer to its initial untrained state. /// </summary> public void Reset() { _predictorFeatureFilterCollection = null; _outputFeatureFilterCollection = null; _predictorsMapper = null; _readoutUnitCollection = new ReadoutUnit[ReadoutLayerCfg.ReadoutUnitsCfg.ReadoutUnitCfgCollection.Count]; for (int i = 0; i < ReadoutLayerCfg.ReadoutUnitsCfg.ReadoutUnitCfgCollection.Count; i++) { ReadoutUnitSettings cfg = ReadoutLayerCfg.ReadoutUnitsCfg.ReadoutUnitCfgCollection[i]; _readoutUnitCollection[i] = new ReadoutUnit(i, cfg, ReadoutLayerCfg.TaskDefaultsCfg); } _oneTakesAllGroupCollection = null; if (ReadoutLayerCfg.OneTakesAllGroupsCfg != null) { _oneTakesAllGroupCollection = new OneTakesAllGroup[ReadoutLayerCfg.OneTakesAllGroupsCfg.OneTakesAllGroupCfgCollection.Count]; for (int i = 0; i < ReadoutLayerCfg.OneTakesAllGroupsCfg.OneTakesAllGroupCfgCollection.Count; i++) { OneTakesAllGroupSettings cfg = ReadoutLayerCfg.OneTakesAllGroupsCfg.OneTakesAllGroupCfgCollection[i]; _oneTakesAllGroupCollection[i] = new OneTakesAllGroup(i, cfg, ReadoutLayerCfg.GetOneTakesAllGroupMemberRUnitIndexes(cfg.Name)); } } Trained = false; ResetProgressTracking(); return; }
//Constructors /// <summary> /// Creates an itialized instance ready for build /// </summary> /// <param name="index">An index of this group within "One Takes All" groups of the readout layer.</param> /// <param name="groupCfg">The configuration of the "One Takes All" group.</param> /// <param name="memberReadoutUnitIndexes">The indexes of the member readout units.</param> public OneTakesAllGroup(int index, OneTakesAllGroupSettings groupCfg, IEnumerable <int> memberReadoutUnitIndexes ) { Index = index; Name = groupCfg.Name; _groupCfg = (OneTakesAllGroupSettings)groupCfg.DeepClone(); DecisionMethod = _groupCfg.DecisionCfg.DecisionMethod; MemberReadoutUnitIndexCollection = new List <int>(memberReadoutUnitIndexes); ProbabilisticClusterChain = null; return; }
/// <summary> /// The copy constructor. /// </summary> /// <param name="source">The source instance.</param> public OneTakesAllGroupSettings(OneTakesAllGroupSettings source) : this(source.Name, source.DecisionCfg) { return; }