3 Replies Latest reply on Jan 9, 2017 5:00 AM by marcuso

    101 Curie NN - Which version of library ? I have 2 versions, one with noMatch and one without in the header files

    marcuso

      Hi,

       

      I've got 2 versions of the neural network files, CuriePME.h and CuriePME.cpp on my system. Neither one has an official version number anywhere, so I can not understand how you have released 2 versions of sosftware with no official versioning ??

       

      Anyway they have no version which is ridiculous, so which should I be using ?

       

      The headers are different, in that one has a

       

      static const uint32_t noMatch = 0x7fff;

       

      And one doesnt have this constant at all.

       

      Also is this really the correct value that comes back when there is not match from a classify ?

       

       

      The code in one function looks like this :

      uint16_t Intel_PMT::learn(uint8_t *pattern_vector, int32_t vector_length, uint16_t category)

      {

         if( vector_length > MaxVectorSize )

            vector_length = MaxVectorSize;

       

         for( int i = 0; i < vector_length -1; i++ )

         {

             regWrite16( COMP , pattern_vector );
         }

         regWrite16( LCOMP, pattern_vector[ vector_length - 1 ] );

          /* Mask off the 15th bit-- valid categories range from 1-32766,
           * and bit 15 is used to indicate if a firing neuron has degenerated */
         regWrite16(CAT, (regRead16(CAT) & ~CAT_CATEGORY) | (category & CAT_CATEGORY));
         return regRead16( FORGET_NCOUNT );

      }

      So is this the correct cpp ?It seems to be the one you pointed me at recently. The other file I've got looks like this :

      uint16_t Intel_PMT::learn(uint8_t *pattern_vector, int32_t vector_length, uint8_t category)
      {
         if( vector_length > MaxVectorSize )
            vector_length = MaxVectorSize;

         for( int i = 0; i < vector_length -1; i++ )
         {
             regWrite16( COMP , pattern_vector );
         }

         regWrite16( LCOMP, pattern_vector[ vector_length - 1 ] );
         regWrite16( CAT, category );

         return regRead16( FORGET_NCOUNT );

      }

      One version of the code seems to manually reset the begin and end save and restore functionality, whilst the other version seems to not bother setting the NN state to its previous state, this is the only difference I can see.

       

      Please tell me which is the OFFICIAL supported NN lib for the Curie 101 NN lib.

       

      Thanks

       

      Marcus