/** * Creates a basic {@link Network} with 1 {@link Region} and 1 {@link PALayer}. However * this basic network contains all algorithmic components. * * @return a basic Network */ internal Network.Network CreateBasicNetwork() { Parameters p = NetworkDemoHarness.GetParameters(); p = p.Union(NetworkDemoHarness.GetNetworkDemoTestEncoderParams()); // This is how easy it is to create a full running Network! var sineData = SineGenerator.GenerateSineWave(100, 100 * 20, 10, 1) .Select(s => s.ToString(NumberFormatInfo.InvariantInfo)); string[] header = new[] { "sinedata", "float", "" }; object[] n = { "sine", header.Union(sineData).ToObservable() }; SensorParams parms = SensorParams.Create(SensorParams.Keys.Obs, n); Sensor <ObservableSensor <string[]> > sensor = Sensor <ObservableSensor <string[]> > .Create(ObservableSensor <string[]> .Create, parms); return(Network.Network.Create("Network API Demo", p) .Add(Network.Network.CreateRegion("Region 1") .Add(Network.Network.CreateLayer("Layer 2/3", p) .AlterParameter(Parameters.KEY.AUTO_CLASSIFY, true) .Add(Anomaly.Create()) .Add(new TemporalMemory()) .Add(new Algorithms.SpatialPooler()) .Add(sensor)))); }
public void TestSetupMap() { Map <String, Map <String, Object> > m = NetworkDemoHarness.SetupMap(null, 23, 2, 0.0, 0.9, 22.0, 3.0, false, false, null, "cogmission", "ai", "works"); Assert.IsNotNull(m); // Make sure omission of key doesn't insert null or a default value Assert.IsTrue(!m.ContainsKey("forced")); Assert.AreEqual(1, m.Count); Assert.AreEqual(12, m.Get("cogmission").Count); }
public void TestGetNetworkDemoTestEncoderParams() { Parameters p = NetworkDemoHarness.GetNetworkDemoTestEncoderParams(); Assert.AreEqual(28, p.Size()); }
public void TestGetDayDemoFieldEncodingMap() { Map <String, Map <string, object> > fieldEncodings = NetworkDemoHarness.GetDayDemoFieldEncodingMap(); Assert.AreEqual(1, fieldEncodings.Count); }
public void TestGetParameters() { Parameters p = NetworkDemoHarness.GetParameters(); Assert.AreEqual(71, p.Size()); }