|
| 1 | +Artificial Neural Networks Parallel and Distributed Processing -2: Constraint Satisfaction Neural Network model Code Documentation |
| 2 | + |
| 3 | +Introduction |
| 4 | + |
| 5 | +This document captures the experiment implementation details. |
| 6 | + |
| 7 | +Code Details |
| 8 | + |
| 9 | +File Name : pdp2.js |
| 10 | + |
| 11 | +File Description : This file contains all the code for implementation of the canvas and the buttons. |
| 12 | + |
| 13 | +Function : setup() |
| 14 | + |
| 15 | +Function Description : make canvas and call functions for setting clamping of descrriptors to false and getting names and weights |
| 16 | + |
| 17 | +Function : setRooms() |
| 18 | + |
| 19 | +Function Description : set descriptors for further training to false. |
| 20 | + |
| 21 | +Function : getWeights() |
| 22 | + |
| 23 | +Function Description : getting weights from byte string between 68x68 units. |
| 24 | + |
| 25 | +Function : setDescriptors() |
| 26 | + |
| 27 | +Function Description : setting clamping of descriptors to false. |
| 28 | + |
| 29 | +Function : draw() |
| 30 | + |
| 31 | +Function Description : this is the main looping function which calls for the drawing of the stage according to the stage variable. |
| 32 | + |
| 33 | +Function : drawStageOne() |
| 34 | + |
| 35 | +Function Description : this is the home page showing descriptors and buttons for other two stages. |
| 36 | + |
| 37 | +Function : drawStageTwoMain() |
| 38 | + |
| 39 | +Function Description : this is the page for the showing options for hinton diagrams of the descriptors. |
| 40 | + |
| 41 | +Function : drawStageTwoOne() |
| 42 | + |
| 43 | +Function Description : this is the page for the showing of original hinton diagram of the descriptors. |
| 44 | + |
| 45 | +Function : drawStageTwoTwo() |
| 46 | + |
| 47 | +Function Description : loads page for further training of model. |
| 48 | + |
| 49 | +Function : validateTrainNetwork(); |
| 50 | + |
| 51 | +Function Description : check if a descriptor has been selected for each room type. |
| 52 | + |
| 53 | +Function : drawStageTwoTwoOne() |
| 54 | + |
| 55 | +Function Description : initiates making of the hinton diagrams of further trained network. |
| 56 | + |
| 57 | +Function : checkForHover() |
| 58 | + |
| 59 | +Function Description : checks if mouse is hovering over any hinton diagram in order to show zoomed in version of it. |
| 60 | + |
| 61 | +Function : setRoomDescriptor() |
| 62 | + |
| 63 | +Function Description : sets descriptors for further training according to the room types. |
| 64 | + |
| 65 | +Function : makeNewHinton() |
| 66 | + |
| 67 | +Function Description : calculates the new weights in order to make new hinton diagram. |
| 68 | + |
| 69 | +Function : makeHinton() |
| 70 | + |
| 71 | +Function Description : makes the hinton diagrams for both old and new descriptor choices. |
| 72 | + |
| 73 | +Function : getRoomChoice() |
| 74 | + |
| 75 | +Function Description : get room choice for further training according to mouse click |
| 76 | + |
| 77 | +Function : drawStageThree() |
| 78 | + |
| 79 | +Function Description : this is the page for the clamping of descriptors and showing their values cycle after cycle. |
| 80 | + |
| 81 | +Function : testNetwork() |
| 82 | + |
| 83 | +Function Description : if test network button is clicked, calculation and display functions trigger. |
| 84 | + |
| 85 | +Function : clampDescriptor() |
| 86 | + |
| 87 | +Function Description : clamps and unclamps descriptors based on clicking of a descriptor. |
| 88 | + |
| 89 | +Function : displayTestedNetwork() |
| 90 | + |
| 91 | +Function Description : once calculation of activation is done, display function runs to show the variation cycle after cycle. |
| 92 | + |
| 93 | +Function : validateClampNetwork() |
| 94 | + |
| 95 | +Function Description : checks if any descriptor is selected to be clamped. |
| 96 | + |
| 97 | +Function : mouseReleased() |
| 98 | + |
| 99 | +Function Description : checks for clicks and accordingly triggers different stages and clamping. |
| 100 | + |
| 101 | + |
| 102 | +Other details: |
| 103 | + |
| 104 | +Formulas used in the Experiment: |
| 105 | + |
| 106 | +if descriptor is clamped, it is given activation 1, otherwise 0. |
| 107 | +nextState[i] of a descriptor is the sum of the products of activation[j] with weights[i][j] |
| 108 | +if nextState[i] is greater than the threshold, it is given value 1, otherwise 0. |
| 109 | +if nextState[i] is 1, activation is set to 1 irrespective of it's initial value. |
| 110 | +activation of each descriptor is calculated for 16 cycles one after another and displayed. |
| 111 | + |
| 112 | + |
| 113 | + |
| 114 | + |
0 commit comments