Eric,

I really appreciate you pointing this out, here and on youtube. I plan
on re-recording these videos this week. I'll post them when they are
complete.
---------
Matt Taylor
OS Community Flag-Bearer
Numenta


On Sun, Feb 14, 2016 at 6:21 PM, Eric Green <[email protected]> wrote:
> For El Capitan 10.11.3, the final step in the youtube
>
> https://www.youtube.com/watch?v=6OPTMDO17XI
>
> These instructions no longer work, specifically the last step no longer
> works in El Capitan ./scripts/run_nupic_tests
>
> -bash: ./scripts/run_nupic_tests: No such file or directory I went out of my
> way to do a clean install, word for word - Finally I settled for OpenHTM. I
> would really appreciate getting this going on any system, so any help would
> be greatly appreciated. I am applying to Singularity U's GSP, and I was
> hoping to experiment with the platform while I am there, along with Nengo
> and Tensorflow. Moreover, specifically I would prefer to get the openCL
> flavor working, but one step at a time ;) If I missed this, please point me
> to the corresponding info, thanks cheers and woot!
>
>
> Thank you and Happy Valentine's Day to everyone,
>
> On Sun, Feb 14, 2016 at 12:00 PM, <[email protected]> wrote:
>>
>> Send nupic mailing list submissions to
>>         [email protected]
>>
>> To subscribe or unsubscribe, visit
>>         http://lists.numenta.org/mailman/listinfo/nupic_lists.numenta.org
>> or, via email, send a message with subject or body 'help' to
>>         [email protected]
>>
>> You can reach the person managing the list at
>>         [email protected]
>>
>> When replying, please edit your Subject line so it is more specific
>> than "Re: Contents of nupic digest..."
>>
>>
>> Today's Topics:
>>
>>    1. Re: Training NuPIC using 1st dataset and detect anomalies in
>>       2nd       dataset (Wakan Tanka)
>>    2. Using anomalyProbability gives TypeError: cannot perform
>>       reduce with       flexible type (Wakan Tanka)
>>    3. Re: Using NuPIC to monitor Apache server Response Times
>>       (Wakan Tanka)
>>    4. Re: Using anomalyProbability gives TypeError: cannot perform
>>       reduce    with flexible type (Wakan Tanka)
>>
>>
>> ----------------------------------------------------------------------
>>
>> Message: 1
>> Date: Sun, 14 Feb 2016 03:59:06 +0100
>> From: Wakan Tanka <[email protected]>
>> To: "NuPIC general mailing list." <[email protected]>
>> Subject: Re: Training NuPIC using 1st dataset and detect anomalies in
>>         2nd     dataset
>> Message-ID: <[email protected]>
>> Content-Type: text/plain; charset=utf-8; format=flowed
>>
>> Thank you very much Matt, informative as always ;)
>>
>> One more questions:
>>
>>  > 2) Swarming is optimized only for prediction. It may not be the best
>>  > method to find model params for anomalies. We have identified a set of
>>  > model params that are decent for most one-dimensional scalar input
>>  > anomaly detection, and we generally reuse those in all our anomaly
>> models.
>>
>> 1. Isn't anomaly just prediction where NuPIC missed. Why is such
>> difference between anomaly and prediction during swarming?
>>
>> 2. Is it possible to somehow display and being able to read something
>> useful from the internal state of model object?
>>
>> 3. Regarding inferenceType: is there any type which is combination of
>> TemporalMultiStep and TemporalAnomaly or is there any reason why NuPIC
>> cannot output multiple steps and also anomalies at the same time?
>>
>> Thank you very much.
>>
>>
>> On 02/11/2016 05:22 PM, Matthew Taylor wrote:
>> > To answer your questions:
>> >
>> > 1a) Yes, you can disable learning on the model object by calling
>> > model.disableLearning() [1]. It will no longer update its internal state
>> > after you have called this function. So you could do this before the
>> > examples gets to the missing Tuesdays, and it will not learn the
>> > "missing Tuesdays" pattern. You can re-enable learning with the
>> > enableLearning() method [2].
>> >
>> > 1b) You can save the model to disk by calling the model.save(<path>)
>> > function [3] and resurrect a model you've already saved by calling
>> > ModelFactory.loadFromCheckpoint(<path>) [4].
>> >
>> > 2) Swarming is optimized only for prediction. It may not be the best
>> > method to find model params for anomalies. We have identified a set of
>> > model params that are decent for most one-dimensional scalar input
>> > anomaly detection, and we generally reuse those in all our anomaly
>> > models.
>> >
>> > 3) I don't quite understand the question, but I think when someone says
>> > "creating a model" they are generally referring to the process of
>> > identifying the best model params for a particular data stream. It
>> > probably does not refer to the model learning the patterns.
>> >
>> > 4) This search might help you find more info about "inferenceType" [5].
>> > There is a wiki page [6] but it needs to be filled in. Anyone want to
>> > help? As for your question about temporal data, you should read this
>> > thread on our mailing list from last month [7]. Cortical.io's core
>> > technology does not deal with temporal data, true. But they are dealing
>> > mostly in the interesting properties of SDRs, which are a part of HTM
>> > theory, but not the whole. We are working with CIO to identify ways to
>> > improve natural language processing by consuming the temporal element of
>> > language as well. For example, you could consider this entire email --
>> > indeed this entire mailing list -- a temporal data stream of text. This
>> > ability to process temporal language is not currently one of their
>> > capabilities, but it is a future goal of ours (not to speak for them,
>> > but we've talked openly about it).
>> >
>> > [1]
>> >
>> > http://numenta.org/docs/nupic/classnupic_1_1frameworks_1_1opf_1_1model_1_1_model.html#ae3efe32f87f56e9fd3edfb499b87263f
>> > [2]
>> >
>> > http://numenta.org/docs/nupic/classnupic_1_1frameworks_1_1opf_1_1model_1_1_model.html#af9756982485e3d520db6b1c99f4d1e39
>> > [3]
>> >
>> > http://numenta.org/docs/nupic/classnupic_1_1frameworks_1_1opf_1_1model_1_1_model.html#aba0970ece8740693d3b82e656500a9c0
>> > [4]
>> >
>> > http://numenta.org/docs/nupic/classnupic_1_1frameworks_1_1opf_1_1modelfactory_1_1_model_factory.html#a73b1a13824e1990bd42deb288a594583
>> > [5] http://numenta.org/search/?q=inferenceType
>> > [6] https://github.com/numenta/nupic/wiki/Inference-Types
>> > [7]
>> >
>> > http://lists.numenta.org/pipermail/nupic_lists.numenta.org/2016-January/012607.html
>> >
>> > Hope that helps,
>> >
>> >
>> > ---------
>> > Matt Taylor
>> > OS Community Flag-Bearer
>> > Numenta
>> >
>> > On Thu, Feb 11, 2016 at 7:12 AM, Wakan Tanka <[email protected]
>> > <mailto:[email protected]>> wrote:
>> >
>> >     One more question:
>> >     Is it possible to somehow save the model "trained" from 1st dataset
>> >     to use it later?
>> >
>> >     On Wed, Feb 10, 2016 at 11:52 PM, Wakan Tanka <[email protected]
>> >     <mailto:[email protected]>> wrote:
>> >
>> >         Hello NuPIC,
>> >
>> >         In hotgym anomaly tutorial Matt changed inferenceType from
>> >         TemporalMultiStep to TemporalAnomaly to being able detect
>> >         anomalies. When he then run script to removed all Tuesdays NuPIC
>> >         adapted to those changes, as it sees more and more of those
>> >         data, started to consider it as a normal and stop reporting it
>> >         as an anomaly.
>> >
>> >         1. I do not want NuPIC to adapt to those changes. Is possible to
>> >         disable learning in this phase? I want is to create model using
>> >         1st dataset, then pass 2nd dataset to this model but further
>> >         learning will be disabled. So far I know how to: create
>> >         model_params by running swarm over 1st dataset and pushing this
>> >         dataset into NuPIC to compute anomaly score. But what I do not
>> >         know is how to "save" those learned patterns from 1st dataset
>> >         and detect anomalies using this "trained" version in 2nd
>> >         dataset. Is this even possible for NuPIC?
>> >
>> >         2. The one difference between hot gym prediction and hot gym
>> >         anomaly was changing inferenceType from TemporalMultiStep to
>> >         TemporalAnomaly in existing model params. So I guess that
>> >         inferenceType does not affects swarm process because it can be
>> >         easily turned into something else in existing model if needed?
>> >         Are all available options under inferenceType using the same
>> >         algorithm principles under the hood?
>> >
>> >         3. Based on above: when somebody is talking about creating model
>> >         he is basically referring not just tuning (e.g. by hand or
>> >         swarm) parameters inside model_params.py but also in this
>> >         "training" phase?
>> >
>> >         4. Where can I find further info regarding inferenceType, the
>> >         only info that I?ve found is this list [1]? Matt in his hot gym
>> >         prediction tutorial said that the data are temporal so he has
>> >         chosen TemporalMultiStep. But how can I know if my data are
>> >         temporal and not e.g. nontemporal? As a nontemporal data can be
>> >         considered e.g. those that guys from cortical.io
>> >         <http://cortical.io> are dealing with? I mean SDRs for
>> >         particular words where time does not plays crucial role? Is the
>> >         role of time completely omitted in cortical.io
>> >         <http://cortical.io> examples?
>> >
>> >         [1] Inference Types -
>> >         https://github.com/numenta/nupic/wiki/Inference-Types
>> >
>> >         --
>> >         Thank you
>> >
>> >         Best Regards
>> >
>> >         Wakan
>> >
>> >
>> >
>> >
>> >     --
>> >     Best Regards
>> >
>> >     Name: Wakan Tanka a.k.a. Wakatana a.k.a. MackoP00h
>> >     Location: Europe
>> >     Note: I'm non native English speaker so please bare with me ;)
>> >     Contact:
>> >     [email protected] <mailto:[email protected]>
>> >     http://stackoverflow.com/users/1616488/wakan-tanka
>> >     https://github.com/wakatana
>> >     https://twitter.com/MackoP00h
>> >
>> >
>>
>>
>>
>>
>> ------------------------------
>>
>> Message: 2
>> Date: Sun, 14 Feb 2016 04:02:54 +0100
>> From: Wakan Tanka <[email protected]>
>> To: "NuPIC general mailing list." <[email protected]>
>> Subject: Using anomalyProbability gives TypeError: cannot perform
>>         reduce with     flexible type
>> Message-ID: <[email protected]>
>> Content-Type: text/plain; charset=utf-8; format=flowed
>>
>> Hello NuPIC,
>>
>> I'm trying to incorporate anomaly likelihood in hotgym anomaly tutorial
>> using modified Subutai example [1]. Here is my code snippet for running
>> model:
>>
>>
>>    for row in csvReader:
>>      # ipdb.set_trace()
>>      col1 = datetime.datetime.strptime(row[0], DATE_FORMAT)     #
>> timestamp
>>      col2 = row[1]                                              #
>> consumption
>>
>>      result = model.run({
>>        "timestamp":             col1,
>>        "kw_energy_consumption": float(col2)
>>      })
>>
>>      shifted_result = shifter.shift(result)
>>      col3 = result.inferences["multiStepBestPredictions"][predictionSteps]
>>      col4 =
>> shifted_result.inferences["multiStepBestPredictions"][predictionSteps]
>>      col5 = result.inferences['anomalyScore']
>>
>>      # Compute the Anomaly Likelihood
>>      likelihood    = anomalyLikelihood.anomalyProbability(col2, col5,
>> col1)
>>      logLikelihood = anomalyLikelihood.computeLogLikelihood(likelihood)
>>
>>
>>      # write to csv
>>      # datetime;consumption;prediction;shifted_prediction;anomaly_score;
>>      row = [col1, col2, col3, col4, col5, likelihood, logLikelihood]
>>      csvWriter.writerow(row)
>>
>>      if Verbose:
>>        if (counter % 100 == 0):
>>          print "Line %i has been written to %s" % (counter, outputFile)
>>          print ';'.join(str(v) for v in row)
>>          print
>> "################################################################"
>>
>>      if VeryVerbose:
>>        if (counter % 100 == 0):
>>          print "Line %i has been written to %s" % (counter, outputFile)
>>          print result
>>          print
>> "################################################################"
>>
>>      counter += 1
>>
>>    inputFH.close()
>>    outputFH.close()
>>
>>
>>
>>
>> Above codes ends up with "TypeError: cannot perform reduce with flexible
>> type"
>>
>>
>>
>> Last three rows that are writtent to output CSV are:
>>
>> 2010-07-26
>>
>> 21:00:00,35.8,4.887570520503047,44.76003339041138,0.025000000000000001,0.5,0.0301029996658834
>> 2010-07-26
>>
>> 22:00:00,5.1,15.743889021255345,4.887570520503047,0.050000000000000003,0.5,0.0301029996658834
>> 2010-07-26
>>
>> 23:00:00,4.9,15.743889021255345,15.743889021255345,0.050000000000000003,0.5,0.0301029996658834
>>
>>
>> Input csv is same as in hotgym anomaly tuorial. Here is snipet around
>> the location where error occurres
>>
>> 7/26/10 21:00,35.8
>> 7/26/10 22:00,5.1
>> 7/26/10 23:00,4.9
>> 7/27/10 0:00,21.6
>> 7/27/10 1:00,15.6
>> 7/27/10 2:00,4.8
>>
>> Values causing error passed to anomalyLikelihood.anomalyProbability
>> (founded via debugger):
>>
>> ipdb> col2
>> '21.6'
>> ipdb> col5
>> 0.0
>> ipdb> col1
>> datetime.datetime(2010, 7, 27, 0, 0)
>>
>>
>>
>> PS: As you can see I am using both shifted and unshifted inferences
>> (col3 and col4). Should I pass anomalyScore from (un)shifted to
>> anomalyProbability?
>>
>> PPS: I've not found any anomalyProbability() specification so I'm
>> passing arguments as I've seen in Matt or Subutai codes, is this OK?
>>
>> Thank you
>>
>> [1]
>>
>> https://github.com/subutai/nupic.subutai/blob/master/run_anomaly/run_anomaly.py
>>
>>
>>
>> ------------------------------
>>
>> Message: 3
>> Date: Sun, 14 Feb 2016 13:54:18 +0100
>> From: Wakan Tanka <[email protected]>
>> To: "NuPIC general mailing list." <[email protected]>
>> Subject: Re: Using NuPIC to monitor Apache server Response Times
>> Message-ID: <[email protected]>
>> Content-Type: text/plain; charset=utf-8; format=flowed
>>
>> Hello Matt,
>>
>> if there are there some limits for model, how can I know if I'm pushing
>> too much into model, is there some further materials about this topic?
>> Also when you have multiple models then how you can combine them to
>> something useful? Correct me if I'm wrong but I guess that this was
>> discussed by Scott Purdy in Science of anomaly detection video. He've
>> explained that grok uses multiple models for memory, cpu, io etc. which
>> are separated (model for io does not sees cpu data and vice versa).
>> Basically when you want detect something unusual then you're searching
>> for anomalies from those separated models and check if they are
>> reporting anomaly at the same time. Am I wrong?
>>
>> Thank you very much
>>
>>
>> On 02/12/2016 05:53 PM, Matthew Taylor wrote:
>> > Daniel,
>> >
>> > The first thing that strikes me about your description is that you're
>> > only creating one model for all the data. Is there a way to split the
>> > data up, perhaps by URL? If there are too many URLs to create models for
>> > each one, try to identify another way to logically sort this input data
>> > into categories with patterns that a human could understand and analyze.
>> > I think the main problem is that you're pushing too much data into one
>> > model. If you can figure out a way to split it into multiple models
>> > you'll probably be more successful.
>> >
>> > Let me know what you think.
>> >
>> > Regards,
>> >
>> > ---------
>> > Matt Taylor
>> > OS Community Flag-Bearer
>> > Numenta
>>
>>
>>
>>
>> ------------------------------
>>
>> Message: 4
>> Date: Sun, 14 Feb 2016 14:36:39 +0100
>> From: Wakan Tanka <[email protected]>
>> To: "NuPIC general mailing list." <[email protected]>
>> Subject: Re: Using anomalyProbability gives TypeError: cannot perform
>>         reduce  with flexible type
>> Message-ID: <[email protected]>
>> Content-Type: text/plain; charset=utf-8; format=flowed
>>
>> Here is full trace:
>>
>>
>> ---------------------------------------------------------------------------
>> TypeError                                 Traceback (most recent call
>> last)
>> /home/wakatana/experiments_today/v3/run_nupic.py in <module>()
>>      239     SWARM_CFG["PREDICTION_STEP"],
>>                       # PREDICTION STEP
>>      240     Verbose=True,
>>                       # VERBOSE
>> --> 241     VeryVerbose=False
>>                      # VERY VERBOSE
>>      242   )
>>      243   RUNMODEL_STOP_TIME = SCRIPT_STOP_TIME =
>> calendar.timegm(time.gmtime())
>>
>>
>> /home/wakatana/experiments_today/v3/experiments/hot_gym_anomaly/run_model/run_model.py
>> in runModel(model, inputFile, outputFile, predictionSteps, Verbose,
>> VeryVerbose)
>>       67
>>       68     # Compute the Anomaly Likelihood
>> ---> 69     likelihood    = anomalyLikelihood.anomalyProbability(col2,
>> tmp, col1)
>>       70     logLikelihood =
>> anomalyLikelihood.computeLogLikelihood(likelihood)
>>       71
>>
>>
>> /home/wakatana/.local/lib/python2.7/site-packages/nupic-0.3.0.dev0-py2.7-linux-x86_64.egg/nupic/algorithms/anomaly_likelihood.pyc
>> in anomalyProbability(self, value, anomalyScore, timestamp)
>>      140           estimateAnomalyLikelihoods(
>>      141             self._historicalScores,
>> --> 142             skipRecords = self._claLearningPeriod)
>>      143           )
>>      144
>>
>>
>> /home/wakatana/.local/lib/python2.7/site-packages/nupic-0.3.0.dev0-py2.7-linux-x86_64.egg/nupic/algorithms/anomaly_likelihood.pyc
>> in estimateAnomalyLikelihoods(anomalyScores, averagingWindow,
>> skipRecords, verbosity)
>>      297     metricValues = numpy.array(s)
>>      298     metricDistribution =
>> estimateNormal(metricValues[skipRecords:],
>> --> 299
>> performLowerBoundCheck=False)
>>      300
>>      301     if metricDistribution["variance"] < 1.5e-5:
>>
>>
>> /home/wakatana/.local/lib/python2.7/site-packages/nupic-0.3.0.dev0-py2.7-linux-x86_64.egg/nupic/algorithms/anomaly_likelihood.pyc
>> in estimateNormal(sampleData, performLowerBoundCheck)
>>      511   params = {
>>      512       "name": "normal",
>> --> 513       "mean": numpy.mean(sampleData),
>>      514       "variance": numpy.var(sampleData),
>>      515   }
>>
>> /usr/lib/python2.7/dist-packages/numpy/core/fromnumeric.pyc in mean(a,
>> axis, dtype, out, keepdims)
>>     2714
>>     2715     return _methods._mean(a, axis=axis, dtype=dtype,
>> -> 2716                             out=out, keepdims=keepdims)
>>     2717
>>     2718 def std(a, axis=None, dtype=None, out=None, ddof=0,
>> keepdims=False):
>>
>> /usr/lib/python2.7/dist-packages/numpy/core/_methods.pyc in _mean(a,
>> axis, dtype, out, keepdims)
>>       60         dtype = mu.dtype('f8')
>>       61
>> ---> 62     ret = um.add.reduce(arr, axis=axis, dtype=dtype, out=out,
>> keepdims=keepdims)
>>       63     if isinstance(ret, mu.ndarray):
>>       64         ret = um.true_divide(
>>
>> TypeError: cannot perform reduce with flexible type
>>
>>
>>
>>
>> ------------------------------
>>
>> Subject: Digest Footer
>>
>> _______________________________________________
>> nupic mailing list
>> [email protected]
>> http://lists.numenta.org/mailman/listinfo/nupic_lists.numenta.org
>>
>>
>> ------------------------------
>>
>> End of nupic Digest, Vol 34, Issue 13
>> *************************************
>
>
>
>
> --
> eric green
> CTO
> Π ∩ ϟ
> piandpower.com

Reply via email to