-
Notifications
You must be signed in to change notification settings - Fork 159
Parameters
David Ray edited this page Jun 6, 2015
·
10 revisions
This page contains an in-depth discussion of Parameters.
Example of general usage:
Parameters p = Parameters.getAllDefaultParameters();
// Set a few of your desired parameters...
p.setParameterByKey(KEY.INPUT_DIMENSIONS, new int[] { 128, 128 });
p.setParameterByKey(KEY.COLUMN_DIMENSIONS, new int[] { 200 });
p.setParameterByKey(KEY.POTENTIAL_RADIUS, 3);
p.setParameterByKey(KEY.POTENTIAL_PCT, 0.5);
// To clear a parameter
p.clearParameter(KEY.POTENTIAL_PCT);
// To get an empty Parameters object
Parameters newCopy = Parameters.empty();
// To get a copy
Parameters copy = p.copy();
// To retrieve algorithm only parameters
Parameters spatial = Parameters.getSpatialDefaultParameters();
Parameters temporal = Parameters.getTemporalDefaultParameters();
Parameters encoder = Parameters.getEncoderDefaultParameters();
// To merge (union) one Parameters object into another
Parameters spatial = Parameters.getSpatialDefaultParameters();
Parameters temporal = Parameters.getTemporalDefaultParameters();
spatial.union(temporal); // Now contains only those params specific to the SP and TM
Let's use the HotGym fields, "consumption" and "timestamp" as an example:
// This map contains keys which are field names or column names from csv files.
Map<String, Map<String, Object>> encoderMap = new HashMap<>();
Map<String, Object> inner = new HashMap<>();
inner.put("n", 500);
inner.put("w", 21);
inner.put("minVal", 0.0); // Only needed for ScalarEncoder - otherwise can be left empty
inner.put("maxVal", 0.0); // S.A.A for ScalarEncoder
inner.put("radius", 0.0);
inner.put("resolution", 0.0);
inner.put("periodic", false);
inner.put("clipInput", false);
inner.put("forced", false); // Used to force a non-standard ratio of "n" and "w" values.
inner.put("fieldName", "consumption"); // We'll use "consumption" here
inner.put("fieldType", "float"); // See [FieldMetaTypes](
inner.put("encoderType", "RandomDistributedScalarEncoder"); // Use the class name of the encoder.
- Introduction (Home)
- History & News Archives...
- Usability
- Architecture
- NAPI Quick Start Guide
- NAPI In Depth
- Saving Your Network: PersistenceAPI Serialization
- Roadmap
- Browse Java Docs
- Build Instructions
- Eclipse (Dev Setup)
- Anomaly Prediction
- Test Coverage Reports
- [Cortical.io Demos] (https://github.com/numenta/htm.java-examples/tree/master/src/main/java/org/numenta/nupic/examples/cortical_io)
- Hot Gym Demo
- Performance Benchmarks with jmh - blog
- BLOG: Join the "cogmission"