Home
NeuroMem SDK - General Vision Inc.
Contents
1. Remarks about patterns composed of ASCII characters Remark 0 These patterns are learned to detect exact matches Because the length of the entries varies the learned vectors must be padded with space characters to reach at least a length L which is the length of the longest entry if known in advance or 256 otherwise Remark 1 It is possible that the L1 distance between two strings of ASCII characters turns equal to zero through unlucky substitutions even though the strings are not identical The use the Norm LSUP is necessary to avoid this confusion Remark 2 If an entry representing a plural such as animals has been learned the neuron holding this pattern will fire if the entry representing the singular animal is submitted and consequently animal will not be learned c The addition of a Space char at the end of each entry is an easy way to remedy this unwanted behavior of the neurons int BuildDictionnary char Filename int NbrOfFrames char delimiter This function requires an input file with the following format delimited with comma tab or other separator field O Word up to 256 char NeuroMem SDK 18 field 1 to NbOfFrames weight of Word per frame A frame can represent a topic a sentiment or else A same word can have different weighs for different frame The function erases any previous knowledge and builds two data structures adictionnary of non duplicated reference words
2. Warning In the case of the NeuroMem module 1 the usage of this function only makes sense for the CM COMP register when a vector is broadcasted to the neurons or the content of the neurons is restored However please note the following Ifthe vector to broadcast to the neurons has N components use Write Addr to submit only the first N 1 component Indeed the last component has to be written to the CM LCOMP register The N 1 components have to be formatted to a 2 N 1 data array such that every odd byte is equal to O and even byte is equal to a vector component Example Vector 1 2 3 4 gt data 0 1 0 2 0 3 0 4 Write 0x01000001 4 data writes the components 1 2 3 and 4 to the CM COMP register int Read Addr int addr int length inByte unsigned char data Read the values at the address addr of the hardware platform and store them to the byte array data Remark The internal communication protocol of the various NeuroMem platforms reads and writes integer values to the registers of the modules This means that the data array is actually filled two bytes at a time and each two bytes are assembled as the upper and lower bytes of a register value data byte array length inByte length inByte must be an even number of bytes see remark above addr 4 bytes value formatted as follows module 0 0 reg NeuroMem SDK 13 Warning In the case of the NeuroMem module 1 the usage of this function only makes sense for the C
3. a table of the weighs associated to these words per frame Example of input file with 8 frames Lemma PoS AFRAID AMUSED ANGRY ANNOYED DONT_CARE HAPPY INSPIRED SAD Abandon 0 1874 0 15971 0 11084 0 07673 0 12806 0 12490 0 1073 0 10491 Abandoned 0 10648 0 14124 0 11563 0 1323 0 13463 0 09281 0 11450 0 16236 Remark This function builds a knowledge of unigrams which are defined as words separated by the following characters 3 void SaveDictionnary char Filename Save the dictionary to file including a header composed of the variable frame number word number and max word length followed by the weightTable of size woNbr frNbr followed by the neurons content int LoadDictionnary char Filename Load the dictionnary from file including a header composed of the variable frame number word number and max word length followed by the weightTable of size woNbr frNbr followed by the neurons content Remark this format is generated by the SaveDictionnary command void ProcessPost char post int woCount Process a single post and calculate its histogram of recognized words Scores can be retrieved with the BuildScores function woCount the hitcount per words of the the dictionnary woNbr 1 void BuildScores float scoreTable Retursn the scores of the last processed post Scores score per sentiment frNbr 1 i e hitcount of the words in dictionnary multiplied by their weights for each sentiment void
4. It returns the number of pairs found vectorsRef byte Array with a size vectRefNbr vectLen vectors byte Array with a size vectNbr vectLen maxDistance distance not to exceed to consider a match between a vector and its associated vectorRef indexPairs Array matches found 2 o the first value of the pair is the index of vector o the second value of the pair is the index of the closest vectorRef matchDistances matches found o distance between the two vectors of an indexPairs Considerations before calling this function Savethe current knowledge which will be erased otherwise The NeuroMem hardware platforms use a same protocol implemented in the SDK 1 byte 4 bytes 3 bytes N words Device ID bit 31 RW command Datalength expressed in bytes Array of Datalength bytes if applicable 0 Read Default 1 1 Write Sent if bit 31 1 Default 1 bit 30 24 Module ID Received if bit 31 0 bit 23 0 Register A single read or write command takes 10 bytes which can be translated with the following sequences Write byte ModulelD byte Register int Data Read byte ModulelD byte Register int Data 1 byte 1 byte 2 bytes 1 byte 3 bytes 2 bytes x01 bit 7 1 for Write O for Read 0x0000 Register x000002 Data bit 6 0 Module ID A multiple read or write command takes 8 N 2 bytes WriteAddress long Address long Length_inBytes byte Data ReadAddress long Address long Le
5. ResetBeforeLearning is set to 1 the function preserves the value of the minimum and maximum Influence fields The flag Iterative executes the learning of the vectors repeatedly until the number of committed neurons remains steady between two passes This option produces a knowledge which is invariant to the order of the vectors but might take multiple iterations and consequently some additional time Considerations before calling this function A Clear the neurons to pad their memory with zero in case vectLen is less than 256 Setthe NSR register to 16 or O o f NSR 16 the vectors are loaded in Save and Restore mode o If NSR 0 the vectors are learned using the RBF classifier Change the Global Context Register to match the context represented by the input vectors Change the Maxif The Maxif is used when learning in normal mode NSR 0 The higher the Maxif the faster the teaching but the higher the probability of false positive Change the Minif The Minif is used when learning in normal mode NSR 0 The higher the Minif the more degenerated neurons and zones of uncertainty int BuildCodebook unsigned char vectors int vectNbr int vectLen int CatAllocMode int InitialCategory bool WithoutUncertainty Learn an array of vectors with unsupervised allocation of categories according to the selected method The vectNbr vectors are all composed of the same number of components vectLen This function does not clear the existi
6. int CatAllocMode cccccccesssceceesceceeseeseceesaes 11 void RecognizeVectors unsigned char vectors int vectNbr int vectLen int K int distances int categories int PUM LS EE 11 int MatchVectors unsigned char vectorsRef int vectRefNbr unsigned char vectors int vectNbr int vectLen int maxDistance int indexPairs int Smatchfistancesl neer enne ann anne anaaa GV eet eil e ee EE int Write unsigned char module unsigned char reg int data ccccscccssecssccssecesececsecseeeecsaeceeeeecseecseeeecsaeeeeees int Read unsigned char module unsigned char reg int Write Addr int addr int length inByte unsigned char data int Read Addr int addr int length inByte unsigned char data From Address Map to Module Register c cccssccsssscsssecssseesssecessecessecssescssecesescsaecseeeceaeceeeecaueceesecaueceeeeeenaeceanees W ele Ch ln void EnableClockCounter void DisableClockCounter int ReadclockCounter eee aiian eis aiai ina ai aaa enne annae ne aa void ClearGlockCounter WE Example using clock COUNTER RSEN NeuroMem SDK 3 Example SCM EEN StS 3 MEO REA ppp RE Step2 RECOBMITIOM As M oO Case of uncertainty closer to Neurondt1 6nvnnneeeeeenennnnnnnanneanen nn ananaeneneen an anaeaenenee ann neaeneneenanannna Case of uncertainty equi distant to Neuront1 and Neuron 2 sesssessssessserserss
7. DisplayDictionnary Display the dictionary of reference words and their weights in the various frames sentiments on the console NeuroMem SDK 19
8. I features a cycle accurate counter to evaluate the latency of the operations executed by the NeuroMem network Multiplying this counter by the duration of a clock cycle gives time spent by the entire network to execute a given function Note that this does not include the data transfer time between the network and the host Please note that enabling the cycle accurate counter imposes some overhead operations on the basic RTL functions and will consequently slow down the execution of the functions if timed by the host processor void EnableClockCounter Turn ON the usage of the cycle accurate counter and reset the counter value void DisableClockCounter NeuroMem SDK 14 Turn OFF the usage of the cycle accurate counter int ReadClockCounter Read the current value of the counter void ClearClockCounter Clear the counter Example using clock counter EnableClockCounter Read CM DIST 18 cycles Read CM CAT 19 cycles if ID is high 3 cycles otherwise ReadClockCounter returns 37 The following script is intended to illustrate the behavior of the neurons during learning and recognition operations It is supplied in a variety of programming language including C C C MatLab Python Arduino and more Step 1 Learn Learn vector1 11 11 11 11 1 with category 55 Learn vector2 15 15 15 15 with category 33 2 Leanr vector3 20 20 20 20 with category 100 1 The learned vectors are purposely set to arrays of constant
9. M COMP register in order to read the memory of a neuron However please note the following Reading the N components of a neuron requires that you size the data array to 2 N 1 bytes Every odd byte is equal to O and even byte is equal to a neuron component Example Vector 1 2 3 4 data 0 1 0 2 0 3 0 4 Write 0x01000001 4 data writes the components 1 2 3 and 4 to the CM COMP register From Address Map to Module Register Address mapping may defer between hardware platforms and below is the example of the NeuroStack board Address Range Module Address 30 24 Functionality defined by registers Address 23 8 0x01000000 NeuroMem Access to the registers of the CM1K chips whether limited to 0x0100001F 0x01 d01 the chain of 4 chips on a single board or a chain of N 4 chips on a stack of N boards 0x02000000 Board settings Access to the settings of the board connected to the host 0x0200001F 0x02 d02 including but not limited to a version number a clock counter etc 0x03000000 MRAM Access to the bank of MRAM of the board connected to the OxO3FFFFFF 0x03 d03 host 0x04000000 Recognition Engine Access to the recognition engine programmed in the FPGA 0x0400001F 0x04 d04 For information about the NeuroMem module and its registers refer to the CM1K API manual and CM1K Hardware Manual For information about the modules and registers specific to your hardware platform refer to its hardware manual The AP
10. NeuroMem SDK User s Manual API INTERFACING TOA NEUROMEM SILICON NETWORK Version 2 4 Revised 05 19 2015 NeuroMem SDK is a product of General Vision Inc GV This manual is copyrighted and published by GV All rights reserved No parts of this work may be reproduced in any form or by any means graphic electronic or mechanical including photocopying recording taping or information storage and retrieval systems without the written permission of GV For information about ownership copyrights warranties and liabilities refer to the document Standard Terms And Conditions Of Sale or contact us at www general vision com NeuroMem SDK 2 Table of Contents Introduction Bin Folder orc c Dc Ta 5 o EM Eege dE EECHER SEENEN EE SEENEN MatLab ien Hardware Interface ENES OMI RT Lu RN Void SetPlatform int platform HE 6 int Connect intDevicelD x icti teet eerte EE eerta vaatest Ree REIHE RESTE JALUS ERR CE se ave ER CEPR RER OUR RRE P CERE int Disconnect int CountNeuronsandReset Learning and Recognition functions seessesesseseseeeseeeeeeee enne nennen enn entere nest tenen rese tenter tnit nene en nnne nente nn en nennen 6 void Broadcast byte vector int length essen enne enne enne enne nennen senes entes ense neni 6 void BroadcastSR byte vector int engrh eene enne enne nennen nennen innen enne 7 int Learn unsigned cha
11. The Test Neuron script is described in Appendix of this manual MATLAB The GVEngine dll can be used from MatLab A NeuroMem Class and variety of examples are available in the NeuroMem_SDK_4MatLab NeuroMem SDK int Version Returns the version of the DLL The last digit represents the platform O Simulation or 12 NeuroStack Void SetPlatform int platform Set the hardware platform O Simulation 12 NeuroStack int Connect int DevicelD Establishes communication with the NeuroMem device This function returns O if the connection is successful In the case of a USB device DevicelD is the USB device number connected to your host Default is O int Disconnect Closes the communication with the current device int CountNeuronsandReset Detect the number of neurons available in the connected platform and then clear them all including their registers and memory Remark 1 Detecting the neurons requires to commit them all As a consequence its execution will overwrite the existing content of the neurons if any if committed Remark 2 The execution of this function can take several seconds depending on the size of the chain of CM1K chips plus it erases the contents of the neurons Pursuant to the two previous remarks it is highly recommended to use CountNeuronsandRset only at the launch of an application void Broadcast byte vector int length Broadcast the input vector composed of length components to the
12. ant to both Neuron1 and Neuron2 Learning it as a new category will force Neuron1 and 2 to shrink from thei AIF 16 to an AIF 8 in order to make room for a new neuron which will hold the new model and its category Committed neurons 4 100 Neuron ID 1 Components 11 11 11 11 AIF 8 CAT 55 s NeuronID 2 Components 15 15 15 15 AIF 8 CAT 33 NeuronID 3 Components 20 20 20 20 AIF 20 CAT 100 Neuron D 4 Components 13 13 13 13 AIF 8 CAT 100 Note that if the vector to learn was 12 12 12 12 Neuron1 would shrink to 4 and Neuron2 to 12 NeuroMem SDK 17 The text analytics functions are ready to use for keyword spotting and latent sentiment analytics provided that you have a user input file with a compatible format Examples and ready to use datasets are included in the SDK The dictionary of words with their associated weights per sentiment come from DepecheMood a Lexicon for Emotion Analysis from Crowd Annotated News The Text Analytics examples in C and Python analyze posts saved to file The Tweet Analytics example in Python retrieves live tweets User input file Word entries and their Dictionnary file weights per frame tab or comma delimited 7 LoadDictionnary BuildDictionnary e Dees Tableof a SE rz SaveDictionnary unique weighs per urov entries EE ce e ecco Single 4 Y Word counts post ProcessPost BuildScores and ee pet
13. based on Register Transfer Level RTL protocol accessing the NeuroMem CM1K chip Higher level functions manipulating agnostic or specific data types are built on this protocol as shown in the following diagram Depending on your hardware platform this RTL protocol can also be used to address other components such as memory on board sensors and more Bin Folder i String zech x DNAsequence matching Audio Voice etc Image feature extraction region of scan neurons 2D model display etc Broadcast learn and recognize vector s Clear load save display neurons Pattern Recognition functions Data Agnostic Read Write Module Register Data Read Addr Write Addr Hardware specific modules on FPGA CPU Drivers USB SPI etc GVEngine dll compiled for 32 bit and 64 bit operating systems GVAPI h header file with the declaration of the functions GVREG h file with the declaration of the CM1K registers Example folders C C The Test NM CPlusPlus program calls the GVEngine lib The declaration of typedef and function calls at located in the GVAPI h The Test Neuron script is described in Appendix of this manual CH The Test NM CSharp program calls the GVEngine dll The declaration of the function calls at located in the file GVAPI cs The Test Neuron script is described in Appendix of this manual PYTHON The Test NM Python27 programs call the GVEngine dll through a ctypes
14. d for recognition are selected purposely to illustrate cases of positive recognition with or without uncertainty as well as cases of non recognition The program reads the responses of all the firing neurons which is until the distance register returns a value OxFFFF or 65553 CASE OF UNCERTAINTY CLOSER TO NEURON 1 Vector 12 12 12 12 Response 1 Distance 4 Response 2 Distance 12 Response 3 Distance 65535 CASE OF UNCERTAINTY EQUI DISTANT TO NEURON 1 AND NEURON 2 Vector 13 13 13 13 CASE OF UNCERTAINTY CLOSER TO NEURON 2 Vector 14 14 14 14 CASE OF UNKNOWN NeuroMem SDK Neuron 1 and 2 fire Vector is closer to Neuron1 Category 65535 100 Neuron 1 and 2 fire Vector is equi distant to both neurons i Response 1 Distance 8 Response 2 Distance 8 Response 3 Distance 65535 Category 65535 100 Neuron 1 and 2 fire Vector is closer to Neuron2 S Response 1 Distance 4 Response 2 Distance 12 Response 3 Distance 65535 Category 65535 NeuronlD 1 NeuronlID 2 NeuronlD 65535 NeuronlD 2 NeuronID 1 NeuronlD 65535 NeuronlD 2 NeuronlD 1 NeuronlD 65535 16 D Vector 30 30 30 30 No neuron fire Response 1 Distance 65535 Category 65535 NeuronlD 65535 Step3 Adaptive learning Learning a new vector to illustrate the reduction of neurons AIFs Learn vector 13 13 13 13 with category 100 This vector is equidist
15. e the Minif The Minif is used when learning in normal mode NSR 0 The higher the Minif the more degenerated neurons and zones of uncertainty void RecognizeVectors unsigned char vectors int vectNbr int vectLen int K int distances int categories int nids Recognize an array of vectors and return the response of the first K firing neurons in the 3 arrays distances categories and nids The vectNbr vectors are all composed of the same number of components vectLen vectors byte Array with a size vectNbr vectLen distances int Array of size vectNbr K reporting for each vector the distances of the K top firing neurons or OxFFFF if less than K neurons fire categories int Array of size vectNbr K reporting for each vector the categories of the K top firing neurons or OxFFFF if less than K neurons fire nidsz int Array of size vectNbr K reporting for each vector the identifiers of the K top firing neurons or OxFFFF if less than K neurons fire Considerations before calling this function Change the Global Context Register to match the context represented by the input vectors NeuroMem SDK 11 int MatchVectors unsigned char vectorsRef int vectRefNbr unsigned char vectors int vectNbr int vectLen int maxDistance int indexPairs int matchDistances Match two sets of vectors of the same length and produces the pairs of matching indexes and their distances This function clears the neurons prior to execution
16. er the function returns the contents of the RTL Ready To Learn neuron Note that if an application is dealing with vectors of a length L lesser than 256 only the first L values of the modell are significant If the ClearNeurons function was executed prior to learning the first vector the remaining components from L 1 to 256 will be equal to 0 otherwise they will report values loaded at an earlier stage into the neurons int ReadNeurons unsigned char neurons int ncount Read the first ncount neurons of the chain Their content is returned in the format of an array of ncount times 264 bytes The function returns the actual number of neurons read by the function which can be less than the ncount input value In such case the neurons array of padded with zeros The content of a neuron is formatted in a 264 byte array as follow e Byte 0 0 discarded NeuroMem SDK 8 e Byte 1 NCR Neuron Context Register e Byte 2 258 256 components of the pattern vector e Byte 259 260 AIF Active Influence Field e Byte 261 262 MINIF Minimum Influence Field e Byte 263 264 CAT Category Note that if an application is dealing with vectors of a length L lesser than 256 only the first L values of the model are significant If the ClearNeurons function was executed prior to learning the first vector the remaining components from L 1 to 256 will be equal to 0 otherwise they will report values loaded at an earlier stage into
17. neurons The value length is cropped to 256 of necessary If the length of the vector is L this function executes L 1 Write COMP followed by a single Write LCOMP It can be used whether you intend to learn or recognize the vector Considerations before calling this function Change the Global Context Register GCR if the pattern belongs to a context other than the active context NeuroMem SDK 6 Change the Network Status Register NSR to turn ON OFF the KNN classifier Change the Min Influence Field and Max Influence Field Considerations after calling this function Read the Network Status Register to find out if the vector is recognized or not with uncertainty or not Write the Category register to learn the vector Read the Distance followed by Category to classify the vector void BroadcastSR byte vector int length The intend of this function is to broadcast the input vector composed of length components only when the network is already set to the Save and Restore mode The value length is cropped to 256 of necessary If the length of the vector is L this function executes L consecutive Write COMP It must be followed to a Write CAT to focus on the next neuron of the chain int Learn unsigned char vector int length int category Learn the input vector composed of length components as belonging to the category The value length is cropped to 256 of necessary The function returns the number of committed neuron
18. ng knowledge It returns the total number of committed neurons vectors byte Array with a size vectNbr vectLen CatAllocMode Defines which category to assign to a vector which is not recognized by the currently committed neurons o 0 constant value o 1 auto increment by 1 o 2 maximum delta between the vectLen components o S average value of the vectLen components InitialCategory o Initial value for the CatAllocMode 0 and 1 waiveUncertainty o If set to 1 this flag forces the learning of a vector which is recognized by the currently committed neurons but with an uncertainty or disagreement between at least two firing neurons This will force the reduction of the influence fields of some committed neurons Considerations before calling this function A Clear the neurons to pad their memory with zero in case vectLen is less than 256 Setthe NSR register to 16 or O o If NSR 16 the vectors are loaded in Save and Restore mode o If NSR 0 the vectors are learned using the RBF classifier Change the Global Context Register to match the context represented by the input vectors Change the Maxif The Maxif is used when learning in normal mode NSR 0 The higher the Maxif the faster the teaching but the higher the probability of false positive Change the Minif The Minif is used when learning in normal mode NSR 0 The higher the Minif the more degenerated neurons and zones of uncertainty NeuroMem SDK 10 int Clusteri
19. ngth_inBytes byte Data 1byte 4byte 3 bytes Length_inBytes x01 bit 31 1 for Write O for Read Length_inBytes Data bit 30 0 Address NeuroMem SDK 12 All platfoms have in common that their chain of CMIKs is referred to as the module number 1 Depending on the platform additional modules may be accessible such as a bank of memory a sensor etc For more information on these modules refer to the technical manual of the hardware int Write unsigned char module unsigned char reg int data Write the value data to the register reg of the module module Example Write 1 6 3 set the minimum influence field of the network to the value 3 int Read unsigned char module unsigned char reg Return the value of the register reg of the module module Example Read 1 15 returns the number of committed neurons int Write Addr int addr int length inByte unsigned char data Write the values of the byte array data to the address addr of the hardware platform Remark The internal communication protocol of the various NeuroMem platforms reads and writes integer values to the registers of the modules This means that the data array is actually read two bytes at a time and each two bytes are assembled as the upper and lower bytes of a register value data byte array length inByte length inByte must be an even number of bytes see remark above addr 4 bytes value formatted as follows module 0 0 reg
20. or which was broadcasted to the neurons and is still held in the Ready To Learn neuron NeuroMem SDK 7 int CommittedNeurons Report the number of committed neurons A value of OxOOFFFFFF 16 777 215 indicates that the network is full and not that over 16 millions of neurons are committed Remark The NCOUNT register of the CMIK chip is a single clock cycle instruction returning the number of committed neurons on a 16 bit value It is perfectly appropriate to read this register if your hardware platform does not include a chain of more than OxFFFF 65 535 neurons On the other end if your hardware platform is composed of a chain of more than 65 353 neurons or might expand to such capacity in the future it is recommended to use the CommittedNeurons function from the beginning instead of a Read NCOUNT The CommittedNeurons takes four clock cycles int ClearNeurons Clear the entire contents of all the neurons including registers and memory cells The function returns the number of committed neurons which should be equal to zero void ReadNeuron int neuronID unsigned char model int context int aif int minif int category Output the content of the IDth neuron in the chain including Model 256 bytes of memory Context Neuron context register Aif Active Influence Field register Minif Minimum Influence Field register Cat Category register NeuronID can range from 1 to the number of committed neurons If neuronID great
21. r vector int length int categorvl enne enne nnne er 7 int Recognize unsigned char vector int length int K int distance int category int Nid 7 void ReadLastVector unsigned char vector esses eene nennen nnne nennen senes enne 7 Loading and Retrieval of neurons content cccccccccceesessesecececsesesaeseeeeeceesesasseeececeeaessesecsceesesesseseesceeeassaeeeeseeeeesaeaaees 8 int comrittedNeutonsi oue oret E e Reese EA Peer ERE rete CE DERI Ec eR Ee MENEM MET SA 8 Unt el Sr yr STU e RE EE 8 void ReadNeuron int neuronID unsigned char model int context int aif int minif int category 8 int ReadNeurons unsigned char neurons int ncount int WriteNeurons unsigned char neurons int ncount int SaveNeurons char filename cccescesssecssscsescecsecsescecseescseecssecseseeceeesseseecaeeseeeeceeeseseeceeeseeeeceaeeeeeeeceaeeseneeses 9 int LoadNeurons char da UE ET E HE 9 Vector Batch Processing tecto niente e ER e Eee EEG e rk e Ere ae N Roe Eai eaaa FEE RE cha v sima kud Ann KUUDE eR ERE VE pu RES 9 int LearnVectors unsigned char vectors int vectNbr int vectLen int categories bool ResetBeforeLearning booliterative ENT OT LEN 9 int BuildCodebook unsigned char vectors int vectNbr int vectLen int CatAllocMode int InitialCategory bool Viol Oe Dn Cla EE 10 int Clusterize unsigned char vectors int vectNbr int vectLen
22. s Category can range between 1 to 32766 A category of 0 can be used to teach a counter example Considerations before calling this function Change the Global Context Register to match the context represented by the input vector Change the Network Status Register NSR to turn ON OFF the KNN classifier or to turn ON OFF the Save and Restore mode Change the Min Influence Field and Max Influence Field int Recognize unsigned char vector int length int K int distance int category int Nid Recognize the input vector composed of length components and read the response of the K first firing neurons reporting their Distance Category and Identifier register The value length is cropped to 256 of necessary The response of the firing neurons are automatically read in order of decreasing confidence The function returns the classification status 0 unknown 8 identified 4 uncertain Considerations before calling this function Change the Global Context Register to match the context represented by the input vector Change the Network Status Register NSR to turn ON OFF the KNN classifier or to turn ON OFF the Save and Restore mode Remark This function returns exhaustive results If an application does not require all this information you may want to use the Broadcast function and only read the registers you need for optimization purposes void ReadLastVector unsigned char vector Retrieve the last vect
23. sseerersessrerrersessesrrereessssreerreesessee Case of uncertainty closer tohNeuron nan anaanennen an ananaenene enn an anaeneneenenannea CaSO OF UNKNOWN P Step3 Adaptive learning Supplement Text Analytics functions Remarks about patterns composed of ASCII characters int BuildDictionnary char Filename int NbrOfFrames char delimiter void SaveDictionnary char Filename irere ioeie rsin ii i aE iae ia E AEE EE aa E eE E a int LoadDictionnary char Filename ccccccccssscccssssscecssscececssesecsessececsssececssesecseauecscesseceesseseceesaeesceeseeceeaseeceesaes void ProcessPost char post int WoCount secreet aa a e a sentada ss katita void B ildScores float scoreTable 2 eet eto n EEEE AAEE EEE EEE EEE Ea o Rap evan Vold DisplayDictiontiary etre cte reete ete eee t eec e ue sette coe Ree ee NeuroMem SDK 4 The NeuroMem SDK let s you take advantage of a NeuroMem hardware neural network to match and classify patterns at high speed with deterministic latency and using low power appliances The NeuroMem SDK interfaces with the following hardware from General Vision Single NeuroStack board featuring a chain of 4096 neurons default configuration Stack of N NeuroStack boards featuring a chain of up to N 4096 neurons The selection of the hardware is made at the instantiation of the class through the platform input parameter The functions supplied in the NeuroMem SDK are all
24. the neurons int WriteNeurons unsigned char neurons int ncount Load the contents of the neurons from an array of ncount times 264 bytes The content of a neuron is formatted in a 264 byte array as follow e Byte 0 0 discarded e Byte 1 NCR Neuron Context Register e Byte 2 258 256 components of the pattern vector e Byte 259 260 AIF Active Influence Field e Byte 261 262 MINIF Minimum Influence Field e Byte 263 264 CAT Category int SaveNeurons char filename Save the contents of all the neurons to a file The function returns the number of committed neurons saved to the file int LoadNeurons char filename Load the contents of all the neurons from a file The function returns the number of committed neurons loaded from the file int LearnVectors unsigned char vectors int vectNbr int vectLen int categories bool ResetBeforeLearning bool iterative Learn an array of vectors with their asscoiated categories The vectNbr vectors are all composed of the same number of components vectLen It returns the total number of committed neurons vectors byte Array with a size vectNbr vectLen categories int Array with a size of vectNbr The flag ResetBeforeLearning allows to reset the network prior to learning Note that this reset is a simple Write FORGET which takes a simple clock cycle and not a ClearNeurons which erases the content of the neurons NeuroMem SDK 9 memory but takes 258clock cycles If
25. values so their representation and relationship are easy to understand The distance between two flat vectors is indeed the difference between their constant value times their number of components For example the distance between 11 11 11 11 and 15 15 15 15 is equal to 4 4 This simple arithmetic makes it easy to understand the different cases of recognition illustrated in this test script 2 The category of the second neuron is purposely set to a lesser value than the category of the first neuron to verify that if both neurons fire with a same distance the category of the neuron on the 2 chip is still the first the be read out Fig1 is a representation of the decision space modeled by the 3 neurons where Neuroni is shown in red Neuron2 in green and Neuron3 in blue In the follwoing 2D graph we limit the length of the models to 2 components instead of 4 so they can be positioned in an X Y plot X 1 component and Y Last component and a surrounding diamond shape with the side egual to their influence field NeuroMem SDK 15 Committed neurons 3 NeuronlD 1 Components 11 11 11 11 AIF 16 CAT 55 NeuronlD 2 Components 15 15 15 15 AIF 16 CAT 33 NeuronlD 3 Components 20 20 20 20 AIF 20 CAT 100 The influence fields of Neuron 0 and Neuron 1 overlap as well as Neuron 1 and Neuron 2 overlap but differently since their distances from one another are different Step2 Recognition The vectors submitte
26. ze unsigned char vectors int vectNbr int vectLen int CatAllocMode Learn the input vectors assigning their categories autonomously according to the selected method This function clears the existing knowledge prior to learning It returns the total number of committed neurons It is slightly different from the BuildCodebook in the sense that an input vector is considered as a novelty if a it is unknown or b it is known but at a distance greater than MINIF from an existing model The value of the MINIF register set before the execution of the command forces a minimum spacing between the models vectors byte Array with a size vectNbr vectLen CatAllocMode Defines which category to assign to a vector which is not recognized by the currently committed neurons o 1 auto increment by 1 o 2 maximum delta between the vectLen components o S average value of the vectLen components Considerations before calling this function Save the current knowledge which will be erased otherwise Clear the neurons to pad their memory with zero in case vectLen is less than 256 Setthe NSR register to 16 or O o If NSR 16 the vectors are loaded in Save and Restore mode o If NSR 0 the vectors are learned using the RBF classifier Change the Global Context Register Change the Maxif The Maxif is used when learning in normal mode NSR 0 The higher the Maxif the faster the teaching but the higher the probability of false positive Chang
Download Pdf Manuals
Related Search
Related Contents
Article complet 取扱説明書 - 双興電機製作所 Tecumseh THG1352YGS Technical Data Sheet ADTRAN IP 601 User's Manual Benutzerhandbuch für die KODAK EASYSHARE ZD710 Digitalkamera Bedienungsanleitung ニッペ ファインルーフSi Manuel d`utilisation pour ordinateur portable “ NーPP。N ANTENNA 取扱説明書 Copyright © All rights reserved.
Failed to retrieve file