Adding GeospatialCoordinateEncoder Builder configuration#324
Merged
cogmission merged 4 commits intonumenta:masterfrom Oct 14, 2015
Merged
Adding GeospatialCoordinateEncoder Builder configuration#324cogmission merged 4 commits intonumenta:masterfrom
cogmission merged 4 commits intonumenta:masterfrom
Conversation
Collaborator
|
@antidata Nice job. Thank you for your hard work! Can you write a test in HTMSensorTest to show that this works? |
Contributor
Author
|
@cogmission There is another issue (not sure if related to this, but we need to fix it), see exception: |
Collaborator
|
Ok I'll take a look tomorrow. |
Contributor
Author
|
Ok, some more code for you if you wanna reproduce (I'm using the scala console) public static Map<String, Map<String, Object>> getNetworkDemoFieldEncodingMap() {
Map fieldEncodings = setupMap((Map)null, 0, 0, 0.0D, 0.0D, 0.0D, 0.0D, (Boolean)null, (Boolean)null, (Boolean)null, "timestamp", "datetime", "DateEncoder");
fieldEncodings = setupMap(fieldEncodings, 50, 21, 0.0D, 100.0D, 0.0D, 0.1D, (Boolean)null, Boolean.TRUE, (Boolean)null, "consumption", "float", "ScalarEncoder");
fieldEncodings = setupMap(fieldEncodings, 999, 25, 0.0D, 100.0D, 0.0D, 0.1D, (Boolean)null, Boolean.TRUE, (Boolean)null, "location", "geo", "GeospatialCoordinateEncoder");
((Map)fieldEncodings.get("timestamp")).put(Parameters.KEY.DATEFIELD_TOFD.getFieldName(), new Tuple(new Object[]{Integer.valueOf(21), Double.valueOf(9.5D)}));
((Map)fieldEncodings.get("timestamp")).put(Parameters.KEY.DATEFIELD_PATTERN.getFieldName(), "MM/dd/YY HH:mm");
((Map)fieldEncodings.get("location")).put("timestep", "60");
((Map)fieldEncodings.get("location")).put("scale", "30");
return fieldEncodings;
}val modelParameters = NetworkParameters.getModelParameters
val publisher = Publisher.builder
.addHeader("timestamp,consumption,location")
.addHeader("datetime,float,geo")
.addHeader("T,,").build
val parms: SensorParams = SensorParams.create(Keys.obs.get(), "", publisher)
val sensor: Sensor[ObservableSensor[String]] = Sensor.create(HtmModelFactory.sensorFactory, parms)
val net = Network.create("Network API Demo", modelParameters)
.add(Network.createRegion("Region 1")
.add(Network.createLayer("Layer 2/3", modelParameters)
.alterParameter(KEY.AUTO_CLASSIFY, true)
.add(Anomaly.create)
.add(new TemporalMemory)
.add(new SpatialPooler)
.add(sensor)))
net.observe().subscribe(new Subscriber[Inference]() {
def onNext(i: Inference) {
println(s"{i}")
}
override def onError(throwable: Throwable): Unit = {
println(throwable.getMessage)
}
override def onCompleted(): Unit = {}
})
|
Collaborator
|
@antidata I need to push my changes to your repo - can you give me temporary permissions? |
Contributor
Author
|
@cogmission Added |
Geoinputfix
Collaborator
|
👍 Thank you @antidata |
cogmission
added a commit
that referenced
this pull request
Oct 14, 2015
Adding GeospatialCoordinateEncoder Builder configuration
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #323