# Converting NuPIC params to HTM.Java params

**URL:** <https://discourse.numenta.org/t/converting-nupic-params-to-htm-java-params/4588>\
**Category:** HTM.Java\
**Created:** [September 19, 2018, 6:13pm UTC](https://discourse.numenta.org/t/converting-nupic-params-to-htm-java-params/4588 "2018-09-19T18:13:45Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Matheus\_Araujo](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.numenta.org/matheus_araujo/32/3137_2.png) [@Matheus\_Araujo](https://discourse.numenta.org/u/Matheus_Araujo)\
**Post date:** [September 19, 2018, 6:13pm UTC](https://discourse.numenta.org/t/converting-nupic-params-to-htm-java-params/4588/1 "2018-09-19T18:13:45Z")

</div>

Dear all,

I’m trying to implement an anomaly detection that takes a timed series file as input as in HotGym project but its values are coordinates[latitude, longitude, radius] just like the mine-hack project. For the time series I’m using a sine function to generate coordinates. The radius is the distance between current and previous coordinates. I used the GeospatialCoordinateEncoder and now it’s kind of detecting anomalies.

My problem is that the network is detecting anomalies where it shouldn’t. I think that’s because the hotgym model doesn’t fit this problem requirements.

I’m running htm.java on a windows machine under a corporate proxy that doesn’t allow me to build the htm.java DockerFile as I should in order to run a swarming on my series. So I googled around and found the python mine-hack project that I am now trying to mimetyze in htm.java but I can’t find some of the python parameters in the KEY enum.

Could you please give me some advice on accomplishing that task?

this the model I want to port to java: [https://github.com/htm-community/mine-hack/blob/master/python/model\_params/model\_params.py#L142](https://github.com/htm-community/mine-hack/blob/master/python/model_params/model_params.py#L142)

---

<div class="post-metadata">

**Author:** ![rhyolight](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.numenta.org/rhyolight/32/3922_2.png) [@rhyolight](https://discourse.numenta.org/u/rhyolight)\
**Post date:** [September 19, 2018, 6:23pm UTC](https://discourse.numenta.org/t/converting-nupic-params-to-htm-java-params/4588/2 "2018-09-19T18:23:50Z")

</div>

You can ignore `temporalImp`.

---

<div class="post-metadata">

**Author:** ![Matheus\_Araujo](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.numenta.org/matheus_araujo/32/3137_2.png) [@Matheus\_Araujo](https://discourse.numenta.org/u/Matheus_Araujo)\
**Post date:** [September 19, 2018, 8:48pm UTC](https://discourse.numenta.org/t/converting-nupic-params-to-htm-java-params/4588/3 "2018-09-19T20:48:52Z")

</div>

Problem is that’s not the only parameter I couldn’t find.

I couldn’t find the following ones:

> ```
> 'predictAheadTime': None,
> 'inferenceType': 'TemporalAnomaly',
> 'sensorAutoReset' : None,
> 'boostStrength': 1.0,
> 'globalDecay': 0.0,
> 'pamLength': 3,
> 'anomalyCacheRecords': None,
> 'autoDetectThreshold': None,
> 'autoDetectWaitRecords': 2184},
> 'trainSPNetOnlyIfRequested': False,
> 
> ```

That’s how I have my python to java API mapping now:

> ‘predictAheadTime’: None, → NOT FOUND EXCEPTION 😛
> 
> ‘spParams’: {
> 
> ```
> 'globalInhibition': 1, -> parameters.set(KEY.GLOBAL_INHIBITION, true);
> 
> 'columnCount': 2048, -> parameters.set(KEY.COLUMN_DIMENSIONS, new int[] { 2048 });
> 
> 'inputWidth': 0, -> parameters.set(KEY.INPUT_DIMENSIONS, new int[] { 0 });
> 
> 'numActiveColumnsPerInhArea': 40, -> parameters.set(KEY.NUM_ACTIVE_COLUMNS_PER_INH_AREA, 40.0);
> 
> 'seed': 1956, -> parameters.set(KEY.SEED, 1956);
> 
> 'potentialPct': 0.8, -> parameters.set(KEY.POTENTIAL_PCT, 0.8);
> 
> 'synPermConnected': 0.1, -> parameters.set(KEY.SYN_PERM_CONNECTED, 0.1);
> 
> 'synPermActiveInc': 0.0001, -> parameters.set(KEY.SYN_PERM_ACTIVE_INC, 0.0001);
> 
> 'synPermInactiveDec': 0.0005, -> parameters.set(KEY.SYN_PERM_INACTIVE_DEC, 0.0005);
> 
> 'boostStrength': 1.0, -> NOT FOUND EXCEPTION :p
> },
>   
> 'tmEnable' : True, -> NOT FOUND EXCEPTION :p
>   
>   
> 'tmParams': {
> 'columnCount': 2048, -> couldn't find this setting to temporal memory only
> 'cellsPerColumn': 32, -> couldn't find this setting to temporal memory only
> 'inputWidth': 2048, -> couldn't find this setting to temporal memory only
> 
> 'seed': 1960,	-> couldn't find this setting to temporal memory only
> 
> 'newSynapseCount': 20, -> couldn't find this setting to temporal memory only
> 
> 'maxSynapsesPerSegment': 32, -> parameters.set(KEY.MAX_SYNAPSES_PER_SEGMENT, 32);
> 
> 'maxSegmentsPerCell': 128, -> parameters.set(KEY.MAX_SEGMENTS_PER_CELL, 128);
> 
> 'initialPerm': 0.21, -> parameters.set(KEY.INITIAL_PERMANENCE, 0.21);
> 
> 'connectedPerm': 0.5, -> parameters.set(KEY.CONNECTED_PERMANENCE, 0.5);
> 
> 'permanenceInc': 0.1, -> parameters.set(KEY.PERMANENCE_INCREMENT, 0.1);
> 
> 'permanenceDec' : 0.1, -> parameters.set(KEY.PERMANENCE_DECREMENT, 0.1);
> 
> 'globalDecay': 0.0, -> NOT FOUND EXCEPTION :p
> 
> 'maxAge': 0, -> NOT FOUND EXCEPTION :p
> 
> 'minThreshold': 3, -> parameters.set(KEY.MIN_THRESHOLD, 3);
> 
> 'activationThreshold': 6, -> parameters.set(KEY.ACTIVATION_THRESHOLD, 6);
> 
> 'outputType': 'normal',
> 
>         
> },
> 
>   
> 'clEnable': False, -> NOT FOUND EXCEPTION :p
> 'clParams': None, -> NOT FOUND EXCEPTION :p
> 
> 'anomalyParams': {  
> u'anomalyCacheRecords': None, -> NOT FOUND EXCEPTION :p
> u'autoDetectThreshold': None, -> NOT FOUND EXCEPTION :p
> u'autoDetectWaitRecords': 2184}, -> NOT FOUND EXCEPTION :p
> 
> 'trainSPNetOnlyIfRequested': False, -> NOT FOUND EXCEPTION :p
> },
> 
> ```

---

<div class="post-metadata">

**Author:** ![cogmission](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.numenta.org/cogmission/32/11_2.png) [@cogmission](https://discourse.numenta.org/u/cogmission)\
**Post date:** [September 20, 2018, 11:02am UTC](https://discourse.numenta.org/t/converting-nupic-params-to-htm-java-params/4588/4 "2018-09-20T11:02:29Z")

</div>

Hi @Matheus_Araujo,

I wish I could promote this answer in such a way as to have it globally accessible because a lot of people have asked this question (or ones like it), with regard to HTM.Java and anomaly detection.

**These fields:**

```auto
'predictAheadTime': None,
 'inferenceType': 'TemporalAnomaly',
'sensorAutoReset' : None,
'boostStrength': 1.0,
'globalDecay': 0.0,
'pamLength': 3,
'anomalyCacheRecords': None,
'autoDetectThreshold': None,
'autoDetectWaitRecords': 2184},
'trainSPNetOnlyIfRequested': False,

```

…are not parameters that control the performance of the underlying algorithms (SpatialPooler, TemporalMemory, AnomalyDetection etc.), rather these are parameters that control the Infrastructure _ **containing** _ those algorithms.

These parameters refer to the Python/C++ wrapper around the core algorithms and therefore are not available (nor are appropriate), for HTM.Java or it’s (Java Specific) wrapper, the NetworkAPI.

Hope that clears a few things up?

P.S. You guys are like monsters with this AI stuff! You must really be trying to create this thing or something, huh? 😛

---

<div class="post-metadata">

**Author:** ![rhyolight](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.numenta.org/rhyolight/32/3922_2.png) [@rhyolight](https://discourse.numenta.org/u/rhyolight)\
**Post date:** [September 20, 2018, 4:50pm UTC](https://discourse.numenta.org/t/converting-nupic-params-to-htm-java-params/4588/5 "2018-09-20T16:50:33Z")

</div>


