コード例 #1
0
  /**
   * Creates and returns a {@link Parameters} object configured for this demo.
   *
   * @return
   */
  org.numenta.nupic.Parameters createParameters() {
    org.numenta.nupic.Parameters tmParams =
        org.numenta.nupic.Parameters.getTemporalDefaultParameters();
    tmParams.setParameterByKey(KEY.COLUMN_DIMENSIONS, new int[] {16384});
    tmParams.setParameterByKey(KEY.INPUT_DIMENSIONS, new int[] {16384});
    tmParams.setParameterByKey(KEY.CELLS_PER_COLUMN, 8);
    tmParams.setParameterByKey(KEY.CONNECTED_PERMANENCE, 0.5);
    tmParams.setParameterByKey(KEY.INITIAL_PERMANENCE, 0.4);
    // tmParams.setParameterByKey(KEY.MIN_THRESHOLD, 164);
    // tmParams.setParameterByKey(KEY.MAX_NEW_SYNAPSE_COUNT, 164);
    // tmParams.setParameterByKey(KEY.ACTIVATION_THRESHOLD, 164);

    tmParams.setParameterByKey(KEY.MIN_THRESHOLD, 82);
    tmParams.setParameterByKey(KEY.MAX_NEW_SYNAPSE_COUNT, 82);
    tmParams.setParameterByKey(KEY.ACTIVATION_THRESHOLD, 82);

    tmParams.setParameterByKey(KEY.PERMANENCE_INCREMENT, 0.1);
    tmParams.setParameterByKey(KEY.PERMANENCE_DECREMENT, 0.01);

    tmParams.setParameterByKey(KEY.GLOBAL_INHIBITION, false);
    // tmParams.setParameterByKey(KEY.RADIUS, 4.0);
    tmParams.setParameterByKey(KEY.INHIBITION_RADIUS, 10);
    tmParams.setParameterByKey(KEY.POTENTIAL_RADIUS, 10);

    tmParams.setParameterByKey(KEY.SYN_PERM_CONNECTED, 0.1);
    tmParams.setParameterByKey(KEY.SYN_PERM_ACTIVE_INC, 0.9);
    tmParams.setParameterByKey(KEY.SYN_PERM_INACTIVE_DEC, 0.01);
    // tmParams.setParameterByKey(KEY., 1.0);
    tmParams.setParameterByKey(KEY.POTENTIAL_PCT, 1.0);
    tmParams.setParameterByKey(KEY.STIMULUS_THRESHOLD, 0.0);
    // tmParams.setParameterByKey(KEY.SP_ONE_TO_ONE, true);

    return tmParams;
  }
コード例 #2
0
  /**
   * Creates and returns a {@link Parameters} object configured for this demo.
   *
   * @return
   */
  org.numenta.nupic.Parameters createParameters() {
    org.numenta.nupic.Parameters tmParams =
        org.numenta.nupic.Parameters.getTemporalDefaultParameters();
    tmParams.setParameterByKey(KEY.COLUMN_DIMENSIONS, new int[] {16384});
    tmParams.setParameterByKey(KEY.INPUT_DIMENSIONS, new int[] {16384});
    tmParams.setParameterByKey(KEY.CELLS_PER_COLUMN, 8);
    tmParams.setParameterByKey(KEY.CONNECTED_PERMANENCE, 0.5);
    tmParams.setParameterByKey(KEY.INITIAL_PERMANENCE, 0.4);
    tmParams.setParameterByKey(KEY.MIN_THRESHOLD, 164);
    tmParams.setParameterByKey(KEY.MAX_NEW_SYNAPSE_COUNT, 164);
    tmParams.setParameterByKey(KEY.PERMANENCE_INCREMENT, 0.1);
    tmParams.setParameterByKey(KEY.PERMANENCE_DECREMENT, 0.0);
    tmParams.setParameterByKey(KEY.ACTIVATION_THRESHOLD, 164);

    return tmParams;
  }
コード例 #3
0
 @Test
 public void testDefaultsAndUpdates() {
   Parameters params = Parameters.getAllDefaultParameters();
   assertEquals(params.getParameterByKey(Parameters.KEY.CELLS_PER_COLUMN), 32);
   assertEquals(params.getParameterByKey(Parameters.KEY.SEED), 42);
   assertEquals(
       true,
       ((Random) params.getParameterByKey(Parameters.KEY.RANDOM))
           .getClass()
           .equals(MersenneTwister.class));
   System.out.println("All Defaults:\n" + Parameters.getAllDefaultParameters());
   System.out.println("Spatial Defaults:\n" + Parameters.getSpatialDefaultParameters());
   System.out.println("Temporal Defaults:\n" + Parameters.getTemporalDefaultParameters());
   parameters = Parameters.getSpatialDefaultParameters();
   parameters.setParameterByKey(Parameters.KEY.INPUT_DIMENSIONS, new int[] {64, 64});
   parameters.setParameterByKey(Parameters.KEY.COLUMN_DIMENSIONS, new int[] {32, 32});
   parameters.setParameterByKey(Parameters.KEY.NUM_ACTIVE_COLUMNS_PER_INH_AREA, 0.02 * 64 * 64);
   System.out.println("Updated/Combined:\n" + parameters);
 }