Exemplo n.º 1
0
        /**
         * Creates a {@link Network} containing one {@link Region} with multiple
         * {@link PALayer}s. This demonstrates the method by which multiple layers
         * are added and connected; and the flexibility of the fluent style api.
         *
         * @return  a multi-layer Network
         */
        internal Network.Network CreateMultiLayerNetwork()
        {
            Parameters p = NetworkDemoHarness.GetParameters();

            p = p.Union(NetworkDemoHarness.GetNetworkDemoTestEncoderParams());

            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(Network.Network.CreateLayer("Layer 4", p)
                             .Add(new PASpatialPooler()))
                        .Add(Network.Network.CreateLayer("Layer 5", p)
                             .Add(Sensor <FileInfo> .Create(FileSensor.Create, SensorParams.Create(
                                                                SensorParams.Keys.Path, "", ResourceLocator.Path(typeof(Resources), "rec-center-15m.csv")))))
                        .Connect("Layer 2/3", "Layer 4")
                        .Connect("Layer 4", "Layer 5")));
        }
Exemplo n.º 2
0
        public void TestGetParameters()
        {
            Parameters p = NetworkDemoHarness.GetParameters();

            Assert.AreEqual(66, p.Size());
        }