//Static methods /// <summary> /// Creates the simplified configuration of the input encoder. /// </summary> /// <remarks> /// Supports only external input fields of the the real numbers. /// </remarks> /// <param name="feedingCfg">The configuration of the input feeding.</param> /// <param name="spikesCoderCfg">The configuration of the input spikes coder.</param> /// <param name="extFieldNameCollection">The collection of the external input field names.</param> /// <param name="routeToReadout">Specifies whether to route inputs to readout layer.</param> public static InputEncoderSettings CreateInputCfg(IFeedingSettings feedingCfg, InputSpikesCoderSettings spikesCoderCfg, IEnumerable <string> extFieldNameCollection, bool routeToReadout = true ) { if (feedingCfg == null) { throw new ArgumentNullException("feedingCfg"); } if (spikesCoderCfg == null) { spikesCoderCfg = new InputSpikesCoderSettings(); } List <ExternalFieldSettings> extFieldCollection = new List <ExternalFieldSettings>(); foreach (string name in extFieldNameCollection) { extFieldCollection.Add(new ExternalFieldSettings(name, new RealFeatureFilterSettings(), routeToReadout)); } ExternalFieldsSettings extFieldsCfg = new ExternalFieldsSettings(extFieldCollection); VaryingFieldsSettings fieldsCfg = new VaryingFieldsSettings(spikesCoderCfg, extFieldsCfg, null, null, routeToReadout); return(new InputEncoderSettings(feedingCfg, fieldsCfg)); }
//Methods /// <summary> /// Creates input part of the neural preprocessor's configuration. /// </summary> private InputEncoderSettings CreateInputCfg() { //Definition of input external fields //In this example we will use three of available input fields: "High" price, "Low" price and "Adj Close" price. //We want to route input fields to readout layer together with other predictors const bool RouteToReadout = true; //All 3 input fields are real numbers and thus they should be standardly normalized and standardized. RealFeatureFilterSettings realFeatureFilterCfg = new RealFeatureFilterSettings(true, true); //Input fields collection ExternalFieldSettings extFieldHighCfg = new ExternalFieldSettings("High", realFeatureFilterCfg, RouteToReadout); ExternalFieldSettings extFieldLowCfg = new ExternalFieldSettings("Low", realFeatureFilterCfg, RouteToReadout); ExternalFieldSettings extFieldAdjCloseCfg = new ExternalFieldSettings("Adj Close", realFeatureFilterCfg, RouteToReadout); ExternalFieldsSettings externalFieldsCfg = new ExternalFieldsSettings(extFieldHighCfg, extFieldLowCfg, extFieldAdjCloseCfg); //Definition of the continuous input feeding //We use FeedingContinuousSettings.AutoBootCyclesNum so necessary number of boot cycles will be automatically determined //based on neural preprocessor structure FeedingContinuousSettings feedingContinuousCfg = new FeedingContinuousSettings(FeedingContinuousSettings.AutoBootCyclesNum); //Create and return input configuration return(new InputEncoderSettings(feedingContinuousCfg, new VaryingFieldsSettings(externalFieldsCfg, null, null, RouteToReadout))); }