(*********************************************************************** Mathematica-Compatible Notebook This notebook can be used on any computer system with Mathematica 3.0, MathReader 3.0, or any compatible application. The data for the notebook starts with the line of stars above. To get the notebook into a Mathematica-compatible application, do one of the following: * Save the data starting with the line of stars above into a file with a name ending in .nb, then open the file inside the application; * Copy the data starting with the line of stars above to the clipboard, then use the Paste menu command inside the application. Data for notebooks contains only printable 7-bit ASCII and can be sent directly in email or through ftp in text mode. Newlines can be CR, LF or CRLF (Unix, Macintosh or MS-DOS style). NOTE: If you modify the data for this notebook not in a Mathematica- compatible application, you must delete the line below containing the word CacheID, otherwise Mathematica-compatible applications may try to use invalid cache data. For more information on notebooks and Mathematica-compatible applications, contact Wolfram Research: web: http://www.wolfram.com email: info@wolfram.com phone: +1-217-398-0700 (U.S.) Notebook reader applications are available free of charge from Wolfram Research. ***********************************************************************) (*CacheID: 232*) (*NotebookFileLineBreakTest NotebookFileLineBreakTest*) (*NotebookOptionsPosition[ 685200, 23200]*) (*NotebookOutlinePosition[ 686737, 23248]*) (* CellTagsIndexPosition[ 686693, 23244]*) (*WindowFrame->Normal*) Notebook[{ Cell["\<\ netAn3: Other Graphical Representations of Neural Network Behavior \ (bar and density plots), Notebook Version: 2.0 Steve Hunka, University of Alberta, steve.hunka@ualberta.ca Mod. Date: Oct. 30/97; correction to function hwaxv\ \>", "Text", Evaluatable->False, AspectRatioFixed->True, FontWeight->"Bold", FontSlant->"Plain", FontTracking->"Plain", FontVariations->{"Underline"->False, "Outline"->False, "Shadow"->False}], Cell[CellGroupData[{ Cell[TextData[{ StyleBox["General Description of Notebook", Evaluatable->False, AspectRatioFixed->True, FontWeight->"Bold"], StyleBox["", Evaluatable->False, AspectRatioFixed->True] }], "Text", Evaluatable->False, AspectRatioFixed->True], Cell["\<\ The Notebook contains the following plotting functions: 1) array barplot of hidden cell responses 2) array barplot of output cell responses 3) density plot of responses (exemplar) by (exemplar attributes:hidden \ cells:outputcells:answers) 4) density plot of weights; (exemplars:hidden cells) by (exemplar attributes) 5) density plot of weighted attribute components of selected hidden cell Data input to these functions are obtained from the files written by the \ neural network function bpnn and from the data matrix input to bpnn.Only data \ of the last epoch (final network state) is used. The examples use file TCLast \ written by the function bpnn in Neural.nb.\ \>", "Text", Evaluatable->False, AspectRatioFixed->True] }, Closed]], Cell[CellGroupData[{ Cell[TextData[{ StyleBox["Functions in Notebook", Evaluatable->False, AspectRatioFixed->True, FontWeight->"Bold"], StyleBox["", Evaluatable->False, AspectRatioFixed->True] }], "Text", Evaluatable->False, AspectRatioFixed->True], Cell["\<\ hdrbarplot: for bar plot of hidden response for each exemplar otrbarplot: bar plot of output cell response for each exemplar rspbarplot: called by hrbarplot and otrbarplot to plot bars araydis: to arrange plots of mplotLists into a specified array format araydis3: for structuring array plot of bars dpltresp: density plot of responses; exemplars by (attribute:hid \ cell:output cell:answer) dpltwts: density plot of weights; attributes by (exemplars:hidden cells) hwxav: density plots of the product values of hidden weights times \ attribute input values logistic: to convert weight to a 0 to 1 scale clr3: a RGB color function used by hwxav Note: Functions hdrbarplot, otrbarplot, and rspbarplot are also in the \ Notebook netCls.nb The following functions are provided by the Package netUtil.nb and documented \ in netUdoc.nb: kbin3 input of numeric information from keyboard kbinstrg input of string information from keyboard inpvec checks the range of elements in a vector pmat2 to display matrix genrch to generate row/column headings for pmat2 rndoff round off function \ \>", "Text", Evaluatable->False, AspectRatioFixed->True] }, Closed]], Cell[CellGroupData[{ Cell[TextData["Packages Required"], "Subsubsection", Evaluatable->False, AspectRatioFixed->True], Cell[BoxData[{ \(<< "\"\), \(<< "\"\), \(<< "\"\)}], "Input", AspectRatioFixed->True] }, Open ]], Cell[CellGroupData[{ Cell[TextData[{ StyleBox["araydis[m,in]", Evaluatable->False, AspectRatioFixed->True, FontWeight->"Bold"], StyleBox[ "; arranges the plots in m for GraphicsArray according to the arrangement \ specified by in. For example if m had 9 plots, and in={2,3,4} then the 1st \ row will contain 2 plots, the next 3 plots, and the last row 4 plots as \ displayed by Graphics Array. \nLength[in] <= Length[m].\nMod. Date: Feb \ 20/97", Evaluatable->False, AspectRatioFixed->True] }], "Text", Evaluatable->False, AspectRatioFixed->True], Cell[BoxData[ \(\(araydis[m_, in_] := Module[{pa, ma, nt}, pa = {}; nt = Length[in]; ma = m; Do[AppendTo[pa, Take[ma, in\[LeftDoubleBracket]i\[RightDoubleBracket]]]; \(ma = Drop[ma, in\[LeftDoubleBracket]i\[RightDoubleBracket]]; \), {i, 1, nt}]; Return[pa]; ]; \)\)], "Input", AspectRatioFixed->True] }, Open ]], Cell[CellGroupData[{ Cell[TextData[{ StyleBox["logistic[p] ", Evaluatable->False, AspectRatioFixed->True, FontWeight->"Bold"], StyleBox[ "returns p transformed by logistic function\nMod. Date: Mar 21/96", Evaluatable->False, AspectRatioFixed->True] }], "Text", Evaluatable->False, AspectRatioFixed->True], Cell[BoxData[ \(\(logistic[p_] := 1\/\(1 + E\^\(-p\)\); \)\)], "Input", AspectRatioFixed->True] }, Open ]], Cell[CellGroupData[{ Cell[TextData[{ StyleBox["otrbarplot[d]", Evaluatable->False, AspectRatioFixed->True, FontWeight->"Bold"], StyleBox[ " creates a bar plot of the output cell response values for each exemplar. \ X-axis is output cell number; Y-axis is response value\nd is the matrix of \ output cell response values of order (#outcells,#exemplars)\nUser Input: See \ rspbarplot\nCalls: rspbarplot, kbinstrg, kbin3, araydis\nMod. Date: Mar \ 11/97", Evaluatable->False, AspectRatioFixed->True] }], "Text", Evaluatable->False, AspectRatioFixed->True], Cell[BoxData[ \(\(otrbarplot[d_] := Module[{nex}, Print["\"]; Print["\", Dimensions[d]]; Print["\", Length[d]]; nex = \(Dimensions[d]\)\[LeftDoubleBracket]2\[RightDoubleBracket]; Print["\", nex]; rspbarplot[d, nex, {"\", "\"}]; ]; \)\)], "Input", AspectRatioFixed->True] }, Open ]], Cell[CellGroupData[{ Cell[TextData[{ StyleBox["hdrbarplot[d] ", Evaluatable->False, AspectRatioFixed->True, FontWeight->"Bold"], StyleBox[ "creates a bar plot of the hidden cell response values for each exemplar. \ X-axis is hidden cell number; Y-axis is response value\nd is the matrix of \ hidden cell response values of order (#exemplars,#hidden cells)\nUser Input: \ See rspbarplot\nCalls: rspbarplot, kbinstrg, kbin3, araydis\nMod. Date: Mar \ 11/97", Evaluatable->False, AspectRatioFixed->True] }], "Text", Evaluatable->False, AspectRatioFixed->True], Cell[BoxData[ \(\(hdrbarplot[d_] := Module[{nex}, Print["\