-
Notifications
You must be signed in to change notification settings - Fork 29
Simulation
This chapter will provide a brief explanation on use of the main features of NuPIC Studio. This will familiarize you with how to open a project and check its details interactively.
In the last chapter, you had an overview of the main features of NuPIC. However, in order for you to have a better idea of how these tools will help you, nothing is better than trying an example for yourself.
Before this, you should first run NuPIC Studio by typing this in your shell:
nupic_studio
You will see a splash screen introducing NuPIC Studio and then a small window with 3 options:
Click on the Open Project button and choose the "Squares" project in the file list.
The first thing to notice is the architecture of this example; which is composed of a main region called "Top" and 2 lower sensors connected to it: "LeftMirror"� and "RightMirror".
Just click on "Top"� with right mouse-button and then on the Properties menu. In the window that opens, you will be able to see and even change the parameters of this region. These parameters include the architecture of this region as well as its spatial and temporal properties.
You may also do the same with any sensor. The parameters of the sensor include the size of the output (i.e. the array returned by this sensor), the source of the data (i.e. if the sensor will get data from a file or database table), and the encodings for one or more datasource fields. In this example, there is only one encoding which is responsible to handle records that already are converted, i.e. the field value already is a binary array acceptable by a HTM region. However you can handle natural values like numbers or strings specifying the appropriate encoder. Do not mind about encodings yet, the next chapter will address them in details.
Start the simulation of this example by clicking on the Initialize button which is the first button in the tool bar. The first thing that you will see is the representation in 3D of the neural network. All elements (cells, sensor bits, etc) are currently in gray simply because the network still has not interacted long enough to update its state. So click on Step button, also located on the tool bar to update the network. Do this until you see some objects in green and yellow.
You should be thinking: "What is the meaning of these spheres, lozenges and lines in different colors?"
Well, first you have to understand the meaning of each geometric element. The figure below gives a brief description of all the elements:
Now, let's understand these colors.
In NuPIC Studio, the color scheme follows a logical sequence in order to help you to understand what is going on without the need to constantly consult a legend. Bellow you will find the meaning of each color:
- Gray: elements in this color usually are inactive or simply do not need a contrast with other elements.
- Green: this color is used for represent elements that are active (in case of cells, segments, and sensor bits) or connected (in case of synapses).
- Yellow: In physics, yellow is the natural transition to green or to red. In our case, it is used to represent those elements that are predicted (yellow) but that could become active (green) in next time (T+1).
- Red: this color is used to represent falsely predicted elements, i.e. those elements that were predicted but that are not currently active. So instead of a yellow element becoming green, it becomes red. This is very useful to check whether your network is well tuned or not, and to know when a network has found an anomaly (i.e. when an unexpected input arrived).
Now it is easier to look at the figures below and understand them:
The elements in green are all those currently active due the current input, i.e. one square composed of 4 bits and its mirror representation. As the network learns that the next input is the representation of the same squares, but close to each other, it puts all elements that represent the future representation in yellow, i.e. as predicted elements.
So if you want know if an element that is currently active was indeed predicted, just slide back the step bar one time (i.e. T-1) and check if the same element that was green is now yellow.
To change the camera position, use these commands:
- Left Mouse-Button: when you press this button you are able to rotate the camera to any angle that you want.
- Mouse-Wheel: roll this button to zoom in or zoom out.
- Control Key + Left Mouse-Button: use this to pan the scene.
- Right Mouse-Button: this will open a context menu with useful options.
To revert the camera back to its original position, just open the context menu with the right mouse-button, and click on Camera > Default menu.
In order to help you focus on what really matters at a given moment, NuPIC Studio provides pre-defined and customized views that hide or show elements which satisfy certain conditions. For example, if you wish to only see inputs which are currently active and predicted, open the context menu and click on View > Sensor Bits. If you wish to see only the distal segments and synapses, learning cells, and any other elements related to temporal activation just click on View > Temporal Activation.
You can create your own views for future use. To do this, open the context menu, show or hide any kind of element using the Show menu and then click on View > Save this view menu and give a name for it. Once saved, it will appear in the views list together with the other pre-defined views.
As a neural network is simulated, NuPIC Studio calculates very useful statistics which help you to analyze whether the current parameter tuning is providing good performance and accuracy or not.
The Output panel, for example, provides a report indicating the time and accuracy calculated for each step, and a summary of these statistics which is shown only at the end of the simulation.
On the other hand, the Node Information panel provides detailed information for each element. For example, select the "Top" region and then click on Node Information panel. You will see statistics about this region and also a tab called Columns. When you click on this tab, you will see a list of all columns of this region. Each column has statistics fields such as Activation Rate and Prediction Rate like explained bellow:
- Activation Rate (%): indicates how long this column has been active. This is very useful to check if the overall boosting is working or not, for example. It is calculated by dividing the total number of times that this column was activated over the total number of time steps.
- Prediction Rate (%): indicates how accurate the predictions are which involve a particular column. This is very useful to check if the temporal parameters are well tuned or not, for example. It is calculated by dividing the total number of times that this column was predicted over the total number of time that it was really active.
Now pick some columns where IsActive field is true. When you do this, the 3D representation of its proximal segment becomes blue (which means "selected"�) and tabs with information about this column are shown. This will work recursively for cells, segments and synapses.
Now you got started with NuPIC Studio, how about try other examples provided with it? You might start with "Counting" example also located on projects
folder to check how NuPIC handle predictions for numeric values.
During the simulation of this example, you can click on "Numbers" sensor and on Encodings tab to visualize the current and the predicted values for the sensor. You will see something like this:
Note: Depending your machine, some examples may present certain slowness during the iteration, if this happen just hide the 3D simulation panel and/or other panels to gain speed.