Hi David, Thanks for looking into this! I chose the existing example from the Python implementation as an introductory exercise for myself, so I could try and implement the same functionality and validate the results. Data parsing etc. seem to work a bit differently in HTM.java (they probably have to), but as a new user, I sense that having an equivalent interface here would be quite valuable. I am also willing to contribute that example once it's running; I think it would provide a valuable starting point for other new users. Carsten
Am 19.10.2015 um 16:38 schrieb cogmission (David Ray): > Hi Carsten, > > I need to have a powow with the Numenta engineers, if that tokens.txt > represents actual input... If it does, then I need to discuss with them > the implementation and purpose because that is not how the code looks in > the CategoryEncoderTest that I ported. > > Please have patience and I will resolve this and possibly correct the > implementation of the code... > > Thanks for bringing this to my attention! :-) > > @rhyolight @subutai I need to discuss this with you offline? > > Cheers, > David > > On Mon, Oct 19, 2015 at 9:11 AM, cogmission (David Ray) > <[email protected] <mailto:[email protected]>> wrote: > > Hi Carsten, > > This is a two-parter... > > I can help with the first, and maybe @rhyolight can help with the > second. > > RE: The first problem (IllegalArgumentException) can you write back > with your whole stack trace? > > We'll take it from there... > > Cheers, > David > > On Mon, Oct 19, 2015 at 8:15 AM, Carsten Schnober > <[email protected] > <mailto:[email protected]>> wrote: > > Hi, > To get started with HTM(.java), I am trying to re-implement the > category > prediction example from the Python version in Java. > However, I am trying to figure out the exact model parameters as > specified here: > > https://github.com/numenta/nupic/blob/master/examples/prediction/category_prediction/run.py > > At first, I am trying to decode the Python example in as much > detail as > I am able to. Please correct me where I am wrong: > > The model: > - CLA > - One region, one layer with a spatial pooler and a temporal memory. > > Sensor: > - read the token list (produced beforehand, one token per line, no > stopwords, sequential order). > > Hence, what I am aiming for in the Java implementation > (pseudo-code): > - Create a CLA model: `Network.create("CLA", parameters)` > - Create a region: > `model.add(Network.createRegion("CLAClassifierRegion"))` > - Create a layer: `region.add(Network.createLayer("Layer 2/3", > parameters) > .add(new SpatialPooler()) > .add(new TemporalMemory())` > - Add a sensor to the layer: > `layer.add(Sensor.create(FileSensor::create, > SensorParams.create(Keys::path, "", > tokensFile.getAbsolutePath())))));` > > > The first issue I run into is the sensor which causes a > IllegalArgumentException: > Exception in thread "main" java.lang.IllegalArgumentException: > Cannot > initialize this Sensor's MultiEncoder with a null settings > > I suspect this might have to do with the FileSensor requiring a CSV > file, doesn't it? The tokens with, however, is one token per > line. I was > hoping that this somehow corresponds to a CSV with a single > column though. > > Furthermore, I am not sure how to train and run the network in the > following. I've created a gist with my initial start, perhaps > you could > comment on that: > https://gist.github.com/carschno/7f3828c2ea0c1a2b3be9 > > Thanks! > Carsten > > > > -- > Carsten Schnober > Doctoral Researcher > Ubiquitous Knowledge Processing (UKP) Lab > FB 20 / Computer Science Department > Technische Universität Darmstadt > Hochschulstr. 10, D-64289 Darmstadt, Germany > phone [+49] (0)6151 16-6227 > <tel:%5B%2B49%5D%20%280%296151%2016-6227>, fax -5455, room > S2/02/B111 > [email protected] > <mailto:[email protected]> > www.ukp.tu-darmstadt.de <http://www.ukp.tu-darmstadt.de> > > Web Research at TU Darmstadt (WeRC): www.werc.tu-darmstadt.de > <http://www.werc.tu-darmstadt.de> > GRK 1994: Adaptive Preparation of Information from Heterogeneous > Sources > (AIPHES): www.aiphes.tu-darmstadt.de > <http://www.aiphes.tu-darmstadt.de> > PhD program: Knowledge Discovery in Scientific Literature (KDSL) > www.kdsl.tu-darmstadt.de <http://www.kdsl.tu-darmstadt.de> > > > > > -- > /With kind regards,/ > > David Ray > Java Solutions Architect > > *Cortical.io <http://cortical.io/>* > Sponsor of: HTM.java <https://github.com/numenta/htm.java> > > [email protected] <mailto:[email protected]> > http://cortical.io <http://cortical.io/> > > > > > -- > /With kind regards,/ > > David Ray > Java Solutions Architect > > *Cortical.io <http://cortical.io/>* > Sponsor of: HTM.java <https://github.com/numenta/htm.java> > > [email protected] <mailto:[email protected]> > http://cortical.io <http://cortical.io/> -- Carsten Schnober Doctoral Researcher Ubiquitous Knowledge Processing (UKP) Lab FB 20 / Computer Science Department Technische Universität Darmstadt Hochschulstr. 10, D-64289 Darmstadt, Germany phone [+49] (0)6151 16-6227, fax -5455, room S2/02/B111 [email protected] www.ukp.tu-darmstadt.de Web Research at TU Darmstadt (WeRC): www.werc.tu-darmstadt.de GRK 1994: Adaptive Preparation of Information from Heterogeneous Sources (AIPHES): www.aiphes.tu-darmstadt.de PhD program: Knowledge Discovery in Scientific Literature (KDSL) www.kdsl.tu-darmstadt.de
