Skip to content
David Ray edited this page Jun 9, 2015 · 9 revisions

MultiEncoders are "compound" encoders (containers for sub-encoders or child encoders).

MultiEncoders can be added to a Network in two ways:

  • The most common is to let it be created by adding a Sensor to a network (which automatically adds a MultiEncoder as a byproduct). The Parameters configuration is described in detail on the Parameters wiki page. Sensor configuration is described separately on its own page

  • The second way is to simply add a MultiEncoder to a Layer. This method is used when you want to automatically configure a MultiEncoder without creating a Sensor.

Here is an example:

Parameters p = NetworkTestHarness.getParameters();
p = p.union(NetworkTestHarness.getDayDemoTestEncoderParams());
p.setParameterByKey(KEY.RANDOM, new MersenneTwister(42));
        
Network n = Network.create("test network", p)
    .add(Network.createRegion("r1")
        .add(Network.createLayer("4", p)
            .add(MultiEncoder.builder().name("").build())));

In the example above, the specified MultiEncoder will be automatically configured (have the appropriate child encoders [inferred by the Parameters] inserted and configured) such that subsequent input into the network will be appropriately encoded!