(* Content-type: application/vnd.wolfram.mathematica *)
(*** Wolfram Notebook File ***)
(* http://www.wolfram.com/nb *)
(* CreatedBy='Mathematica 10.3' *)
(*CacheID: 234*)
(* Internal cache information:
NotebookFileLineBreakTest
NotebookFileLineBreakTest
NotebookDataPosition[ 158, 7]
NotebookDataLength[ 1380607, 28373]
NotebookOptionsPosition[ 1357774, 27558]
NotebookOutlinePosition[ 1359869, 27626]
CellTagsIndexPosition[ 1359786, 27621]
WindowFrame->Normal*)
(* Beginning of Notebook Content *)
Notebook[{
Cell[CellGroupData[{
Cell[TextData[{
"Neural Networks in ",
StyleBox["Mathematica",
FontSlant->"Italic"],
" 11"
}], "Title",
CellChangeTimes->{{3.5496241220858183`*^9, 3.5496241316698093`*^9}, {
3.549818710673188*^9, 3.5498187115316067`*^9}, {3.5498190276432457`*^9,
3.549819032858705*^9}, 3.6768395288942833`*^9, 3.6868505876414385`*^9, {
3.6868506286462903`*^9, 3.686850639989707*^9}}],
Cell[TextData[StyleBox["Brian Mayer",
FontSize->24,
FontSlant->"Italic"]], "Text",
CellChangeTimes->{{3.549624168509506*^9, 3.549624171985794*^9}, {
3.549624508772977*^9, 3.549624510775043*^9}, {3.5498187159613867`*^9,
3.5498187170087957`*^9}, {3.549819049020514*^9, 3.5498190533440437`*^9}, {
3.676839535949759*^9, 3.676839542654063*^9}}],
Cell["\<\
This presentation shows some examples of how to use neural networks.\
\>", "Text",
CellChangeTimes->{{3.6868509153984747`*^9, 3.68685097821916*^9}}],
Cell[CellGroupData[{
Cell["Contact!", "Chapter",
CellChangeTimes->{{3.6868511030943713`*^9, 3.6868511133739614`*^9}, {
3.686851209366808*^9, 3.6868512220801334`*^9}}],
Cell[CellGroupData[{
Cell["What is a Neural Network?", "Subchapter",
CellChangeTimes->{{3.6870154296535254`*^9, 3.6870154465796003`*^9}}],
Cell["\<\
Neural Networks are a computational approach which is based on a large \
collection of neural units loosely modeling the way the brain solves problems \
with large clusters of biological neurons connected by axons.\
\>", "Text",
CellChangeTimes->{{3.6874566313486023`*^9, 3.68745663135802*^9}, {
3.687456678073867*^9, 3.6874567167612467`*^9}}]
}, Open ]],
Cell[CellGroupData[{
Cell["What are its Elements?", "Subchapter",
CellChangeTimes->{{3.6870154296535254`*^9, 3.6870154465796003`*^9}, {
3.687018750760042*^9, 3.687018760319042*^9}}],
Cell[TextData[{
"Mathematica has the following elements for use with neural networks:\n\n\
NetGraph\[LongDash]symbolic representation of trained or untrained net graphs \
to be applied to data\nNetChain\[LongDash]symbolic representation of a simple \
chain of net layers\nNetPort\[LongDash]symbolic representation of a named \
input or output port for a layer\nNetExtract\[LongDash]extract properties and \
weights etc. from net\nNetInitialize\[LongDash]randomly initialize parameters \
for a network\nDotPlusLayer\[LongDash]trainable layer with dense connections \
computing ",
StyleBox["w.x + b",
FontSlant->"Italic"],
"\nElementwiseLayer\[LongDash]apply a specified function to each element in \
a tensor\nTotalLayer\[LongDash]layer adding corresponding elements of \
multiple tensors\nSoftmaxLayer\[LongDash]layer globally normalizing elements \
to the unit interval\nEmbeddingLayer\[LongDash]trainable layer for embedding \
integers into continuous vector spaces\nMeanSquaredLossLayer\n\
MeanAbsoluteLossLayer\nCrossEntropyLossLayer\nCatenateLayer\nFlattenLayer\n\
ReshapeLayer\nSummationLayer\nConvolutionLayer\nDeconvolutionLayer\n\
PoolingLayer\nNetTrain\[LongDash]train parameters in any net from examples\n\
BatchNormalizationLayer\nDropoutLayer\nNetEncoder\[LongDash]convert images, \
categories, etc.to net - compatible numerical arrays\n\
NetDecoder\[LongDash]interpret net - generated numerical arrays as images, \
probabilities, etc.\nRamp\[LongDash]rectified linear (ReLU)\nTanh\n\
LogisticSigmoid"
}], "Text",
CellChangeTimes->{{3.687018793370042*^9, 3.687018824387042*^9}, {
3.6870189195670424`*^9, 3.687018976603042*^9}, {3.6870194474710407`*^9,
3.6870194735320406`*^9}, {3.687290080842717*^9, 3.6872900947052526`*^9}, {
3.687461987513193*^9, 3.687462064207654*^9}}]
}, Open ]],
Cell[CellGroupData[{
Cell["Basic elements and examples", "Subchapter",
CellChangeTimes->{{3.6870154296535254`*^9, 3.6870154465796003`*^9},
3.687298880939156*^9, {3.6883396439113493`*^9, 3.68833964814053*^9}, {
3.688339737981079*^9, 3.688339747001809*^9}}],
Cell[CellGroupData[{
Cell["ElementWise Layer", "Section",
CellChangeTimes->{{3.6883279797291403`*^9, 3.688328002996376*^9}}],
Cell["How the ElementWise Layer works:", "Text",
CellChangeTimes->{{3.687459052020461*^9, 3.6874590707848263`*^9}, {
3.687463722590665*^9, 3.6874637269507093`*^9}, {3.688327867465042*^9,
3.688327888444188*^9}}],
Cell[CellGroupData[{
Cell[BoxData[
RowBox[{"netTanh", "=",
RowBox[{"ElementwiseLayer", "[", "Tanh", "]"}]}]], "Input",
CellChangeTimes->{{3.687015634458902*^9, 3.6870156411512585`*^9}, {
3.687290297772546*^9, 3.687290316403901*^9}, {3.68832790813268*^9,
3.688327912906831*^9}}],
Cell[BoxData[
InterpretationBox[
RowBox[{
TagBox["ElementwiseLayer",
"SummaryHead"], "[",
DynamicModuleBox[{Typeset`open$$ = False},
PanelBox[
PaneSelectorBox[{False->GridBox[{
{
PaneBox[
ButtonBox[
DynamicBox[FEPrivate`FrontEndResource[
"FEBitmaps", "SquarePlusIconMedium"],
ImageSizeCache->{12., {0., 12.}}],
Appearance->None,
ButtonFunction:>(Typeset`open$$ = True),
Evaluator->Automatic,
Method->"Preemptive"],
Alignment->{Center, Center},
ImageSize->
Dynamic[{
Automatic, 3.5 CurrentValue["FontCapHeight"]/AbsoluteCurrentValue[
Magnification]}]],
GraphicsBox[{
{Opacity[
0.3], {LineBox[
NCache[{{0, 0}, {Rational[-1, 2], 1}}, {{0, 0}, {-0.5, 1}}]],
LineBox[NCache[{{0, 0}, {Rational[1, 2], 1}}, {{0, 0}, {
0.5, 1}}]],
LineBox[NCache[{{0, 0}, {Rational[3, 2], 1}}, {{0, 0}, {
1.5, 1}}]]}, {
LineBox[NCache[{{1, 0}, {Rational[-1, 2], 1}}, {{1,
0}, {-0.5, 1}}]],
LineBox[NCache[{{1, 0}, {Rational[1, 2], 1}}, {{1, 0}, {
0.5, 1}}]],
LineBox[NCache[{{1, 0}, {Rational[3, 2], 1}}, {{1, 0}, {
1.5, 1}}]]}},
{AbsolutePointSize[5], PointBox[{{0, 0}, {1, 0}}],
PointBox[
NCache[{{Rational[-1, 2], 1}, {Rational[1, 2], 1}, {
Rational[3, 2], 1}}, {{-0.5, 1}, {0.5, 1}, {1.5, 1}}]]}},
ImageSize->32], GridBox[{
{
ItemBox[
StyleBox["\<\"Parameters:\"\>",
StripOnInput->False,
FontWeight->Bold],
StripOnInput->False],
ItemBox["\<\"\"\>",
StripOnInput->False]},
{
TagBox[
StyleBox[
TemplateBox[{"\"Function\"","\":\""},
"RowDefault"], "SummaryItemAnnotation",
StripOnInput->False],
"SummaryItem"],
TagBox[
StyleBox["Tanh", "SummaryItem",
StripOnInput->False],
"SummaryItem"]}
},
AutoDelete->False,
BaseStyle->{
ShowStringCharacters -> False, NumberMarks -> False,
PrintPrecision -> 3, ShowSyntaxStyles -> False},
GridBoxAlignment->{"Columns" -> {{Left}}, "Rows" -> {{Automatic}}},
GridBoxItemSize->{
"Columns" -> {{Automatic}}, "Rows" -> {{Automatic}}},
GridBoxSpacings->{"Columns" -> {{2}}, "Rows" -> {{Automatic}}}]}
},
AutoDelete->False,
BaselinePosition->{1, 1},
GridBoxAlignment->{"Rows" -> {{Top}}},
GridBoxItemSize->{
"Columns" -> {{Automatic}}, "Rows" -> {{Automatic}}}], True->
GridBox[{
{
PaneBox[
ButtonBox[
DynamicBox[FEPrivate`FrontEndResource[
"FEBitmaps", "SquareMinusIconMedium"]],
Appearance->None,
ButtonFunction:>(Typeset`open$$ = False),
Evaluator->Automatic,
Method->"Preemptive"],
Alignment->{Center, Center},
ImageSize->
Dynamic[{
Automatic, 3.5 CurrentValue["FontCapHeight"]/AbsoluteCurrentValue[
Magnification]}]],
GraphicsBox[{
{Opacity[
0.3], {LineBox[
NCache[{{0, 0}, {Rational[-1, 2], 1}}, {{0, 0}, {-0.5, 1}}]],
LineBox[NCache[{{0, 0}, {Rational[1, 2], 1}}, {{0, 0}, {
0.5, 1}}]],
LineBox[NCache[{{0, 0}, {Rational[3, 2], 1}}, {{0, 0}, {
1.5, 1}}]]}, {
LineBox[NCache[{{1, 0}, {Rational[-1, 2], 1}}, {{1,
0}, {-0.5, 1}}]],
LineBox[NCache[{{1, 0}, {Rational[1, 2], 1}}, {{1, 0}, {
0.5, 1}}]],
LineBox[NCache[{{1, 0}, {Rational[3, 2], 1}}, {{1, 0}, {
1.5, 1}}]]}},
{AbsolutePointSize[5], PointBox[{{0, 0}, {1, 0}}],
PointBox[
NCache[{{Rational[-1, 2], 1}, {Rational[1, 2], 1}, {
Rational[3, 2], 1}}, {{-0.5, 1}, {0.5, 1}, {1.5, 1}}]]}},
ImageSize->32], GridBox[{
{
ItemBox[
StyleBox["\<\"Parameters:\"\>",
StripOnInput->False,
FontWeight->Bold],
StripOnInput->False],
ItemBox["\<\"\"\>",
StripOnInput->False]},
{
TagBox[
StyleBox[
TemplateBox[{"\"Function\"","\":\""},
"RowDefault"], "SummaryItemAnnotation",
StripOnInput->False],
"SummaryItem"],
TagBox[
StyleBox["Tanh", "SummaryItem",
StripOnInput->False],
"SummaryItem"]},
{
ItemBox[
StyleBox["\<\"Ports:\"\>",
StripOnInput->False,
FontWeight->Bold],
Frame->{{False, False}, {False, True}},
FrameStyle->GrayLevel[0.85],
StripOnInput->False],
ItemBox[
InterpretationBox[
StyleBox[
GraphicsBox[{},
BaselinePosition->(Scaled[0.] -> Baseline),
ImageSize->{1, 11}],
CacheGraphics->False],
Spacer[{1, 11}]],
Frame->{{False, False}, {False, True}},
FrameStyle->GrayLevel[0.85],
StripOnInput->False]},
{
TagBox[
StyleBox[
TemplateBox[{"\"Input\"","\":\""},
"RowDefault"], "SummaryItemAnnotation",
StripOnInput->False],
"SummaryItem"],
TagBox[
StyleBox["\<\"tensor\"\>", "SummaryItem",
StripOnInput->False],
"SummaryItem"]},
{
TagBox[
StyleBox[
TemplateBox[{"\"Output\"","\":\""},
"RowDefault"], "SummaryItemAnnotation",
StripOnInput->False],
"SummaryItem"],
TagBox[
StyleBox["\<\"tensor\"\>", "SummaryItem",
StripOnInput->False],
"SummaryItem"]}
},
AutoDelete->False,
BaseStyle->{
ShowStringCharacters -> False, NumberMarks -> False,
PrintPrecision -> 3, ShowSyntaxStyles -> False},
GridBoxAlignment->{"Columns" -> {{Left}}, "Rows" -> {{Automatic}}},
GridBoxItemSize->{
"Columns" -> {{Automatic}}, "Rows" -> {{Automatic}}},
GridBoxSpacings->{"Columns" -> {{2}}, "Rows" -> {{Automatic}}}]}
},
AutoDelete->False,
BaselinePosition->{1, 1},
GridBoxAlignment->{"Rows" -> {{Top}}},
GridBoxItemSize->{
"Columns" -> {{Automatic}}, "Rows" -> {{Automatic}}}]}, Dynamic[
Typeset`open$$],
ImageSize->Automatic],
BaselinePosition->Baseline],
DynamicModuleValues:>{}], "]"}],
None,
Editable->False,
SelectWithContents->True,
Selectable->False]], "Output",
CellChangeTimes->{
3.6870152587660975`*^9, 3.6870156418688545`*^9, {3.6872903053557863`*^9,
3.6872903172453127`*^9}, 3.688327913930319*^9}]
}, Open ]],
Cell[CellGroupData[{
Cell[BoxData[
RowBox[{"netTanh", "[",
RowBox[{"{",
RowBox[{"2", ",", "1", ",", "0"}], "}"}], "]"}]], "Input",
CellChangeTimes->{{3.687015261387763*^9, 3.687015311879588*^9}, {
3.6870153881701226`*^9, 3.6870154163857803`*^9}, 3.6874571934622087`*^9, {
3.688327918044487*^9, 3.688327926718062*^9}}],
Cell[BoxData[
RowBox[{"{",
RowBox[{"0.9640275835990906`", ",", "0.7615941762924194`", ",", "0.`"}],
"}"}]], "Output",
CellChangeTimes->{{3.6870152745976863`*^9, 3.6870153124411774`*^9},
3.6870156287649384`*^9, 3.687290320689939*^9, {3.687457190165615*^9,
3.6874571939504757`*^9}, {3.688327919968876*^9, 3.688327927595108*^9}}]
}, Open ]],
Cell[CellGroupData[{
Cell[BoxData[
RowBox[{"netRamp", "=",
RowBox[{"ElementwiseLayer", "[", "Ramp", "]"}]}]], "Input",
CellChangeTimes->{{3.687015634458902*^9, 3.6870156411512585`*^9}, {
3.687290297772546*^9, 3.687290316403901*^9}, {3.68832790813268*^9,
3.688327912906831*^9}, {3.68832801698722*^9, 3.688328027604851*^9}}],
Cell[BoxData[
InterpretationBox[
RowBox[{
TagBox["ElementwiseLayer",
"SummaryHead"], "[",
DynamicModuleBox[{Typeset`open$$ = False},
PanelBox[
PaneSelectorBox[{False->GridBox[{
{
PaneBox[
ButtonBox[
DynamicBox[FEPrivate`FrontEndResource[
"FEBitmaps", "SquarePlusIconMedium"],
ImageSizeCache->{12., {0., 12.}}],
Appearance->None,
ButtonFunction:>(Typeset`open$$ = True),
Evaluator->Automatic,
Method->"Preemptive"],
Alignment->{Center, Center},
ImageSize->
Dynamic[{
Automatic, 3.5 CurrentValue["FontCapHeight"]/AbsoluteCurrentValue[
Magnification]}]],
GraphicsBox[{
{Opacity[
0.3], {LineBox[
NCache[{{0, 0}, {Rational[-1, 2], 1}}, {{0, 0}, {-0.5, 1}}]],
LineBox[NCache[{{0, 0}, {Rational[1, 2], 1}}, {{0, 0}, {
0.5, 1}}]],
LineBox[NCache[{{0, 0}, {Rational[3, 2], 1}}, {{0, 0}, {
1.5, 1}}]]}, {
LineBox[NCache[{{1, 0}, {Rational[-1, 2], 1}}, {{1,
0}, {-0.5, 1}}]],
LineBox[NCache[{{1, 0}, {Rational[1, 2], 1}}, {{1, 0}, {
0.5, 1}}]],
LineBox[NCache[{{1, 0}, {Rational[3, 2], 1}}, {{1, 0}, {
1.5, 1}}]]}},
{AbsolutePointSize[5], PointBox[{{0, 0}, {1, 0}}],
PointBox[
NCache[{{Rational[-1, 2], 1}, {Rational[1, 2], 1}, {
Rational[3, 2], 1}}, {{-0.5, 1}, {0.5, 1}, {1.5, 1}}]]}},
ImageSize->32], GridBox[{
{
ItemBox[
StyleBox["\<\"Parameters:\"\>",
StripOnInput->False,
FontWeight->Bold],
StripOnInput->False],
ItemBox["\<\"\"\>",
StripOnInput->False]},
{
TagBox[
StyleBox[
TemplateBox[{"\"Function\"","\":\""},
"RowDefault"], "SummaryItemAnnotation",
StripOnInput->False],
"SummaryItem"],
TagBox[
StyleBox["Ramp", "SummaryItem",
StripOnInput->False],
"SummaryItem"]}
},
AutoDelete->False,
BaseStyle->{
ShowStringCharacters -> False, NumberMarks -> False,
PrintPrecision -> 3, ShowSyntaxStyles -> False},
GridBoxAlignment->{"Columns" -> {{Left}}, "Rows" -> {{Automatic}}},
GridBoxItemSize->{
"Columns" -> {{Automatic}}, "Rows" -> {{Automatic}}},
GridBoxSpacings->{"Columns" -> {{2}}, "Rows" -> {{Automatic}}}]}
},
AutoDelete->False,
BaselinePosition->{1, 1},
GridBoxAlignment->{"Rows" -> {{Top}}},
GridBoxItemSize->{
"Columns" -> {{Automatic}}, "Rows" -> {{Automatic}}}], True->
GridBox[{
{
PaneBox[
ButtonBox[
DynamicBox[FEPrivate`FrontEndResource[
"FEBitmaps", "SquareMinusIconMedium"]],
Appearance->None,
ButtonFunction:>(Typeset`open$$ = False),
Evaluator->Automatic,
Method->"Preemptive"],
Alignment->{Center, Center},
ImageSize->
Dynamic[{
Automatic, 3.5 CurrentValue["FontCapHeight"]/AbsoluteCurrentValue[
Magnification]}]],
GraphicsBox[{
{Opacity[
0.3], {LineBox[
NCache[{{0, 0}, {Rational[-1, 2], 1}}, {{0, 0}, {-0.5, 1}}]],
LineBox[NCache[{{0, 0}, {Rational[1, 2], 1}}, {{0, 0}, {
0.5, 1}}]],
LineBox[NCache[{{0, 0}, {Rational[3, 2], 1}}, {{0, 0}, {
1.5, 1}}]]}, {
LineBox[NCache[{{1, 0}, {Rational[-1, 2], 1}}, {{1,
0}, {-0.5, 1}}]],
LineBox[NCache[{{1, 0}, {Rational[1, 2], 1}}, {{1, 0}, {
0.5, 1}}]],
LineBox[NCache[{{1, 0}, {Rational[3, 2], 1}}, {{1, 0}, {
1.5, 1}}]]}},
{AbsolutePointSize[5], PointBox[{{0, 0}, {1, 0}}],
PointBox[
NCache[{{Rational[-1, 2], 1}, {Rational[1, 2], 1}, {
Rational[3, 2], 1}}, {{-0.5, 1}, {0.5, 1}, {1.5, 1}}]]}},
ImageSize->32], GridBox[{
{
ItemBox[
StyleBox["\<\"Parameters:\"\>",
StripOnInput->False,
FontWeight->Bold],
StripOnInput->False],
ItemBox["\<\"\"\>",
StripOnInput->False]},
{
TagBox[
StyleBox[
TemplateBox[{"\"Function\"","\":\""},
"RowDefault"], "SummaryItemAnnotation",
StripOnInput->False],
"SummaryItem"],
TagBox[
StyleBox["Ramp", "SummaryItem",
StripOnInput->False],
"SummaryItem"]},
{
ItemBox[
StyleBox["\<\"Ports:\"\>",
StripOnInput->False,
FontWeight->Bold],
Frame->{{False, False}, {False, True}},
FrameStyle->GrayLevel[0.85],
StripOnInput->False],
ItemBox[
InterpretationBox[
StyleBox[
GraphicsBox[{},
BaselinePosition->(Scaled[0.] -> Baseline),
ImageSize->{1, 11}],
CacheGraphics->False],
Spacer[{1, 11}]],
Frame->{{False, False}, {False, True}},
FrameStyle->GrayLevel[0.85],
StripOnInput->False]},
{
TagBox[
StyleBox[
TemplateBox[{"\"Input\"","\":\""},
"RowDefault"], "SummaryItemAnnotation",
StripOnInput->False],
"SummaryItem"],
TagBox[
StyleBox["\<\"tensor\"\>", "SummaryItem",
StripOnInput->False],
"SummaryItem"]},
{
TagBox[
StyleBox[
TemplateBox[{"\"Output\"","\":\""},
"RowDefault"], "SummaryItemAnnotation",
StripOnInput->False],
"SummaryItem"],
TagBox[
StyleBox["\<\"tensor\"\>", "SummaryItem",
StripOnInput->False],
"SummaryItem"]}
},
AutoDelete->False,
BaseStyle->{
ShowStringCharacters -> False, NumberMarks -> False,
PrintPrecision -> 3, ShowSyntaxStyles -> False},
GridBoxAlignment->{"Columns" -> {{Left}}, "Rows" -> {{Automatic}}},
GridBoxItemSize->{
"Columns" -> {{Automatic}}, "Rows" -> {{Automatic}}},
GridBoxSpacings->{"Columns" -> {{2}}, "Rows" -> {{Automatic}}}]}
},
AutoDelete->False,
BaselinePosition->{1, 1},
GridBoxAlignment->{"Rows" -> {{Top}}},
GridBoxItemSize->{
"Columns" -> {{Automatic}}, "Rows" -> {{Automatic}}}]}, Dynamic[
Typeset`open$$],
ImageSize->Automatic],
BaselinePosition->Baseline],
DynamicModuleValues:>{}], "]"}],
None,
Editable->False,
SelectWithContents->True,
Selectable->False]], "Output",
CellChangeTimes->{
3.6870152587660975`*^9, 3.6870156418688545`*^9, {3.6872903053557863`*^9,
3.6872903172453127`*^9}, 3.688327913930319*^9, 3.6883280280728407`*^9}]
}, Open ]],
Cell[CellGroupData[{
Cell[BoxData[
RowBox[{"netRamp", "[",
RowBox[{"{",
RowBox[{
RowBox[{"-", "2"}], ",", "0", ",", ".5", ",", "1", ",", "2"}], "}"}],
"]"}]], "Input",
CellChangeTimes->{{3.687015261387763*^9, 3.687015311879588*^9}, {
3.6870153881701226`*^9, 3.6870154163857803`*^9}, 3.6874571934622087`*^9, {
3.688327918044487*^9, 3.688327926718062*^9}, {3.6883280322320957`*^9,
3.688328056174412*^9}}],
Cell[BoxData[
RowBox[{"{",
RowBox[{"0.`", ",", "0.`", ",", "0.5`", ",", "1.`", ",", "2.`"}],
"}"}]], "Output",
CellChangeTimes->{{3.6870152745976863`*^9, 3.6870153124411774`*^9},
3.6870156287649384`*^9, 3.687290320689939*^9, {3.687457190165615*^9,
3.6874571939504757`*^9}, {3.688327919968876*^9, 3.688327927595108*^9}, {
3.688328035967703*^9, 3.688328057588262*^9}}]
}, Open ]]
}, Open ]],
Cell[CellGroupData[{
Cell["DotPlus Layer", "Section",
CellChangeTimes->{{3.68834237043491*^9, 3.688342374493449*^9}}],
Cell[CellGroupData[{
Cell[BoxData[
RowBox[{"dotp", "=",
RowBox[{"DotPlusLayer", "[",
RowBox[{"5", ",",
RowBox[{"\"\\"", "\[Rule]", "3"}]}], "]"}]}]], "Input",
CellID->75218466],
Cell[BoxData[
InterpretationBox[
RowBox[{
TagBox["DotPlusLayer",
"SummaryHead"], "[",
DynamicModuleBox[{Typeset`open$$ = False},
PanelBox[
PaneSelectorBox[{False->GridBox[{
{
PaneBox[
ButtonBox[
DynamicBox[FEPrivate`FrontEndResource[
"FEBitmaps", "SquarePlusIconMedium"],
ImageSizeCache->{12., {0., 12.}}],
Appearance->None,
ButtonFunction:>(Typeset`open$$ = True),
Evaluator->Automatic,
Method->"Preemptive"],
Alignment->{Center, Center},
ImageSize->
Dynamic[{
Automatic,
3.5 (CurrentValue["FontCapHeight"]/AbsoluteCurrentValue[
Magnification])}]],
TemplateBox[{GraphicsBox[{{
Opacity[0.3], {{
LineBox[
NCache[{{0, 0}, {
Rational[-1, 2], 1}}, {{0, 0}, {-0.5, 1}}]],
LineBox[
NCache[{{0, 0}, {
Rational[1, 2], 1}}, {{0, 0}, {0.5, 1}}]],
LineBox[
NCache[{{0, 0}, {
Rational[3, 2], 1}}, {{0, 0}, {1.5, 1}}]]}, {
LineBox[
NCache[{{1, 0}, {
Rational[-1, 2], 1}}, {{1, 0}, {-0.5, 1}}]],
LineBox[
NCache[{{1, 0}, {
Rational[1, 2], 1}}, {{1, 0}, {0.5, 1}}]],
LineBox[
NCache[{{1, 0}, {
Rational[3, 2], 1}}, {{1, 0}, {1.5, 1}}]]}}}, {
AbsolutePointSize[5],
PointBox[{{0, 0}, {1, 0}}],
PointBox[
NCache[{{
Rational[-1, 2], 1}, {
Rational[1, 2], 1}, {
Rational[3, 2], 1}}, {{-0.5, 1}, {0.5, 1}, {1.5, 1}}]]}},
ImageSize -> 32, BaseStyle -> GrayLevel[0.65]],StyleBox[
"\"uninitialized\"",
GrayLevel[0.5], FontSize -> 8, StripOnInput -> False]},
"Labeled",
DisplayFunction->(GridBox[{{
TagBox[
ItemBox[
PaneBox[
TagBox[#, "SkipImageSizeLevel"],
Alignment -> {Center, Baseline}, BaselinePosition ->
Baseline], DefaultBaseStyle -> "Labeled"],
"SkipImageSizeLevel"]}, {
ItemBox[#2, DefaultBaseStyle -> "LabeledLabel"]}},
GridBoxAlignment -> {
"Columns" -> {{Center}}, "Rows" -> {{Center}}}, AutoDelete ->
False, GridBoxItemSize -> {
"Columns" -> {{Automatic}}, "Rows" -> {{Automatic}}},
BaselinePosition -> {1, 1}]& ),
InterpretationFunction->(RowBox[{"Labeled", "[",
RowBox[{#, ",", #2}], "]"}]& )], GridBox[{
{
ItemBox[
StyleBox["\<\"Parameters:\"\>",
StripOnInput->False,
FontWeight->Bold],
StripOnInput->False],
ItemBox["\<\"\"\>",
StripOnInput->False]},
{
TagBox[
StyleBox[
TemplateBox[{"\"Size\"","\":\""},
"RowDefault"], "SummaryItemAnnotation",
StripOnInput->False],
"SummaryItem"],
TagBox[
StyleBox["5", "SummaryItem",
StripOnInput->False],
"SummaryItem"]}
},
AutoDelete->False,
BaseStyle->{
ShowStringCharacters -> False, NumberMarks -> False,
PrintPrecision -> 3, ShowSyntaxStyles -> False},
GridBoxAlignment->{"Columns" -> {{Left}}, "Rows" -> {{Automatic}}},
GridBoxItemSize->{
"Columns" -> {{Automatic}}, "Rows" -> {{Automatic}}},
GridBoxSpacings->{"Columns" -> {{2}}, "Rows" -> {{Automatic}}}]}
},
AutoDelete->False,
BaselinePosition->{1, 1},
GridBoxAlignment->{"Rows" -> {{Top}}},
GridBoxItemSize->{
"Columns" -> {{Automatic}}, "Rows" -> {{Automatic}}}], True->
GridBox[{
{
PaneBox[
ButtonBox[
DynamicBox[FEPrivate`FrontEndResource[
"FEBitmaps", "SquareMinusIconMedium"]],
Appearance->None,
ButtonFunction:>(Typeset`open$$ = False),
Evaluator->Automatic,
Method->"Preemptive"],
Alignment->{Center, Center},
ImageSize->
Dynamic[{
Automatic,
3.5 (CurrentValue["FontCapHeight"]/AbsoluteCurrentValue[
Magnification])}]],
TemplateBox[{GraphicsBox[{{
Opacity[0.3], {{
LineBox[
NCache[{{0, 0}, {
Rational[-1, 2], 1}}, {{0, 0}, {-0.5, 1}}]],
LineBox[
NCache[{{0, 0}, {
Rational[1, 2], 1}}, {{0, 0}, {0.5, 1}}]],
LineBox[
NCache[{{0, 0}, {
Rational[3, 2], 1}}, {{0, 0}, {1.5, 1}}]]}, {
LineBox[
NCache[{{1, 0}, {
Rational[-1, 2], 1}}, {{1, 0}, {-0.5, 1}}]],
LineBox[
NCache[{{1, 0}, {
Rational[1, 2], 1}}, {{1, 0}, {0.5, 1}}]],
LineBox[
NCache[{{1, 0}, {
Rational[3, 2], 1}}, {{1, 0}, {1.5, 1}}]]}}}, {
AbsolutePointSize[5],
PointBox[{{0, 0}, {1, 0}}],
PointBox[
NCache[{{
Rational[-1, 2], 1}, {
Rational[1, 2], 1}, {
Rational[3, 2], 1}}, {{-0.5, 1}, {0.5, 1}, {1.5, 1}}]]}},
ImageSize -> 32, BaseStyle -> GrayLevel[0.65]],StyleBox[
"\"uninitialized\"",
GrayLevel[0.5], FontSize -> 8, StripOnInput -> False]},
"Labeled",
DisplayFunction->(GridBox[{{
TagBox[
ItemBox[
PaneBox[
TagBox[#, "SkipImageSizeLevel"],
Alignment -> {Center, Baseline}, BaselinePosition ->
Baseline], DefaultBaseStyle -> "Labeled"],
"SkipImageSizeLevel"]}, {
ItemBox[#2, DefaultBaseStyle -> "LabeledLabel"]}},
GridBoxAlignment -> {
"Columns" -> {{Center}}, "Rows" -> {{Center}}}, AutoDelete ->
False, GridBoxItemSize -> {
"Columns" -> {{Automatic}}, "Rows" -> {{Automatic}}},
BaselinePosition -> {1, 1}]& ),
InterpretationFunction->(RowBox[{"Labeled", "[",
RowBox[{#, ",", #2}], "]"}]& )], GridBox[{
{
ItemBox[
StyleBox["\<\"Parameters:\"\>",
StripOnInput->False,
FontWeight->Bold],
StripOnInput->False],
ItemBox["\<\"\"\>",
StripOnInput->False]},
{
TagBox[
StyleBox[
TemplateBox[{"\"Size\"","\":\""},
"RowDefault"], "SummaryItemAnnotation",
StripOnInput->False],
"SummaryItem"],
TagBox[
StyleBox["5", "SummaryItem",
StripOnInput->False],
"SummaryItem"]},
{
ItemBox[
StyleBox["\<\"Arrays:\"\>",
StripOnInput->False,
FontWeight->Bold],
Frame->{{False, False}, {False, True}},
FrameStyle->GrayLevel[0.85],
StripOnInput->False],
ItemBox[
InterpretationBox[
StyleBox[
GraphicsBox[{},
BaselinePosition->(Scaled[0.] -> Baseline),
ImageSize->{1, 11}],
CacheGraphics->False],
Spacer[{1, 11}]],
Frame->{{False, False}, {False, True}},
FrameStyle->GrayLevel[0.85],
StripOnInput->False]},
{
TagBox[
StyleBox[
TemplateBox[{"\"Weights\"","\":\""},
"RowDefault"], "SummaryItemAnnotation",
StripOnInput->False],
"SummaryItem"],
TagBox[
StyleBox[
TemplateBox[{
"\"matrix\"","\" \"",
TemplateBox[{
"\"(\"", "\"\[VeryThinSpace]\"", "\"size\"", "\":\"",
"\" \"",
TemplateBox[{"\[Times]", "\"\[Times]\"", "\"5\"", "\"3\""},
"RowWithSeparators"], "\"\[VeryThinSpace]\"", "\")\""},
"Row", DisplayFunction -> (RowBox[{
TemplateSlotSequence[1, "\[InvisibleSpace]"]}]& ),
InterpretationFunction -> (RowBox[{"Row", "[",
RowBox[{
RowBox[{"{",
TemplateSlotSequence[1, ","], "}"}], ",",
RowBox[{"BaseStyle", "\[Rule]",
InterpretationBox[
ButtonBox[
TooltipBox[
GraphicsBox[{{
GrayLevel[0],
RectangleBox[{0, 0}]}, {
GrayLevel[0],
RectangleBox[{1, -1}]}, {
GrayLevel[0.5],
RectangleBox[{0, -1}, {2, 1}]}}, AspectRatio -> 1, Frame ->
True, FrameStyle -> GrayLevel[0.33333333333333337`],
FrameTicks -> None, PlotRangePadding -> None, ImageSize ->
Dynamic[{Automatic,
1.35 (CurrentValue["FontCapHeight"]/AbsoluteCurrentValue[
Magnification])}]], "GrayLevel[0.5]"], Appearance -> None,
BaseStyle -> {}, BaselinePosition -> Baseline,
DefaultBaseStyle -> {}, ButtonFunction :>
With[{Typeset`box$ = EvaluationBox[]},
If[
Not[
AbsoluteCurrentValue["Deployed"]],
SelectionMove[Typeset`box$, All, Expression];
FrontEnd`Private`$ColorSelectorInitialAlpha = 1;
FrontEnd`Private`$ColorSelectorInitialColor =
GrayLevel[0.5];
FrontEnd`Private`$ColorSelectorUseMakeBoxes = True;
MathLink`CallFrontEnd[
FrontEnd`AttachCell[Typeset`box$,
FrontEndResource["GrayLevelColorValueSelector"], {
0, {Left, Bottom}}, {Left, Top},
"ClosingActions" -> {
"SelectionDeparture", "ParentChanged",
"EvaluatorQuit"}]]]], BaseStyle -> Inherited, Evaluator ->
Automatic, Method -> "Preemptive"],
GrayLevel[0.5], Editable -> False, Selectable ->
False]}]}], "]"}]& ), BaseStyle -> GrayLevel[0.5]]},
"RowDefault"], "SummaryItem",
StripOnInput->False],
"SummaryItem"]},
{
TagBox[
StyleBox[
TemplateBox[{"\"Biases\"","\":\""},
"RowDefault"], "SummaryItemAnnotation",
StripOnInput->False],
"SummaryItem"],
TagBox[
StyleBox[
TemplateBox[{
"\"optional\"","\" \"",TemplateBox[{"\"vector\"", "\" \"",
TemplateBox[{
"\"(\"", "\"\[VeryThinSpace]\"", "\"size\"", "\":\"",
"\" \"",
TemplateBox[{"\[Times]", "\"\[Times]\"", "\"5\""},
"RowWithSeparators"], "\"\[VeryThinSpace]\"", "\")\""},
"Row", DisplayFunction -> (RowBox[{
TemplateSlotSequence[1, "\[InvisibleSpace]"]}]& ),
InterpretationFunction -> (RowBox[{"Row", "[",
RowBox[{
RowBox[{"{",
TemplateSlotSequence[1, ","], "}"}], ",",
RowBox[{"BaseStyle", "\[Rule]",
InterpretationBox[
ButtonBox[
TooltipBox[
GraphicsBox[{{
GrayLevel[0],
RectangleBox[{0, 0}]}, {
GrayLevel[0],
RectangleBox[{1, -1}]}, {
GrayLevel[0.5],
RectangleBox[{0, -1}, {2, 1}]}}, AspectRatio -> 1, Frame ->
True, FrameStyle -> GrayLevel[0.33333333333333337`],
FrameTicks -> None, PlotRangePadding -> None, ImageSize ->
Dynamic[{Automatic,
1.35 (CurrentValue["FontCapHeight"]/AbsoluteCurrentValue[
Magnification])}]], "GrayLevel[0.5]"], Appearance -> None,
BaseStyle -> {}, BaselinePosition -> Baseline,
DefaultBaseStyle -> {}, ButtonFunction :>
With[{Typeset`box$ = EvaluationBox[]},
If[
Not[
AbsoluteCurrentValue["Deployed"]],
SelectionMove[Typeset`box$, All, Expression];
FrontEnd`Private`$ColorSelectorInitialAlpha = 1;
FrontEnd`Private`$ColorSelectorInitialColor =
GrayLevel[0.5];
FrontEnd`Private`$ColorSelectorUseMakeBoxes = True;
MathLink`CallFrontEnd[
FrontEnd`AttachCell[Typeset`box$,
FrontEndResource["GrayLevelColorValueSelector"], {
0, {Left, Bottom}}, {Left, Top},
"ClosingActions" -> {
"SelectionDeparture", "ParentChanged",
"EvaluatorQuit"}]]]], BaseStyle -> Inherited, Evaluator ->
Automatic, Method -> "Preemptive"],
GrayLevel[0.5], Editable -> False, Selectable ->
False]}]}], "]"}]& ), BaseStyle -> GrayLevel[0.5]]},
"RowDefault"]},
"RowDefault"], "SummaryItem",
StripOnInput->False],
"SummaryItem"]},
{
ItemBox[
StyleBox["\<\"Ports:\"\>",
StripOnInput->False,
FontWeight->Bold],
Frame->{{False, False}, {False, True}},
FrameStyle->GrayLevel[0.85],
StripOnInput->False],
ItemBox[
InterpretationBox[
StyleBox[
GraphicsBox[{},
BaselinePosition->(Scaled[0.] -> Baseline),
ImageSize->{1, 11}],
CacheGraphics->False],
Spacer[{1, 11}]],
Frame->{{False, False}, {False, True}},
FrameStyle->GrayLevel[0.85],
StripOnInput->False]},
{
TagBox[
StyleBox[
TemplateBox[{"\"Input\"","\":\""},
"RowDefault"], "SummaryItemAnnotation",
StripOnInput->False],
"SummaryItem"],
TagBox[
StyleBox[
TemplateBox[{
"\"vector\"","\" \"",
TemplateBox[{
"\"(\"", "\"\[VeryThinSpace]\"", "\"size\"", "\":\"",
"\" \"",
TemplateBox[{"\[Times]", "\"\[Times]\"", "\"3\""},
"RowWithSeparators"], "\"\[VeryThinSpace]\"", "\")\""},
"Row", DisplayFunction -> (RowBox[{
TemplateSlotSequence[1, "\[InvisibleSpace]"]}]& ),
InterpretationFunction -> (RowBox[{"Row", "[",
RowBox[{
RowBox[{"{",
TemplateSlotSequence[1, ","], "}"}], ",",
RowBox[{"BaseStyle", "\[Rule]",
InterpretationBox[
ButtonBox[
TooltipBox[
GraphicsBox[{{
GrayLevel[0],
RectangleBox[{0, 0}]}, {
GrayLevel[0],
RectangleBox[{1, -1}]}, {
GrayLevel[0.5],
RectangleBox[{0, -1}, {2, 1}]}}, AspectRatio -> 1, Frame ->
True, FrameStyle -> GrayLevel[0.33333333333333337`],
FrameTicks -> None, PlotRangePadding -> None, ImageSize ->
Dynamic[{Automatic,
1.35 (CurrentValue["FontCapHeight"]/AbsoluteCurrentValue[
Magnification])}]], "GrayLevel[0.5]"], Appearance -> None,
BaseStyle -> {}, BaselinePosition -> Baseline,
DefaultBaseStyle -> {}, ButtonFunction :>
With[{Typeset`box$ = EvaluationBox[]},
If[
Not[
AbsoluteCurrentValue["Deployed"]],
SelectionMove[Typeset`box$, All, Expression];
FrontEnd`Private`$ColorSelectorInitialAlpha = 1;
FrontEnd`Private`$ColorSelectorInitialColor =
GrayLevel[0.5];
FrontEnd`Private`$ColorSelectorUseMakeBoxes = True;
MathLink`CallFrontEnd[
FrontEnd`AttachCell[Typeset`box$,
FrontEndResource["GrayLevelColorValueSelector"], {
0, {Left, Bottom}}, {Left, Top},
"ClosingActions" -> {
"SelectionDeparture", "ParentChanged",
"EvaluatorQuit"}]]]], BaseStyle -> Inherited, Evaluator ->
Automatic, Method -> "Preemptive"],
GrayLevel[0.5], Editable -> False, Selectable ->
False]}]}], "]"}]& ), BaseStyle -> GrayLevel[0.5]]},
"RowDefault"], "SummaryItem",
StripOnInput->False],
"SummaryItem"]},
{
TagBox[
StyleBox[
TemplateBox[{"\"Output\"","\":\""},
"RowDefault"], "SummaryItemAnnotation",
StripOnInput->False],
"SummaryItem"],
TagBox[
StyleBox[
TemplateBox[{
"\"vector\"","\" \"",
TemplateBox[{
"\"(\"", "\"\[VeryThinSpace]\"", "\"size\"", "\":\"",
"\" \"",
TemplateBox[{"\[Times]", "\"\[Times]\"", "\"5\""},
"RowWithSeparators"], "\"\[VeryThinSpace]\"", "\")\""},
"Row", DisplayFunction -> (RowBox[{
TemplateSlotSequence[1, "\[InvisibleSpace]"]}]& ),
InterpretationFunction -> (RowBox[{"Row", "[",
RowBox[{
RowBox[{"{",
TemplateSlotSequence[1, ","], "}"}], ",",
RowBox[{"BaseStyle", "\[Rule]",
InterpretationBox[
ButtonBox[
TooltipBox[
GraphicsBox[{{
GrayLevel[0],
RectangleBox[{0, 0}]}, {
GrayLevel[0],
RectangleBox[{1, -1}]}, {
GrayLevel[0.5],
RectangleBox[{0, -1}, {2, 1}]}}, AspectRatio -> 1, Frame ->
True, FrameStyle -> GrayLevel[0.33333333333333337`],
FrameTicks -> None, PlotRangePadding -> None, ImageSize ->
Dynamic[{Automatic,
1.35 (CurrentValue["FontCapHeight"]/AbsoluteCurrentValue[
Magnification])}]], "GrayLevel[0.5]"], Appearance -> None,
BaseStyle -> {}, BaselinePosition -> Baseline,
DefaultBaseStyle -> {}, ButtonFunction :>
With[{Typeset`box$ = EvaluationBox[]},
If[
Not[
AbsoluteCurrentValue["Deployed"]],
SelectionMove[Typeset`box$, All, Expression];
FrontEnd`Private`$ColorSelectorInitialAlpha = 1;
FrontEnd`Private`$ColorSelectorInitialColor =
GrayLevel[0.5];
FrontEnd`Private`$ColorSelectorUseMakeBoxes = True;
MathLink`CallFrontEnd[
FrontEnd`AttachCell[Typeset`box$,
FrontEndResource["GrayLevelColorValueSelector"], {
0, {Left, Bottom}}, {Left, Top},
"ClosingActions" -> {
"SelectionDeparture", "ParentChanged",
"EvaluatorQuit"}]]]], BaseStyle -> Inherited, Evaluator ->
Automatic, Method -> "Preemptive"],
GrayLevel[0.5], Editable -> False, Selectable ->
False]}]}], "]"}]& ), BaseStyle -> GrayLevel[0.5]]},
"RowDefault"], "SummaryItem",
StripOnInput->False],
"SummaryItem"]}
},
AutoDelete->False,
BaseStyle->{
ShowStringCharacters -> False, NumberMarks -> False,
PrintPrecision -> 3, ShowSyntaxStyles -> False},
GridBoxAlignment->{"Columns" -> {{Left}}, "Rows" -> {{Automatic}}},
GridBoxItemSize->{
"Columns" -> {{Automatic}}, "Rows" -> {{Automatic}}},
GridBoxSpacings->{"Columns" -> {{2}}, "Rows" -> {{Automatic}}}]}
},
AutoDelete->False,
BaselinePosition->{1, 1},
GridBoxAlignment->{"Rows" -> {{Top}}},
GridBoxItemSize->{
"Columns" -> {{Automatic}}, "Rows" -> {{Automatic}}}]}, Dynamic[
Typeset`open$$],
ImageSize->Automatic],
BaselinePosition->Baseline],
DynamicModuleValues:>{}], "]"}],
None,
Editable->False,
SelectWithContents->True,
Selectable->False]], "Output",
ImageSize->{275, 53},
ImageMargins->{{0, 0}, {0, 0}},
ImageRegion->{{0, 1}, {0, 1}},
CellID->719206200]
}, Open ]],
Cell[CellGroupData[{
Cell[BoxData[
RowBox[{"dotp", "=",
RowBox[{"NetInitialize", "[", "dotp", "]"}]}]], "Input",
CellID->1550991696],
Cell[BoxData[
TagBox[
TemplateBox[{RowBox[{
StyleBox[
TagBox["DotPlusLayer", "SummaryHead"], "NonInterpretableSummary"],
StyleBox["[", "NonInterpretableSummary"],
DynamicModuleBox[{Typeset`open$$ = False},
PanelBox[
PaneSelectorBox[{False -> GridBox[{{
PaneBox[
ButtonBox[
DynamicBox[
FEPrivate`FrontEndResource[
"FEBitmaps", "SquarePlusIconMedium"]],
ButtonFunction :> (Typeset`open$$ = True), Appearance -> None,
Evaluator -> Automatic, Method -> "Preemptive"],
Alignment -> {Center, Center}, ImageSize ->
Dynamic[{
Automatic,
3.5 (CurrentValue["FontCapHeight"]/AbsoluteCurrentValue[
Magnification])}]],
GraphicsBox[{{
Opacity[0.3], {{
LineBox[
NCache[{{0, 0}, {
Rational[-1, 2], 1}}, {{0, 0}, {-0.5, 1}}]],
LineBox[
NCache[{{0, 0}, {
Rational[1, 2], 1}}, {{0, 0}, {0.5, 1}}]],
LineBox[
NCache[{{0, 0}, {
Rational[3, 2], 1}}, {{0, 0}, {1.5, 1}}]]}, {
LineBox[
NCache[{{1, 0}, {
Rational[-1, 2], 1}}, {{1, 0}, {-0.5, 1}}]],
LineBox[
NCache[{{1, 0}, {
Rational[1, 2], 1}}, {{1, 0}, {0.5, 1}}]],
LineBox[
NCache[{{1, 0}, {
Rational[3, 2], 1}}, {{1, 0}, {1.5, 1}}]]}}}, {
AbsolutePointSize[5],
PointBox[{{0, 0}, {1, 0}}],
PointBox[
NCache[{{
Rational[-1, 2], 1}, {
Rational[1, 2], 1}, {
Rational[3, 2], 1}}, {{-0.5, 1}, {0.5, 1}, {1.5, 1}}]]}},
ImageSize -> 32],
GridBox[{{
ItemBox[
StyleBox["\"Parameters:\"", Bold, StripOnInput -> False],
StripOnInput -> False],
ItemBox["\"\"", StripOnInput -> False]}, {
TagBox[
StyleBox[
TemplateBox[{"\"Size\"", "\":\""}, "RowDefault"],
"SummaryItemAnnotation", StripOnInput -> False],
"SummaryItem"],
TagBox[
StyleBox["5", "SummaryItem", StripOnInput -> False],
"SummaryItem"]}},
GridBoxAlignment -> {
"Columns" -> {{Left}}, "Rows" -> {{Automatic}}}, AutoDelete ->
False, GridBoxItemSize -> {
"Columns" -> {{Automatic}}, "Rows" -> {{Automatic}}},
GridBoxSpacings -> {
"Columns" -> {{2}}, "Rows" -> {{Automatic}}},
BaseStyle -> {
ShowStringCharacters -> False, NumberMarks -> False,
PrintPrecision -> 3, ShowSyntaxStyles -> False}]}},
GridBoxAlignment -> {"Rows" -> {{Top}}}, AutoDelete -> False,
GridBoxItemSize -> {
"Columns" -> {{Automatic}}, "Rows" -> {{Automatic}}},
BaselinePosition -> {1, 1}], True -> GridBox[{{
PaneBox[
ButtonBox[
DynamicBox[
FEPrivate`FrontEndResource[
"FEBitmaps", "SquareMinusIconMedium"]],
ButtonFunction :> (Typeset`open$$ = False), Appearance ->
None, Evaluator -> Automatic, Method -> "Preemptive"],
Alignment -> {Center, Center}, ImageSize ->
Dynamic[{
Automatic,
3.5 (CurrentValue["FontCapHeight"]/AbsoluteCurrentValue[
Magnification])}]],
GraphicsBox[{{
Opacity[0.3], {{
LineBox[
NCache[{{0, 0}, {
Rational[-1, 2], 1}}, {{0, 0}, {-0.5, 1}}]],
LineBox[
NCache[{{0, 0}, {
Rational[1, 2], 1}}, {{0, 0}, {0.5, 1}}]],
LineBox[
NCache[{{0, 0}, {
Rational[3, 2], 1}}, {{0, 0}, {1.5, 1}}]]}, {
LineBox[
NCache[{{1, 0}, {
Rational[-1, 2], 1}}, {{1, 0}, {-0.5, 1}}]],
LineBox[
NCache[{{1, 0}, {
Rational[1, 2], 1}}, {{1, 0}, {0.5, 1}}]],
LineBox[
NCache[{{1, 0}, {
Rational[3, 2], 1}}, {{1, 0}, {1.5, 1}}]]}}}, {
AbsolutePointSize[5],
PointBox[{{0, 0}, {1, 0}}],
PointBox[
NCache[{{
Rational[-1, 2], 1}, {
Rational[1, 2], 1}, {
Rational[3, 2], 1}}, {{-0.5, 1}, {0.5, 1}, {1.5, 1}}]]}},
ImageSize -> 32],
GridBox[{{
ItemBox[
StyleBox["\"Parameters:\"", Bold, StripOnInput -> False],
StripOnInput -> False],
ItemBox["\"\"", StripOnInput -> False]}, {
TagBox[
StyleBox[
TemplateBox[{"\"Size\"", "\":\""}, "RowDefault"],
"SummaryItemAnnotation", StripOnInput -> False],
"SummaryItem"],
TagBox[
StyleBox["5", "SummaryItem", StripOnInput -> False],
"SummaryItem"]}, {
ItemBox[
StyleBox["\"Arrays:\"", Bold, StripOnInput -> False],
Frame -> {{False, False}, {False, True}}, FrameStyle ->
GrayLevel[0.85], StripOnInput -> False],
ItemBox[
InterpretationBox[
StyleBox[
GraphicsBox[{}, ImageSize -> {1, 11},
BaselinePosition -> (Scaled[0.] -> Baseline)],
"CacheGraphics" -> False],
Spacer[{1, 11}]], Frame -> {{False, False}, {False, True}},
FrameStyle -> GrayLevel[0.85], StripOnInput -> False]}, {
TagBox[
StyleBox[
TemplateBox[{"\"Weights\"", "\":\""}, "RowDefault"],
"SummaryItemAnnotation", StripOnInput -> False],
"SummaryItem"],
TagBox[
StyleBox[
TemplateBox[{"\"matrix\"", "\" \"",
TemplateBox[{
"\"(\"", "\"\[VeryThinSpace]\"", "\"size\"", "\":\"",
"\" \"",
TemplateBox[{
"\[Times]", "\"\[Times]\"", "\"5\"", "\"3\""},
"RowWithSeparators"], "\"\[VeryThinSpace]\"", "\")\""},
"Row", DisplayFunction -> (RowBox[{
TemplateSlotSequence[1, "\[InvisibleSpace]"]}]& ),
InterpretationFunction -> (RowBox[{"Row", "[",
RowBox[{
RowBox[{"{",
TemplateSlotSequence[1, ","], "}"}], ",",
RowBox[{"BaseStyle", "\[Rule]",
InterpretationBox[
ButtonBox[
TooltipBox[
GraphicsBox[{{
GrayLevel[0],
RectangleBox[{0, 0}]}, {
GrayLevel[0],
RectangleBox[{1, -1}]}, {
GrayLevel[0.5],
RectangleBox[{0, -1}, {2, 1}]}}, AspectRatio -> 1, Frame ->
True, FrameStyle -> GrayLevel[0.33333333333333337`],
FrameTicks -> None, PlotRangePadding -> None, ImageSize ->
Dynamic[{Automatic,
1.35 (CurrentValue["FontCapHeight"]/AbsoluteCurrentValue[
Magnification])}]], "GrayLevel[0.5]"], Appearance -> None,
BaseStyle -> {}, BaselinePosition -> Baseline,
DefaultBaseStyle -> {}, ButtonFunction :>
With[{Typeset`box$ = EvaluationBox[]},
If[
Not[
AbsoluteCurrentValue["Deployed"]],
SelectionMove[Typeset`box$, All, Expression];
FrontEnd`Private`$ColorSelectorInitialAlpha = 1;
FrontEnd`Private`$ColorSelectorInitialColor =
GrayLevel[0.5];
FrontEnd`Private`$ColorSelectorUseMakeBoxes = True;
MathLink`CallFrontEnd[
FrontEnd`AttachCell[Typeset`box$,
FrontEndResource["GrayLevelColorValueSelector"], {
0, {Left, Bottom}}, {Left, Top},
"ClosingActions" -> {
"SelectionDeparture", "ParentChanged",
"EvaluatorQuit"}]]]], BaseStyle -> Inherited, Evaluator ->
Automatic, Method -> "Preemptive"],
GrayLevel[0.5], Editable -> False, Selectable ->
False]}]}], "]"}]& ), BaseStyle -> GrayLevel[0.5]]},
"RowDefault"], "SummaryItem", StripOnInput -> False],
"SummaryItem"]}, {
TagBox[
StyleBox[
TemplateBox[{"\"Biases\"", "\":\""}, "RowDefault"],
"SummaryItemAnnotation", StripOnInput -> False],
"SummaryItem"],
TagBox[
StyleBox[
TemplateBox[{"\"vector\"", "\" \"",
TemplateBox[{
"\"(\"", "\"\[VeryThinSpace]\"", "\"size\"", "\":\"",
"\" \"",
TemplateBox[{"\[Times]", "\"\[Times]\"", "\"5\""},
"RowWithSeparators"], "\"\[VeryThinSpace]\"", "\")\""},
"Row", DisplayFunction -> (RowBox[{
TemplateSlotSequence[1, "\[InvisibleSpace]"]}]& ),
InterpretationFunction -> (RowBox[{"Row", "[",
RowBox[{
RowBox[{"{",
TemplateSlotSequence[1, ","], "}"}], ",",
RowBox[{"BaseStyle", "\[Rule]",
InterpretationBox[
ButtonBox[
TooltipBox[
GraphicsBox[{{
GrayLevel[0],
RectangleBox[{0, 0}]}, {
GrayLevel[0],
RectangleBox[{1, -1}]}, {
GrayLevel[0.5],
RectangleBox[{0, -1}, {2, 1}]}}, AspectRatio -> 1, Frame ->
True, FrameStyle -> GrayLevel[0.33333333333333337`],
FrameTicks -> None, PlotRangePadding -> None, ImageSize ->
Dynamic[{Automatic,
1.35 (CurrentValue["FontCapHeight"]/AbsoluteCurrentValue[
Magnification])}]], "GrayLevel[0.5]"], Appearance -> None,
BaseStyle -> {}, BaselinePosition -> Baseline,
DefaultBaseStyle -> {}, ButtonFunction :>
With[{Typeset`box$ = EvaluationBox[]},
If[
Not[
AbsoluteCurrentValue["Deployed"]],
SelectionMove[Typeset`box$, All, Expression];
FrontEnd`Private`$ColorSelectorInitialAlpha = 1;
FrontEnd`Private`$ColorSelectorInitialColor =
GrayLevel[0.5];
FrontEnd`Private`$ColorSelectorUseMakeBoxes = True;
MathLink`CallFrontEnd[
FrontEnd`AttachCell[Typeset`box$,
FrontEndResource["GrayLevelColorValueSelector"], {
0, {Left, Bottom}}, {Left, Top},
"ClosingActions" -> {
"SelectionDeparture", "ParentChanged",
"EvaluatorQuit"}]]]], BaseStyle -> Inherited, Evaluator ->
Automatic, Method -> "Preemptive"],
GrayLevel[0.5], Editable -> False, Selectable ->
False]}]}], "]"}]& ), BaseStyle -> GrayLevel[0.5]]},
"RowDefault"], "SummaryItem", StripOnInput -> False],
"SummaryItem"]}, {
ItemBox[
StyleBox["\"Ports:\"", Bold, StripOnInput -> False],
Frame -> {{False, False}, {False, True}}, FrameStyle ->
GrayLevel[0.85], StripOnInput -> False],
ItemBox[
InterpretationBox[
StyleBox[
GraphicsBox[{}, ImageSize -> {1, 11},
BaselinePosition -> (Scaled[0.] -> Baseline)],
"CacheGraphics" -> False],
Spacer[{1, 11}]], Frame -> {{False, False}, {False, True}},
FrameStyle -> GrayLevel[0.85], StripOnInput -> False]}, {
TagBox[
StyleBox[
TemplateBox[{"\"Input\"", "\":\""}, "RowDefault"],
"SummaryItemAnnotation", StripOnInput -> False],
"SummaryItem"],
TagBox[
StyleBox[
TemplateBox[{"\"vector\"", "\" \"",
TemplateBox[{
"\"(\"", "\"\[VeryThinSpace]\"", "\"size\"", "\":\"",
"\" \"",
TemplateBox[{"\[Times]", "\"\[Times]\"", "\"3\""},
"RowWithSeparators"], "\"\[VeryThinSpace]\"", "\")\""},
"Row", DisplayFunction -> (RowBox[{
TemplateSlotSequence[1, "\[InvisibleSpace]"]}]& ),
InterpretationFunction -> (RowBox[{"Row", "[",
RowBox[{
RowBox[{"{",
TemplateSlotSequence[1, ","], "}"}], ",",
RowBox[{"BaseStyle", "\[Rule]",
InterpretationBox[
ButtonBox[
TooltipBox[
GraphicsBox[{{
GrayLevel[0],
RectangleBox[{0, 0}]}, {
GrayLevel[0],
RectangleBox[{1, -1}]}, {
GrayLevel[0.5],
RectangleBox[{0, -1}, {2, 1}]}}, AspectRatio -> 1, Frame ->
True, FrameStyle -> GrayLevel[0.33333333333333337`],
FrameTicks -> None, PlotRangePadding -> None, ImageSize ->
Dynamic[{Automatic,
1.35 (CurrentValue["FontCapHeight"]/AbsoluteCurrentValue[
Magnification])}]], "GrayLevel[0.5]"], Appearance -> None,
BaseStyle -> {}, BaselinePosition -> Baseline,
DefaultBaseStyle -> {}, ButtonFunction :>
With[{Typeset`box$ = EvaluationBox[]},
If[
Not[
AbsoluteCurrentValue["Deployed"]],
SelectionMove[Typeset`box$, All, Expression];
FrontEnd`Private`$ColorSelectorInitialAlpha = 1;
FrontEnd`Private`$ColorSelectorInitialColor =
GrayLevel[0.5];
FrontEnd`Private`$ColorSelectorUseMakeBoxes = True;
MathLink`CallFrontEnd[
FrontEnd`AttachCell[Typeset`box$,
FrontEndResource["GrayLevelColorValueSelector"], {
0, {Left, Bottom}}, {Left, Top},
"ClosingActions" -> {
"SelectionDeparture", "ParentChanged",
"EvaluatorQuit"}]]]], BaseStyle -> Inherited, Evaluator ->
Automatic, Method -> "Preemptive"],
GrayLevel[0.5], Editable -> False, Selectable ->
False]}]}], "]"}]& ), BaseStyle -> GrayLevel[0.5]]},
"RowDefault"], "SummaryItem", StripOnInput -> False],
"SummaryItem"]}, {
TagBox[
StyleBox[
TemplateBox[{"\"Output\"", "\":\""}, "RowDefault"],
"SummaryItemAnnotation", StripOnInput -> False],
"SummaryItem"],
TagBox[
StyleBox[
TemplateBox[{"\"vector\"", "\" \"",
TemplateBox[{
"\"(\"", "\"\[VeryThinSpace]\"", "\"size\"", "\":\"",
"\" \"",
TemplateBox[{"\[Times]", "\"\[Times]\"", "\"5\""},
"RowWithSeparators"], "\"\[VeryThinSpace]\"", "\")\""},
"Row", DisplayFunction -> (RowBox[{
TemplateSlotSequence[1, "\[InvisibleSpace]"]}]& ),
InterpretationFunction -> (RowBox[{"Row", "[",
RowBox[{
RowBox[{"{",
TemplateSlotSequence[1, ","], "}"}], ",",
RowBox[{"BaseStyle", "\[Rule]",
InterpretationBox[
ButtonBox[
TooltipBox[
GraphicsBox[{{
GrayLevel[0],
RectangleBox[{0, 0}]}, {
GrayLevel[0],
RectangleBox[{1, -1}]}, {
GrayLevel[0.5],
RectangleBox[{0, -1}, {2, 1}]}}, AspectRatio -> 1, Frame ->
True, FrameStyle -> GrayLevel[0.33333333333333337`],
FrameTicks -> None, PlotRangePadding -> None, ImageSize ->
Dynamic[{Automatic,
1.35 (CurrentValue["FontCapHeight"]/AbsoluteCurrentValue[
Magnification])}]], "GrayLevel[0.5]"], Appearance -> None,
BaseStyle -> {}, BaselinePosition -> Baseline,
DefaultBaseStyle -> {}, ButtonFunction :>
With[{Typeset`box$ = EvaluationBox[]},
If[
Not[
AbsoluteCurrentValue["Deployed"]],
SelectionMove[Typeset`box$, All, Expression];
FrontEnd`Private`$ColorSelectorInitialAlpha = 1;
FrontEnd`Private`$ColorSelectorInitialColor =
GrayLevel[0.5];
FrontEnd`Private`$ColorSelectorUseMakeBoxes = True;
MathLink`CallFrontEnd[
FrontEnd`AttachCell[Typeset`box$,
FrontEndResource["GrayLevelColorValueSelector"], {
0, {Left, Bottom}}, {Left, Top},
"ClosingActions" -> {
"SelectionDeparture", "ParentChanged",
"EvaluatorQuit"}]]]], BaseStyle -> Inherited, Evaluator ->
Automatic, Method -> "Preemptive"],
GrayLevel[0.5], Editable -> False, Selectable ->
False]}]}], "]"}]& ), BaseStyle -> GrayLevel[0.5]]},
"RowDefault"], "SummaryItem", StripOnInput -> False],
"SummaryItem"]}},
GridBoxAlignment -> {
"Columns" -> {{Left}}, "Rows" -> {{Automatic}}}, AutoDelete ->
False, GridBoxItemSize -> {
"Columns" -> {{Automatic}}, "Rows" -> {{Automatic}}},
GridBoxSpacings -> {
"Columns" -> {{2}}, "Rows" -> {{Automatic}}},
BaseStyle -> {
ShowStringCharacters -> False, NumberMarks -> False,
PrintPrecision -> 3, ShowSyntaxStyles -> False}]}},
GridBoxAlignment -> {"Rows" -> {{Top}}}, AutoDelete -> False,
GridBoxItemSize -> {
"Columns" -> {{Automatic}}, "Rows" -> {{Automatic}}},
BaselinePosition -> {1, 1}]},
Dynamic[Typeset`open$$], ImageSize -> Automatic], BaselinePosition ->
Baseline], DynamicModuleValues :> {}],
StyleBox["]", "NonInterpretableSummary"]}]},
"CopyTag",
DisplayFunction->(#& ),
InterpretationFunction->("None"& )],
False,
Editable->False,
SelectWithContents->True,
Selectable->False]], "Output",
ImageSize->{265, 47},
ImageMargins->{{0, 0}, {0, 0}},
ImageRegion->{{0, 1}, {0, 1}},
CellID->1646801376]
}, Open ]],
Cell[CellGroupData[{
Cell[BoxData[
RowBox[{"dotp", "[",
RowBox[{"{",
RowBox[{"0.", ",", "0.2", ",", ".1"}], "}"}], "]"}]], "Input",
CellID->499143241],
Cell[BoxData[
RowBox[{"{",
RowBox[{
RowBox[{"-", "0.1284037083387375`"}], ",",
RowBox[{"-", "0.03149155154824257`"}], ",",
RowBox[{"-", "0.21318522095680237`"}], ",", "0.08010490238666534`", ",",
RowBox[{"-", "0.09068252146244049`"}]}], "}"}]], "Output",
ImageSize->{405, 16},
ImageMargins->{{0, 0}, {0, 0}},
ImageRegion->{{0, 1}, {0, 1}},
CellID->1095565954]
}, Open ]],
Cell[BoxData[
RowBox[{
RowBox[{"dotPlus", "[",
RowBox[{"data_", ",", " ", "weight_", ",", "bias_"}], "]"}], ":=",
RowBox[{
RowBox[{"Dot", "[",
RowBox[{"weight", ",", "data"}], "]"}], "+", "bias"}]}]], "Input",
CellID->1703099260],
Cell[CellGroupData[{
Cell[BoxData[{
RowBox[{
RowBox[{"data", "=",
RowBox[{"{",
RowBox[{"2", ",", "10", ",", "3"}], "}"}]}], ";"}], "\[IndentingNewLine]",
RowBox[{"dotp", "=",
RowBox[{"NetInitialize", "@",
RowBox[{"DotPlusLayer", "[",
RowBox[{"2", ",",
RowBox[{"\"\\"", "\[Rule]", " ", "3"}]}],
"]"}]}]}], "\[IndentingNewLine]",
RowBox[{"dotp", "[", "data", "]"}]}], "Input",
CellID->809591688],
Cell[BoxData[
TagBox[
TemplateBox[{RowBox[{
StyleBox[
TagBox["DotPlusLayer", "SummaryHead"], "NonInterpretableSummary"],
StyleBox["[", "NonInterpretableSummary"],
DynamicModuleBox[{Typeset`open$$ = False},
PanelBox[
PaneSelectorBox[{False -> GridBox[{{
PaneBox[
ButtonBox[
DynamicBox[
FEPrivate`FrontEndResource[
"FEBitmaps", "SquarePlusIconMedium"]],
ButtonFunction :> (Typeset`open$$ = True), Appearance -> None,
Evaluator -> Automatic, Method -> "Preemptive"],
Alignment -> {Center, Center}, ImageSize ->
Dynamic[{
Automatic,
3.5 (CurrentValue["FontCapHeight"]/AbsoluteCurrentValue[
Magnification])}]],
GraphicsBox[{{
Opacity[0.3], {{
LineBox[
NCache[{{0, 0}, {
Rational[-1, 2], 1}}, {{0, 0}, {-0.5, 1}}]],
LineBox[
NCache[{{0, 0}, {
Rational[1, 2], 1}}, {{0, 0}, {0.5, 1}}]],
LineBox[
NCache[{{0, 0}, {
Rational[3, 2], 1}}, {{0, 0}, {1.5, 1}}]]}, {
LineBox[
NCache[{{1, 0}, {
Rational[-1, 2], 1}}, {{1, 0}, {-0.5, 1}}]],
LineBox[
NCache[{{1, 0}, {
Rational[1, 2], 1}}, {{1, 0}, {0.5, 1}}]],
LineBox[
NCache[{{1, 0}, {
Rational[3, 2], 1}}, {{1, 0}, {1.5, 1}}]]}}}, {
AbsolutePointSize[5],
PointBox[{{0, 0}, {1, 0}}],
PointBox[
NCache[{{
Rational[-1, 2], 1}, {
Rational[1, 2], 1}, {
Rational[3, 2], 1}}, {{-0.5, 1}, {0.5, 1}, {1.5, 1}}]]}},
ImageSize -> 32],
GridBox[{{
ItemBox[
StyleBox["\"Parameters:\"", Bold, StripOnInput -> False],
StripOnInput -> False],
ItemBox["\"\"", StripOnInput -> False]}, {
TagBox[
StyleBox[
TemplateBox[{"\"Size\"", "\":\""}, "RowDefault"],
"SummaryItemAnnotation", StripOnInput -> False],
"SummaryItem"],
TagBox[
StyleBox["2", "SummaryItem", StripOnInput -> False],
"SummaryItem"]}},
GridBoxAlignment -> {
"Columns" -> {{Left}}, "Rows" -> {{Automatic}}}, AutoDelete ->
False, GridBoxItemSize -> {
"Columns" -> {{Automatic}}, "Rows" -> {{Automatic}}},
GridBoxSpacings -> {
"Columns" -> {{2}}, "Rows" -> {{Automatic}}},
BaseStyle -> {
ShowStringCharacters -> False, NumberMarks -> False,
PrintPrecision -> 3, ShowSyntaxStyles -> False}]}},
GridBoxAlignment -> {"Rows" -> {{Top}}}, AutoDelete -> False,
GridBoxItemSize -> {
"Columns" -> {{Automatic}}, "Rows" -> {{Automatic}}},
BaselinePosition -> {1, 1}], True -> GridBox[{{
PaneBox[
ButtonBox[
DynamicBox[
FEPrivate`FrontEndResource[
"FEBitmaps", "SquareMinusIconMedium"]],
ButtonFunction :> (Typeset`open$$ = False), Appearance ->
None, Evaluator -> Automatic, Method -> "Preemptive"],
Alignment -> {Center, Center}, ImageSize ->
Dynamic[{
Automatic,
3.5 (CurrentValue["FontCapHeight"]/AbsoluteCurrentValue[
Magnification])}]],
GraphicsBox[{{
Opacity[0.3], {{
LineBox[
NCache[{{0, 0}, {
Rational[-1, 2], 1}}, {{0, 0}, {-0.5, 1}}]],
LineBox[
NCache[{{0, 0}, {
Rational[1, 2], 1}}, {{0, 0}, {0.5, 1}}]],
LineBox[
NCache[{{0, 0}, {
Rational[3, 2], 1}}, {{0, 0}, {1.5, 1}}]]}, {
LineBox[
NCache[{{1, 0}, {
Rational[-1, 2], 1}}, {{1, 0}, {-0.5, 1}}]],
LineBox[
NCache[{{1, 0}, {
Rational[1, 2], 1}}, {{1, 0}, {0.5, 1}}]],
LineBox[
NCache[{{1, 0}, {
Rational[3, 2], 1}}, {{1, 0}, {1.5, 1}}]]}}}, {
AbsolutePointSize[5],
PointBox[{{0, 0}, {1, 0}}],
PointBox[
NCache[{{
Rational[-1, 2], 1}, {
Rational[1, 2], 1}, {
Rational[3, 2], 1}}, {{-0.5, 1}, {0.5, 1}, {1.5, 1}}]]}},
ImageSize -> 32],
GridBox[{{
ItemBox[
StyleBox["\"Parameters:\"", Bold, StripOnInput -> False],
StripOnInput -> False],
ItemBox["\"\"", StripOnInput -> False]}, {
TagBox[
StyleBox[
TemplateBox[{"\"Size\"", "\":\""}, "RowDefault"],
"SummaryItemAnnotation", StripOnInput -> False],
"SummaryItem"],
TagBox[
StyleBox["2", "SummaryItem", StripOnInput -> False],
"SummaryItem"]}, {
ItemBox[
StyleBox["\"Arrays:\"", Bold, StripOnInput -> False],
Frame -> {{False, False}, {False, True}}, FrameStyle ->
GrayLevel[0.85], StripOnInput -> False],
ItemBox[
InterpretationBox[
StyleBox[
GraphicsBox[{}, ImageSize -> {1, 11},
BaselinePosition -> (Scaled[0.] -> Baseline)],
"CacheGraphics" -> False],
Spacer[{1, 11}]], Frame -> {{False, False}, {False, True}},
FrameStyle -> GrayLevel[0.85], StripOnInput -> False]}, {
TagBox[
StyleBox[
TemplateBox[{"\"Weights\"", "\":\""}, "RowDefault"],
"SummaryItemAnnotation", StripOnInput -> False],
"SummaryItem"],
TagBox[
StyleBox[
TemplateBox[{"\"matrix\"", "\" \"",
TemplateBox[{
"\"(\"", "\"\[VeryThinSpace]\"", "\"size\"", "\":\"",
"\" \"",
TemplateBox[{
"\[Times]", "\"\[Times]\"", "\"2\"", "\"3\""},
"RowWithSeparators"], "\"\[VeryThinSpace]\"", "\")\""},
"Row", DisplayFunction -> (RowBox[{
TemplateSlotSequence[1, "\[InvisibleSpace]"]}]& ),
InterpretationFunction -> (RowBox[{"Row", "[",
RowBox[{
RowBox[{"{",
TemplateSlotSequence[1, ","], "}"}], ",",
RowBox[{"BaseStyle", "\[Rule]",
InterpretationBox[
ButtonBox[
TooltipBox[
GraphicsBox[{{
GrayLevel[0],
RectangleBox[{0, 0}]}, {
GrayLevel[0],
RectangleBox[{1, -1}]}, {
GrayLevel[0.5],
RectangleBox[{0, -1}, {2, 1}]}}, AspectRatio -> 1, Frame ->
True, FrameStyle -> GrayLevel[0.33333333333333337`],
FrameTicks -> None, PlotRangePadding -> None, ImageSize ->
Dynamic[{Automatic,
1.35 (CurrentValue["FontCapHeight"]/AbsoluteCurrentValue[
Magnification])}]], "GrayLevel[0.5]"], Appearance -> None,
BaseStyle -> {}, BaselinePosition -> Baseline,
DefaultBaseStyle -> {}, ButtonFunction :>
With[{Typeset`box$ = EvaluationBox[]},
If[
Not[
AbsoluteCurrentValue["Deployed"]],
SelectionMove[Typeset`box$, All, Expression];
FrontEnd`Private`$ColorSelectorInitialAlpha = 1;
FrontEnd`Private`$ColorSelectorInitialColor =
GrayLevel[0.5];
FrontEnd`Private`$ColorSelectorUseMakeBoxes = True;
MathLink`CallFrontEnd[
FrontEnd`AttachCell[Typeset`box$,
FrontEndResource["GrayLevelColorValueSelector"], {
0, {Left, Bottom}}, {Left, Top},
"ClosingActions" -> {
"SelectionDeparture", "ParentChanged",
"EvaluatorQuit"}]]]], BaseStyle -> Inherited, Evaluator ->
Automatic, Method -> "Preemptive"],
GrayLevel[0.5], Editable -> False, Selectable ->
False]}]}], "]"}]& ), BaseStyle -> GrayLevel[0.5]]},
"RowDefault"], "SummaryItem", StripOnInput -> False],
"SummaryItem"]}, {
TagBox[
StyleBox[
TemplateBox[{"\"Biases\"", "\":\""}, "RowDefault"],
"SummaryItemAnnotation", StripOnInput -> False],
"SummaryItem"],
TagBox[
StyleBox[
TemplateBox[{"\"vector\"", "\" \"",
TemplateBox[{
"\"(\"", "\"\[VeryThinSpace]\"", "\"size\"", "\":\"",
"\" \"",
TemplateBox[{"\[Times]", "\"\[Times]\"", "\"2\""},
"RowWithSeparators"], "\"\[VeryThinSpace]\"", "\")\""},
"Row", DisplayFunction -> (RowBox[{
TemplateSlotSequence[1, "\[InvisibleSpace]"]}]& ),
InterpretationFunction -> (RowBox[{"Row", "[",
RowBox[{
RowBox[{"{",
TemplateSlotSequence[1, ","], "}"}], ",",
RowBox[{"BaseStyle", "\[Rule]",
InterpretationBox[
ButtonBox[
TooltipBox[
GraphicsBox[{{
GrayLevel[0],
RectangleBox[{0, 0}]}, {
GrayLevel[0],
RectangleBox[{1, -1}]}, {
GrayLevel[0.5],
RectangleBox[{0, -1}, {2, 1}]}}, AspectRatio -> 1, Frame ->
True, FrameStyle -> GrayLevel[0.33333333333333337`],
FrameTicks -> None, PlotRangePadding -> None, ImageSize ->
Dynamic[{Automatic,
1.35 (CurrentValue["FontCapHeight"]/AbsoluteCurrentValue[
Magnification])}]], "GrayLevel[0.5]"], Appearance -> None,
BaseStyle -> {}, BaselinePosition -> Baseline,
DefaultBaseStyle -> {}, ButtonFunction :>
With[{Typeset`box$ = EvaluationBox[]},
If[
Not[
AbsoluteCurrentValue["Deployed"]],
SelectionMove[Typeset`box$, All, Expression];
FrontEnd`Private`$ColorSelectorInitialAlpha = 1;
FrontEnd`Private`$ColorSelectorInitialColor =
GrayLevel[0.5];
FrontEnd`Private`$ColorSelectorUseMakeBoxes = True;
MathLink`CallFrontEnd[
FrontEnd`AttachCell[Typeset`box$,
FrontEndResource["GrayLevelColorValueSelector"], {
0, {Left, Bottom}}, {Left, Top},
"ClosingActions" -> {
"SelectionDeparture", "ParentChanged",
"EvaluatorQuit"}]]]], BaseStyle -> Inherited, Evaluator ->
Automatic, Method -> "Preemptive"],
GrayLevel[0.5], Editable -> False, Selectable ->
False]}]}], "]"}]& ), BaseStyle -> GrayLevel[0.5]]},
"RowDefault"], "SummaryItem", StripOnInput -> False],
"SummaryItem"]}, {
ItemBox[
StyleBox["\"Ports:\"", Bold, StripOnInput -> False],
Frame -> {{False, False}, {False, True}}, FrameStyle ->
GrayLevel[0.85], StripOnInput -> False],
ItemBox[
InterpretationBox[
StyleBox[
GraphicsBox[{}, ImageSize -> {1, 11},
BaselinePosition -> (Scaled[0.] -> Baseline)],
"CacheGraphics" -> False],
Spacer[{1, 11}]], Frame -> {{False, False}, {False, True}},
FrameStyle -> GrayLevel[0.85], StripOnInput -> False]}, {
TagBox[
StyleBox[
TemplateBox[{"\"Input\"", "\":\""}, "RowDefault"],
"SummaryItemAnnotation", StripOnInput -> False],
"SummaryItem"],
TagBox[
StyleBox[
TemplateBox[{"\"vector\"", "\" \"",
TemplateBox[{
"\"(\"", "\"\[VeryThinSpace]\"", "\"size\"", "\":\"",
"\" \"",
TemplateBox[{"\[Times]", "\"\[Times]\"", "\"3\""},
"RowWithSeparators"], "\"\[VeryThinSpace]\"", "\")\""},
"Row", DisplayFunction -> (RowBox[{
TemplateSlotSequence[1, "\[InvisibleSpace]"]}]& ),
InterpretationFunction -> (RowBox[{"Row", "[",
RowBox[{
RowBox[{"{",
TemplateSlotSequence[1, ","], "}"}], ",",
RowBox[{"BaseStyle", "\[Rule]",
InterpretationBox[
ButtonBox[
TooltipBox[
GraphicsBox[{{
GrayLevel[0],
RectangleBox[{0, 0}]}, {
GrayLevel[0],
RectangleBox[{1, -1}]}, {
GrayLevel[0.5],
RectangleBox[{0, -1}, {2, 1}]}}, AspectRatio -> 1, Frame ->
True, FrameStyle -> GrayLevel[0.33333333333333337`],
FrameTicks -> None, PlotRangePadding -> None, ImageSize ->
Dynamic[{Automatic,
1.35 (CurrentValue["FontCapHeight"]/AbsoluteCurrentValue[
Magnification])}]], "GrayLevel[0.5]"], Appearance -> None,
BaseStyle -> {}, BaselinePosition -> Baseline,
DefaultBaseStyle -> {}, ButtonFunction :>
With[{Typeset`box$ = EvaluationBox[]},
If[
Not[
AbsoluteCurrentValue["Deployed"]],
SelectionMove[Typeset`box$, All, Expression];
FrontEnd`Private`$ColorSelectorInitialAlpha = 1;
FrontEnd`Private`$ColorSelectorInitialColor =
GrayLevel[0.5];
FrontEnd`Private`$ColorSelectorUseMakeBoxes = True;
MathLink`CallFrontEnd[
FrontEnd`AttachCell[Typeset`box$,
FrontEndResource["GrayLevelColorValueSelector"], {
0, {Left, Bottom}}, {Left, Top},
"ClosingActions" -> {
"SelectionDeparture", "ParentChanged",
"EvaluatorQuit"}]]]], BaseStyle -> Inherited, Evaluator ->
Automatic, Method -> "Preemptive"],
GrayLevel[0.5], Editable -> False, Selectable ->
False]}]}], "]"}]& ), BaseStyle -> GrayLevel[0.5]]},
"RowDefault"], "SummaryItem", StripOnInput -> False],
"SummaryItem"]}, {
TagBox[
StyleBox[
TemplateBox[{"\"Output\"", "\":\""}, "RowDefault"],
"SummaryItemAnnotation", StripOnInput -> False],
"SummaryItem"],
TagBox[
StyleBox[
TemplateBox[{"\"vector\"", "\" \"",
TemplateBox[{
"\"(\"", "\"\[VeryThinSpace]\"", "\"size\"", "\":\"",
"\" \"",
TemplateBox[{"\[Times]", "\"\[Times]\"", "\"2\""},
"RowWithSeparators"], "\"\[VeryThinSpace]\"", "\")\""},
"Row", DisplayFunction -> (RowBox[{
TemplateSlotSequence[1, "\[InvisibleSpace]"]}]& ),
InterpretationFunction -> (RowBox[{"Row", "[",
RowBox[{
RowBox[{"{",
TemplateSlotSequence[1, ","], "}"}], ",",
RowBox[{"BaseStyle", "\[Rule]",
InterpretationBox[
ButtonBox[
TooltipBox[
GraphicsBox[{{
GrayLevel[0],
RectangleBox[{0, 0}]}, {
GrayLevel[0],
RectangleBox[{1, -1}]}, {
GrayLevel[0.5],
RectangleBox[{0, -1}, {2, 1}]}}, AspectRatio -> 1, Frame ->
True, FrameStyle -> GrayLevel[0.33333333333333337`],
FrameTicks -> None, PlotRangePadding -> None, ImageSize ->
Dynamic[{Automatic,
1.35 (CurrentValue["FontCapHeight"]/AbsoluteCurrentValue[
Magnification])}]], "GrayLevel[0.5]"], Appearance -> None,
BaseStyle -> {}, BaselinePosition -> Baseline,
DefaultBaseStyle -> {}, ButtonFunction :>
With[{Typeset`box$ = EvaluationBox[]},
If[
Not[
AbsoluteCurrentValue["Deployed"]],
SelectionMove[Typeset`box$, All, Expression];
FrontEnd`Private`$ColorSelectorInitialAlpha = 1;
FrontEnd`Private`$ColorSelectorInitialColor =
GrayLevel[0.5];
FrontEnd`Private`$ColorSelectorUseMakeBoxes = True;
MathLink`CallFrontEnd[
FrontEnd`AttachCell[Typeset`box$,
FrontEndResource["GrayLevelColorValueSelector"], {
0, {Left, Bottom}}, {Left, Top},
"ClosingActions" -> {
"SelectionDeparture", "ParentChanged",
"EvaluatorQuit"}]]]], BaseStyle -> Inherited, Evaluator ->
Automatic, Method -> "Preemptive"],
GrayLevel[0.5], Editable -> False, Selectable ->
False]}]}], "]"}]& ), BaseStyle -> GrayLevel[0.5]]},
"RowDefault"], "SummaryItem", StripOnInput -> False],
"SummaryItem"]}},
GridBoxAlignment -> {
"Columns" -> {{Left}}, "Rows" -> {{Automatic}}}, AutoDelete ->
False, GridBoxItemSize -> {
"Columns" -> {{Automatic}}, "Rows" -> {{Automatic}}},
GridBoxSpacings -> {
"Columns" -> {{2}}, "Rows" -> {{Automatic}}},
BaseStyle -> {
ShowStringCharacters -> False, NumberMarks -> False,
PrintPrecision -> 3, ShowSyntaxStyles -> False}]}},
GridBoxAlignment -> {"Rows" -> {{Top}}}, AutoDelete -> False,
GridBoxItemSize -> {
"Columns" -> {{Automatic}}, "Rows" -> {{Automatic}}},
BaselinePosition -> {1, 1}]},
Dynamic[Typeset`open$$], ImageSize -> Automatic], BaselinePosition ->
Baseline], DynamicModuleValues :> {}],
StyleBox["]", "NonInterpretableSummary"]}]},
"CopyTag",
DisplayFunction->(#& ),
InterpretationFunction->("None"& )],
False,
Editable->False,
SelectWithContents->True,
Selectable->False]], "Output",
ImageSize->{265, 47},
ImageMargins->{{0, 0}, {0, 0}},
ImageRegion->{{0, 1}, {0, 1}},
CellID->1516611231],
Cell[BoxData[
RowBox[{"{",
RowBox[{
RowBox[{"-", "4.334064483642578`"}], ",", "2.7676756381988525`"}],
"}"}]], "Output",
ImageSize->{137, 16},
ImageMargins->{{0, 0}, {0, 0}},
ImageRegion->{{0, 1}, {0, 1}},
CellID->1201553174]
}, Open ]],
Cell[CellGroupData[{
Cell[BoxData[
RowBox[{"dotPlus", "[",
RowBox[{"data", ",", " ",
RowBox[{"NetExtract", "[",
RowBox[{"dotp", ",", "\"\\""}], "]"}], ",",
RowBox[{"NetExtract", "[",
RowBox[{"dotp", ",", "\"\\""}], "]"}]}], "]"}]], "Input",
CellID->490945357],
Cell[BoxData[
RowBox[{"{",
RowBox[{
RowBox[{"-", "4.334064424037933`"}], ",", "2.7676755487918854`"}],
"}"}]], "Output",
ImageSize->{137, 16},
ImageMargins->{{0, 0}, {0, 0}},
ImageRegion->{{0, 1}, {0, 1}},
CellID->248686065]
}, Open ]]
}, Open ]],
Cell[CellGroupData[{
Cell["Reshape Layer", "Section",
CellChangeTimes->{{3.688342255870318*^9, 3.6883422648220787`*^9}}],
Cell[CellGroupData[{
Cell[BoxData[
RowBox[{"reshape", "=",
RowBox[{"ReshapeLayer", "[",
RowBox[{"{",
RowBox[{"2", ",", "2"}], "}"}], "]"}]}]], "Input",
CellID->1012209005],
Cell[BoxData[
InterpretationBox[
RowBox[{
TagBox["ReshapeLayer",
"SummaryHead"], "[",
DynamicModuleBox[{Typeset`open$$ = False},
PanelBox[
PaneSelectorBox[{False->GridBox[{
{
PaneBox[
ButtonBox[
DynamicBox[FEPrivate`FrontEndResource[
"FEBitmaps", "SquarePlusIconMedium"],
ImageSizeCache->{12., {0., 12.}}],
Appearance->None,
ButtonFunction:>(Typeset`open$$ = True),
Evaluator->Automatic,
Method->"Preemptive"],
Alignment->{Center, Center},
ImageSize->
Dynamic[{
Automatic,
3.5 (CurrentValue["FontCapHeight"]/AbsoluteCurrentValue[
Magnification])}]],
GraphicsBox[{
{Opacity[
0.3], {LineBox[
NCache[{{0, 0}, {Rational[-1, 2], 1}}, {{0, 0}, {-0.5, 1}}]],
LineBox[NCache[{{0, 0}, {Rational[1, 2], 1}}, {{0, 0}, {
0.5, 1}}]],
LineBox[NCache[{{0, 0}, {Rational[3, 2], 1}}, {{0, 0}, {
1.5, 1}}]]}, {
LineBox[NCache[{{1, 0}, {Rational[-1, 2], 1}}, {{1,
0}, {-0.5, 1}}]],
LineBox[NCache[{{1, 0}, {Rational[1, 2], 1}}, {{1, 0}, {
0.5, 1}}]],
LineBox[NCache[{{1, 0}, {Rational[3, 2], 1}}, {{1, 0}, {
1.5, 1}}]]}},
{AbsolutePointSize[5], PointBox[{{0, 0}, {1, 0}}],
PointBox[
NCache[{{Rational[-1, 2], 1}, {Rational[1, 2], 1}, {
Rational[3, 2], 1}}, {{-0.5, 1}, {0.5, 1}, {1.5, 1}}]]}},
ImageSize->32], GridBox[{
{
ItemBox[
StyleBox["\<\"Parameters:\"\>",
StripOnInput->False,
FontWeight->Bold],
StripOnInput->False],
ItemBox["\<\"\"\>",
StripOnInput->False]},
{
TagBox[
StyleBox[
TemplateBox[{"\"Dimensions\"","\":\""},
"RowDefault"], "SummaryItemAnnotation",
StripOnInput->False],
"SummaryItem"],
TagBox[
StyleBox[
RowBox[{"{",
RowBox[{"2", ",", "2"}], "}"}], "SummaryItem",
StripOnInput->False],
"SummaryItem"]}
},
AutoDelete->False,
BaseStyle->{
ShowStringCharacters -> False, NumberMarks -> False,
PrintPrecision -> 3, ShowSyntaxStyles -> False},
GridBoxAlignment->{"Columns" -> {{Left}}, "Rows" -> {{Automatic}}},
GridBoxItemSize->{
"Columns" -> {{Automatic}}, "Rows" -> {{Automatic}}},
GridBoxSpacings->{"Columns" -> {{2}}, "Rows" -> {{Automatic}}}]}
},
AutoDelete->False,
BaselinePosition->{1, 1},
GridBoxAlignment->{"Rows" -> {{Top}}},
GridBoxItemSize->{
"Columns" -> {{Automatic}}, "Rows" -> {{Automatic}}}], True->
GridBox[{
{
PaneBox[
ButtonBox[
DynamicBox[FEPrivate`FrontEndResource[
"FEBitmaps", "SquareMinusIconMedium"]],
Appearance->None,
ButtonFunction:>(Typeset`open$$ = False),
Evaluator->Automatic,
Method->"Preemptive"],
Alignment->{Center, Center},
ImageSize->
Dynamic[{
Automatic,
3.5 (CurrentValue["FontCapHeight"]/AbsoluteCurrentValue[
Magnification])}]],
GraphicsBox[{
{Opacity[
0.3], {LineBox[
NCache[{{0, 0}, {Rational[-1, 2], 1}}, {{0, 0}, {-0.5, 1}}]],
LineBox[NCache[{{0, 0}, {Rational[1, 2], 1}}, {{0, 0}, {
0.5, 1}}]],
LineBox[NCache[{{0, 0}, {Rational[3, 2], 1}}, {{0, 0}, {
1.5, 1}}]]}, {
LineBox[NCache[{{1, 0}, {Rational[-1, 2], 1}}, {{1,
0}, {-0.5, 1}}]],
LineBox[NCache[{{1, 0}, {Rational[1, 2], 1}}, {{1, 0}, {
0.5, 1}}]],
LineBox[NCache[{{1, 0}, {Rational[3, 2], 1}}, {{1, 0}, {
1.5, 1}}]]}},
{AbsolutePointSize[5], PointBox[{{0, 0}, {1, 0}}],
PointBox[
NCache[{{Rational[-1, 2], 1}, {Rational[1, 2], 1}, {
Rational[3, 2], 1}}, {{-0.5, 1}, {0.5, 1}, {1.5, 1}}]]}},
ImageSize->32], GridBox[{
{
ItemBox[
StyleBox["\<\"Parameters:\"\>",
StripOnInput->False,
FontWeight->Bold],
StripOnInput->False],
ItemBox["\<\"\"\>",
StripOnInput->False]},
{
TagBox[
StyleBox[
TemplateBox[{"\"Dimensions\"","\":\""},
"RowDefault"], "SummaryItemAnnotation",
StripOnInput->False],
"SummaryItem"],
TagBox[
StyleBox[
RowBox[{"{",
RowBox[{"2", ",", "2"}], "}"}], "SummaryItem",
StripOnInput->False],
"SummaryItem"]},
{
ItemBox[
StyleBox["\<\"Ports:\"\>",
StripOnInput->False,
FontWeight->Bold],
Frame->{{False, False}, {False, True}},
FrameStyle->GrayLevel[0.85],
StripOnInput->False],
ItemBox[
InterpretationBox[
StyleBox[
GraphicsBox[{},
BaselinePosition->(Scaled[0.] -> Baseline),
ImageSize->{1, 11}],
CacheGraphics->False],
Spacer[{1, 11}]],
Frame->{{False, False}, {False, True}},
FrameStyle->GrayLevel[0.85],
StripOnInput->False]},
{
TagBox[
StyleBox[
TemplateBox[{"\"Input\"","\":\""},
"RowDefault"], "SummaryItemAnnotation",
StripOnInput->False],
"SummaryItem"],
TagBox[
StyleBox["\<\"tensor\"\>", "SummaryItem",
StripOnInput->False],
"SummaryItem"]},
{
TagBox[
StyleBox[
TemplateBox[{"\"Output\"","\":\""},
"RowDefault"], "SummaryItemAnnotation",
StripOnInput->False],
"SummaryItem"],
TagBox[
StyleBox[
TemplateBox[{
"\"matrix\"","\" \"",
TemplateBox[{
"\"(\"", "\"\[VeryThinSpace]\"", "\"size\"", "\":\"",
"\" \"",
TemplateBox[{"\[Times]", "\"\[Times]\"", "\"2\"", "\"2\""},
"RowWithSeparators"], "\"\[VeryThinSpace]\"", "\")\""},
"Row", DisplayFunction -> (RowBox[{
TemplateSlotSequence[1, "\[InvisibleSpace]"]}]& ),
InterpretationFunction -> (RowBox[{"Row", "[",
RowBox[{
RowBox[{"{",
TemplateSlotSequence[1, ","], "}"}], ",",
RowBox[{"BaseStyle", "\[Rule]",
InterpretationBox[
ButtonBox[
TooltipBox[
GraphicsBox[{{
GrayLevel[0],
RectangleBox[{0, 0}]}, {
GrayLevel[0],
RectangleBox[{1, -1}]}, {
GrayLevel[0.5],
RectangleBox[{0, -1}, {2, 1}]}}, AspectRatio -> 1, Frame ->
True, FrameStyle -> GrayLevel[0.33333333333333337`],
FrameTicks -> None, PlotRangePadding -> None, ImageSize ->
Dynamic[{Automatic,
1.35 (CurrentValue["FontCapHeight"]/AbsoluteCurrentValue[
Magnification])}]], "GrayLevel[0.5]"], Appearance -> None,
BaseStyle -> {}, BaselinePosition -> Baseline,
DefaultBaseStyle -> {}, ButtonFunction :>
With[{Typeset`box$ = EvaluationBox[]},
If[
Not[
AbsoluteCurrentValue["Deployed"]],
SelectionMove[Typeset`box$, All, Expression];
FrontEnd`Private`$ColorSelectorInitialAlpha = 1;
FrontEnd`Private`$ColorSelectorInitialColor =
GrayLevel[0.5];
FrontEnd`Private`$ColorSelectorUseMakeBoxes = True;
MathLink`CallFrontEnd[
FrontEnd`AttachCell[Typeset`box$,
FrontEndResource["GrayLevelColorValueSelector"], {
0, {Left, Bottom}}, {Left, Top},
"ClosingActions" -> {
"SelectionDeparture", "ParentChanged",
"EvaluatorQuit"}]]]], BaseStyle -> Inherited, Evaluator ->
Automatic, Method -> "Preemptive"],
GrayLevel[0.5], Editable -> False, Selectable ->
False]}]}], "]"}]& ), BaseStyle -> GrayLevel[0.5]]},
"RowDefault"], "SummaryItem",
StripOnInput->False],
"SummaryItem"]}
},
AutoDelete->False,
BaseStyle->{
ShowStringCharacters -> False, NumberMarks -> False,
PrintPrecision -> 3, ShowSyntaxStyles -> False},
GridBoxAlignment->{"Columns" -> {{Left}}, "Rows" -> {{Automatic}}},
GridBoxItemSize->{
"Columns" -> {{Automatic}}, "Rows" -> {{Automatic}}},
GridBoxSpacings->{"Columns" -> {{2}}, "Rows" -> {{Automatic}}}]}
},
AutoDelete->False,
BaselinePosition->{1, 1},
GridBoxAlignment->{"Rows" -> {{Top}}},
GridBoxItemSize->{
"Columns" -> {{Automatic}}, "Rows" -> {{Automatic}}}]}, Dynamic[
Typeset`open$$],
ImageSize->Automatic],
BaselinePosition->Baseline],
DynamicModuleValues:>{}], "]"}],
None,
Editable->False,
SelectWithContents->True,
Selectable->False]], "Output",
ImageSize->{283, 47},
ImageMargins->{{0, 0}, {0, 0}},
ImageRegion->{{0, 1}, {0, 1}},
CellID->346122736]
}, Open ]],
Cell[CellGroupData[{
Cell[BoxData[
RowBox[{"reshape", "[",
RowBox[{"{",
RowBox[{"1", ",", "2", ",", "3", ",", "4"}], "}"}], "]"}]], "Input",
CellID->1868793055],
Cell[BoxData[
RowBox[{"{",
RowBox[{
RowBox[{"{",
RowBox[{"1.`", ",", "2.`"}], "}"}], ",",
RowBox[{"{",
RowBox[{"3.`", ",", "4.`"}], "}"}]}], "}"}]], "Output",
ImageSize->{135, 16},
ImageMargins->{{0, 0}, {0, 0}},
ImageRegion->{{0, 1}, {0, 1}},
CellID->256626571]
}, Open ]],
Cell[CellGroupData[{
Cell[BoxData[
RowBox[{"reshape", "[",
RowBox[{"{",
RowBox[{"{",
RowBox[{"{",
RowBox[{
RowBox[{"{",
RowBox[{"1", ",", "2"}], "}"}], ",",
RowBox[{"{",
RowBox[{"3", ",", "4"}], "}"}]}], "}"}], "}"}], "}"}], "]"}]], "Input",\
CellID->1317188876],
Cell[BoxData[
RowBox[{"{",
RowBox[{
RowBox[{"{",
RowBox[{"1.`", ",", "2.`"}], "}"}], ",",
RowBox[{"{",
RowBox[{"3.`", ",", "4.`"}], "}"}]}], "}"}]], "Output",
ImageSize->{135, 16},
ImageMargins->{{0, 0}, {0, 0}},
ImageRegion->{{0, 1}, {0, 1}},
CellID->1383435648]
}, Open ]]
}, Open ]],
Cell[CellGroupData[{
Cell["Total Layer", "Section",
CellChangeTimes->{{3.6883796172516336`*^9, 3.688379620871242*^9}}],
Cell[CellGroupData[{
Cell[BoxData[
RowBox[{"total", "=",
RowBox[{"TotalLayer", "[", "]"}]}]], "Input",
CellID->1295468126],
Cell[BoxData[
InterpretationBox[
RowBox[{
TagBox["TotalLayer",
"SummaryHead"], "[",
DynamicModuleBox[{Typeset`open$$ = False},
PanelBox[
PaneSelectorBox[{False->GridBox[{
{
PaneBox[
ButtonBox[
DynamicBox[FEPrivate`FrontEndResource[
"FEBitmaps", "SquarePlusIconMedium"],
ImageSizeCache->{12., {0., 12.}}],
Appearance->None,
ButtonFunction:>(Typeset`open$$ = True),
Evaluator->Automatic,
Method->"Preemptive"],
Alignment->{Center, Center},
ImageSize->
Dynamic[{
Automatic,
3.5 (CurrentValue["FontCapHeight"]/AbsoluteCurrentValue[
Magnification])}]],
GraphicsBox[{
{Opacity[
0.3], {LineBox[
NCache[{{0, 0}, {Rational[-1, 2], 1}}, {{0, 0}, {-0.5, 1}}]],
LineBox[NCache[{{0, 0}, {Rational[1, 2], 1}}, {{0, 0}, {
0.5, 1}}]],
LineBox[NCache[{{0, 0}, {Rational[3, 2], 1}}, {{0, 0}, {
1.5, 1}}]]}, {
LineBox[NCache[{{1, 0}, {Rational[-1, 2], 1}}, {{1,
0}, {-0.5, 1}}]],
LineBox[NCache[{{1, 0}, {Rational[1, 2], 1}}, {{1, 0}, {
0.5, 1}}]],
LineBox[NCache[{{1, 0}, {Rational[3, 2], 1}}, {{1, 0}, {
1.5, 1}}]]}},
{AbsolutePointSize[5], PointBox[{{0, 0}, {1, 0}}],
PointBox[
NCache[{{Rational[-1, 2], 1}, {Rational[1, 2], 1}, {
Rational[3, 2], 1}}, {{-0.5, 1}, {0.5, 1}, {1.5, 1}}]]}},
ImageSize->32], GridBox[{
{
ItemBox[
StyleBox["\<\"Parameters:\"\>",
StripOnInput->False,
FontWeight->Bold],
StripOnInput->False],
ItemBox["\<\"\"\>",
StripOnInput->False]},
{
TagBox[
StyleBox["\<\"none\"\>",
StripOnInput->False,
GraphicsColor->GrayLevel[0.5],
FontColor->GrayLevel[0.5],
$CellContext`LineColor -> GrayLevel[0.5],
$CellContext`FrontFaceColor -> GrayLevel[0.5],
$CellContext`BackFaceColor -> GrayLevel[0.5]],
"SummaryItem"], ""}
},
AutoDelete->False,
BaseStyle->{
ShowStringCharacters -> False, NumberMarks -> False,
PrintPrecision -> 3, ShowSyntaxStyles -> False},
GridBoxAlignment->{"Columns" -> {{Left}}, "Rows" -> {{Automatic}}},
GridBoxItemSize->{
"Columns" -> {{Automatic}}, "Rows" -> {{Automatic}}},
GridBoxSpacings->{"Columns" -> {{2}}, "Rows" -> {{Automatic}}}]}
},
AutoDelete->False,
BaselinePosition->{1, 1},
GridBoxAlignment->{"Rows" -> {{Top}}},
GridBoxItemSize->{
"Columns" -> {{Automatic}}, "Rows" -> {{Automatic}}}], True->
GridBox[{
{
PaneBox[
ButtonBox[
DynamicBox[FEPrivate`FrontEndResource[
"FEBitmaps", "SquareMinusIconMedium"]],
Appearance->None,
ButtonFunction:>(Typeset`open$$ = False),
Evaluator->Automatic,
Method->"Preemptive"],
Alignment->{Center, Center},
ImageSize->
Dynamic[{
Automatic,
3.5 (CurrentValue["FontCapHeight"]/AbsoluteCurrentValue[
Magnification])}]],
GraphicsBox[{
{Opacity[
0.3], {LineBox[
NCache[{{0, 0}, {Rational[-1, 2], 1}}, {{0, 0}, {-0.5, 1}}]],
LineBox[NCache[{{0, 0}, {Rational[1, 2], 1}}, {{0, 0}, {
0.5, 1}}]],
LineBox[NCache[{{0, 0}, {Rational[3, 2], 1}}, {{0, 0}, {
1.5, 1}}]]}, {
LineBox[NCache[{{1, 0}, {Rational[-1, 2], 1}}, {{1,
0}, {-0.5, 1}}]],
LineBox[NCache[{{1, 0}, {Rational[1, 2], 1}}, {{1, 0}, {
0.5, 1}}]],
LineBox[NCache[{{1, 0}, {Rational[3, 2], 1}}, {{1, 0}, {
1.5, 1}}]]}},
{AbsolutePointSize[5], PointBox[{{0, 0}, {1, 0}}],
PointBox[
NCache[{{Rational[-1, 2], 1}, {Rational[1, 2], 1}, {
Rational[3, 2], 1}}, {{-0.5, 1}, {0.5, 1}, {1.5, 1}}]]}},
ImageSize->32], GridBox[{
{
ItemBox[
StyleBox["\<\"Parameters:\"\>",
StripOnInput->False,
FontWeight->Bold],
StripOnInput->False],
ItemBox["\<\"\"\>",
StripOnInput->False]},
{
TagBox[
StyleBox["\<\"none\"\>",
StripOnInput->False,
GraphicsColor->GrayLevel[0.5],
FontColor->GrayLevel[0.5],
$CellContext`LineColor -> GrayLevel[0.5],
$CellContext`FrontFaceColor -> GrayLevel[0.5],
$CellContext`BackFaceColor -> GrayLevel[0.5]],
"SummaryItem"], ""},
{
ItemBox[
StyleBox["\<\"Ports:\"\>",
StripOnInput->False,
FontWeight->Bold],
Frame->{{False, False}, {False, True}},
FrameStyle->GrayLevel[0.85],
StripOnInput->False],
ItemBox[
InterpretationBox[
StyleBox[
GraphicsBox[{},
BaselinePosition->(Scaled[0.] -> Baseline),
ImageSize->{1, 11}],
CacheGraphics->False],
Spacer[{1, 11}]],
Frame->{{False, False}, {False, True}},
FrameStyle->GrayLevel[0.85],
StripOnInput->False]},
{
TagBox[
StyleBox[
TemplateBox[{"\"Input\"","\":\""},
"RowDefault"], "SummaryItemAnnotation",
StripOnInput->False],
"SummaryItem"],
TagBox[
StyleBox[
TemplateBox[{"\"list of \"","\"tensor\"","\"s\""},
"RowDefault"], "SummaryItem",
StripOnInput->False],
"SummaryItem"]},
{
TagBox[
StyleBox[
TemplateBox[{"\"Output\"","\":\""},
"RowDefault"], "SummaryItemAnnotation",
StripOnInput->False],
"SummaryItem"],
TagBox[
StyleBox["\<\"tensor\"\>", "SummaryItem",
StripOnInput->False],
"SummaryItem"]}
},
AutoDelete->False,
BaseStyle->{
ShowStringCharacters -> False, NumberMarks -> False,
PrintPrecision -> 3, ShowSyntaxStyles -> False},
GridBoxAlignment->{"Columns" -> {{Left}}, "Rows" -> {{Automatic}}},
GridBoxItemSize->{
"Columns" -> {{Automatic}}, "Rows" -> {{Automatic}}},
GridBoxSpacings->{"Columns" -> {{2}}, "Rows" -> {{Automatic}}}]}
},
AutoDelete->False,
BaselinePosition->{1, 1},
GridBoxAlignment->{"Rows" -> {{Top}}},
GridBoxItemSize->{
"Columns" -> {{Automatic}}, "Rows" -> {{Automatic}}}]}, Dynamic[
Typeset`open$$],
ImageSize->Automatic],
BaselinePosition->Baseline],
DynamicModuleValues:>{}], "]"}],
None,
Editable->False,
SelectWithContents->True,
Selectable->False]], "Output",
GeneratedCell->False,
CellAutoOverwrite->False,
ImageSize->{249, 46},
ImageMargins->{{0, 0}, {0, 0}},
ImageRegion->{{0, 1}, {0, 1}},
CellID->2017324128]
}, Open ]],
Cell[CellGroupData[{
Cell[BoxData[
RowBox[{"total", "[",
RowBox[{"{",
RowBox[{
RowBox[{"{",
RowBox[{"1", ",", "2", ",", "3", ",", "4"}], "}"}], ",",
RowBox[{"{",
RowBox[{"4.4", ",", "5", ",", "6", ",", "7"}], "}"}]}], "}"}],
"]"}]], "Input",
CellID->1142513639],
Cell[BoxData[
RowBox[{"{",
RowBox[{"5.4`", ",", "7", ",", "9", ",", "11"}], "}"}]], "Output",
ImageSize->{101, 16},
ImageMargins->{{0, 0}, {0, 0}},
ImageRegion->{{0, 1}, {0, 1}},
CellID->1523112335]
}, Open ]],
Cell[BoxData[
RowBox[{
RowBox[{"total", ":=",
RowBox[{
RowBox[{"Total", "[", "#", "]"}], "&"}]}], ";"}]], "Input",
CellID->2111771107],
Cell[CellGroupData[{
Cell[BoxData[{
RowBox[{
RowBox[{"in1", "=",
RowBox[{"{",
RowBox[{"1", ",", "2", ",", "3"}], "}"}]}],
";"}], "\[IndentingNewLine]",
RowBox[{
RowBox[{"in2", "=",
RowBox[{"{",
RowBox[{"4", ",", "5", ",", "6"}], "}"}]}],
";"}], "\[IndentingNewLine]",
RowBox[{
RowBox[{"TotalLayer", "[", "]"}], "[",
RowBox[{"{",
RowBox[{"in1", ",", "in2"}], "}"}], "]"}], "\[IndentingNewLine]",
RowBox[{"total", "[",
RowBox[{"{",
RowBox[{"in1", ",", "in2"}], "}"}], "]"}]}], "Input",
CellID->500363085],
Cell[BoxData[
RowBox[{"{",
RowBox[{"5", ",", "7", ",", "9"}], "}"}]], "Output",
ImageSize->{61, 16},
ImageMargins->{{0, 0}, {0, 0}},
ImageRegion->{{0, 1}, {0, 1}},
CellID->639200774]
}, Open ]]
}, Open ]],
Cell[CellGroupData[{
Cell["Softmax Layer", "Section",
CellChangeTimes->{{3.688379625499633*^9, 3.6883796329808397`*^9}}],
Cell[CellGroupData[{
Cell[BoxData[
RowBox[{"SoftmaxLayer", "[", "]"}]], "Input",
CellID->1505571084],
Cell[BoxData[
InterpretationBox[
RowBox[{
TagBox["SoftmaxLayer",
"SummaryHead"], "[",
DynamicModuleBox[{Typeset`open$$ = False},
PanelBox[
PaneSelectorBox[{False->GridBox[{
{
PaneBox[
ButtonBox[
DynamicBox[FEPrivate`FrontEndResource[
"FEBitmaps", "SquarePlusIconMedium"],
ImageSizeCache->{12., {0., 12.}}],
Appearance->None,
ButtonFunction:>(Typeset`open$$ = True),
Evaluator->Automatic,
Method->"Preemptive"],
Alignment->{Center, Center},
ImageSize->
Dynamic[{
Automatic,
3.5 (CurrentValue["FontCapHeight"]/AbsoluteCurrentValue[
Magnification])}]],
GraphicsBox[{
{Opacity[
0.3], {LineBox[
NCache[{{0, 0}, {Rational[-1, 2], 1}}, {{0, 0}, {-0.5, 1}}]],
LineBox[NCache[{{0, 0}, {Rational[1, 2], 1}}, {{0, 0}, {
0.5, 1}}]],
LineBox[NCache[{{0, 0}, {Rational[3, 2], 1}}, {{0, 0}, {
1.5, 1}}]]}, {
LineBox[NCache[{{1, 0}, {Rational[-1, 2], 1}}, {{1,
0}, {-0.5, 1}}]],
LineBox[NCache[{{1, 0}, {Rational[1, 2], 1}}, {{1, 0}, {
0.5, 1}}]],
LineBox[NCache[{{1, 0}, {Rational[3, 2], 1}}, {{1, 0}, {
1.5, 1}}]]}},
{AbsolutePointSize[5], PointBox[{{0, 0}, {1, 0}}],
PointBox[
NCache[{{Rational[-1, 2], 1}, {Rational[1, 2], 1}, {
Rational[3, 2], 1}}, {{-0.5, 1}, {0.5, 1}, {1.5, 1}}]]}},
ImageSize->32], GridBox[{
{
ItemBox[
StyleBox["\<\"Parameters:\"\>",
StripOnInput->False,
FontWeight->Bold],
StripOnInput->False],
ItemBox["\<\"\"\>",
StripOnInput->False]},
{
TagBox[
StyleBox[
TemplateBox[{"\"Size\"","\":\""},
"RowDefault"], "SummaryItemAnnotation",
StripOnInput->False],
"SummaryItem"],
TagBox[
StyleBox["\<\"positive integer\"\>", "SummaryItem",
StripOnInput->False],
"SummaryItem"]}
},
AutoDelete->False,
BaseStyle->{
ShowStringCharacters -> False, NumberMarks -> False,
PrintPrecision -> 3, ShowSyntaxStyles -> False},
GridBoxAlignment->{"Columns" -> {{Left}}, "Rows" -> {{Automatic}}},
GridBoxItemSize->{
"Columns" -> {{Automatic}}, "Rows" -> {{Automatic}}},
GridBoxSpacings->{"Columns" -> {{2}}, "Rows" -> {{Automatic}}}]}
},
AutoDelete->False,
BaselinePosition->{1, 1},
GridBoxAlignment->{"Rows" -> {{Top}}},
GridBoxItemSize->{
"Columns" -> {{Automatic}}, "Rows" -> {{Automatic}}}], True->
GridBox[{
{
PaneBox[
ButtonBox[
DynamicBox[FEPrivate`FrontEndResource[
"FEBitmaps", "SquareMinusIconMedium"]],
Appearance->None,
ButtonFunction:>(Typeset`open$$ = False),
Evaluator->Automatic,
Method->"Preemptive"],
Alignment->{Center, Center},
ImageSize->
Dynamic[{
Automatic,
3.5 (CurrentValue["FontCapHeight"]/AbsoluteCurrentValue[
Magnification])}]],
GraphicsBox[{
{Opacity[
0.3], {LineBox[
NCache[{{0, 0}, {Rational[-1, 2], 1}}, {{0, 0}, {-0.5, 1}}]],
LineBox[NCache[{{0, 0}, {Rational[1, 2], 1}}, {{0, 0}, {
0.5, 1}}]],
LineBox[NCache[{{0, 0}, {Rational[3, 2], 1}}, {{0, 0}, {
1.5, 1}}]]}, {
LineBox[NCache[{{1, 0}, {Rational[-1, 2], 1}}, {{1,
0}, {-0.5, 1}}]],
LineBox[NCache[{{1, 0}, {Rational[1, 2], 1}}, {{1, 0}, {
0.5, 1}}]],
LineBox[NCache[{{1, 0}, {Rational[3, 2], 1}}, {{1, 0}, {
1.5, 1}}]]}},
{AbsolutePointSize[5], PointBox[{{0, 0}, {1, 0}}],
PointBox[
NCache[{{Rational[-1, 2], 1}, {Rational[1, 2], 1}, {
Rational[3, 2], 1}}, {{-0.5, 1}, {0.5, 1}, {1.5, 1}}]]}},
ImageSize->32], GridBox[{
{
ItemBox[
StyleBox["\<\"Parameters:\"\>",
StripOnInput->False,
FontWeight->Bold],
StripOnInput->False],
ItemBox["\<\"\"\>",
StripOnInput->False]},
{
TagBox[
StyleBox[
TemplateBox[{"\"Size\"","\":\""},
"RowDefault"], "SummaryItemAnnotation",
StripOnInput->False],
"SummaryItem"],
TagBox[
StyleBox["\<\"positive integer\"\>", "SummaryItem",
StripOnInput->False],
"SummaryItem"]},
{
ItemBox[
StyleBox["\<\"Ports:\"\>",
StripOnInput->False,
FontWeight->Bold],
Frame->{{False, False}, {False, True}},
FrameStyle->GrayLevel[0.85],
StripOnInput->False],
ItemBox[
InterpretationBox[
StyleBox[
GraphicsBox[{},
BaselinePosition->(Scaled[0.] -> Baseline),
ImageSize->{1, 11}],
CacheGraphics->False],
Spacer[{1, 11}]],
Frame->{{False, False}, {False, True}},
FrameStyle->GrayLevel[0.85],
StripOnInput->False]},
{
TagBox[
StyleBox[
TemplateBox[{"\"Input\"","\":\""},
"RowDefault"], "SummaryItemAnnotation",
StripOnInput->False],
"SummaryItem"],
TagBox[
StyleBox["\<\"vector\"\>", "SummaryItem",
StripOnInput->False],
"SummaryItem"]},
{
TagBox[
StyleBox[
TemplateBox[{"\"Output\"","\":\""},
"RowDefault"], "SummaryItemAnnotation",
StripOnInput->False],
"SummaryItem"],
TagBox[
StyleBox["\<\"vector\"\>", "SummaryItem",
StripOnInput->False],
"SummaryItem"]}
},
AutoDelete->False,
BaseStyle->{
ShowStringCharacters -> False, NumberMarks -> False,
PrintPrecision -> 3, ShowSyntaxStyles -> False},
GridBoxAlignment->{"Columns" -> {{Left}}, "Rows" -> {{Automatic}}},
GridBoxItemSize->{
"Columns" -> {{Automatic}}, "Rows" -> {{Automatic}}},
GridBoxSpacings->{"Columns" -> {{2}}, "Rows" -> {{Automatic}}}]}
},
AutoDelete->False,
BaselinePosition->{1, 1},
GridBoxAlignment->{"Rows" -> {{Top}}},
GridBoxItemSize->{
"Columns" -> {{Automatic}}, "Rows" -> {{Automatic}}}]}, Dynamic[
Typeset`open$$],
ImageSize->Automatic],
BaselinePosition->Baseline],
DynamicModuleValues:>{}], "]"}],
None,
Editable->False,
SelectWithContents->True,
Selectable->False]], "Output",
ImageSize->{328, 47},
ImageMargins->{{0, 0}, {0, 0}},
ImageRegion->{{0, 1}, {0, 1}},
CellID->806005521]
}, Open ]],
Cell[CellGroupData[{
Cell[BoxData[
RowBox[{
RowBox[{"SoftmaxLayer", "[", "]"}], "[",
RowBox[{"{",
RowBox[{"0.1", ",", "4.5", ",",
RowBox[{"-", "0.2"}], ",", "3.3", ",", "5.4"}], "}"}], "]"}]], "Input",
CellID->333396187],
Cell[BoxData[
RowBox[{"{",
RowBox[{
"0.003246109699830413`", ",", "0.2643984854221344`", ",",
"0.0024047777988016605`", ",", "0.07963528484106064`", ",",
"0.6503154039382935`"}], "}"}]], "Output",
ImageSize->{387, 16},
ImageMargins->{{0, 0}, {0, 0}},
ImageRegion->{{0, 1}, {0, 1}},
CellID->863722084]
}, Open ]],
Cell[BoxData[
RowBox[{
RowBox[{
RowBox[{"softmax", "[", "x_", "]"}], ":=",
RowBox[{
RowBox[{"Exp", "[", "x", "]"}], "/",
RowBox[{"Total", "@",
RowBox[{"Exp", "@", "x"}]}]}]}], ";"}]], "Input",
CellID->1706483685],
Cell[CellGroupData[{
Cell[BoxData[{
RowBox[{
RowBox[{"data", "=",
RowBox[{"{",
RowBox[{
RowBox[{"-", "1.2"}], ",", "0.3", ",", "1.42"}], "}"}]}],
";"}], "\[IndentingNewLine]",
RowBox[{"softmax", "@", "data"}], "\[IndentingNewLine]",
RowBox[{
RowBox[{"SoftmaxLayer", "[", "]"}], "@", "data"}]}], "Input",
CellID->811005725],
Cell[BoxData[
RowBox[{"{",
RowBox[{
"0.052036141281390086`", ",", "0.2332098056433733`", ",",
"0.7147540530752365`"}], "}"}]], "Output",
ImageSize->{213, 16},
ImageMargins->{{0, 0}, {0, 0}},
ImageRegion->{{0, 1}, {0, 1}},
CellID->754728544]
}, Open ]]
}, Open ]],
Cell[CellGroupData[{
Cell["Summation Layer", "Section",
CellChangeTimes->{{3.688381255025642*^9, 3.688381260251141*^9}}],
Cell[CellGroupData[{
Cell[BoxData[
RowBox[{"sum", "=",
RowBox[{"SummationLayer", "[",
RowBox[{"\"\\"", "\[Rule]",
RowBox[{"{", "4", "}"}]}], "]"}]}]], "Input",
CellID->1122403174],
Cell[BoxData[
InterpretationBox[
RowBox[{
TagBox["SummationLayer",
"SummaryHead"], "[",
DynamicModuleBox[{Typeset`open$$ = False},
PanelBox[
PaneSelectorBox[{False->GridBox[{
{
PaneBox[
ButtonBox[
DynamicBox[FEPrivate`FrontEndResource[
"FEBitmaps", "SquarePlusIconMedium"],
ImageSizeCache->{12., {0., 12.}}],
Appearance->None,
ButtonFunction:>(Typeset`open$$ = True),
Evaluator->Automatic,
Method->"Preemptive"],
Alignment->{Center, Center},
ImageSize->
Dynamic[{
Automatic,
3.5 (CurrentValue["FontCapHeight"]/AbsoluteCurrentValue[
Magnification])}]],
GraphicsBox[{
{Opacity[
0.3], {LineBox[
NCache[{{0, 0}, {Rational[-1, 2], 1}}, {{0, 0}, {-0.5, 1}}]],
LineBox[NCache[{{0, 0}, {Rational[1, 2], 1}}, {{0, 0}, {
0.5, 1}}]],
LineBox[NCache[{{0, 0}, {Rational[3, 2], 1}}, {{0, 0}, {
1.5, 1}}]]}, {
LineBox[NCache[{{1, 0}, {Rational[-1, 2], 1}}, {{1,
0}, {-0.5, 1}}]],
LineBox[NCache[{{1, 0}, {Rational[1, 2], 1}}, {{1, 0}, {
0.5, 1}}]],
LineBox[NCache[{{1, 0}, {Rational[3, 2], 1}}, {{1, 0}, {
1.5, 1}}]]}},
{AbsolutePointSize[5], PointBox[{{0, 0}, {1, 0}}],
PointBox[
NCache[{{Rational[-1, 2], 1}, {Rational[1, 2], 1}, {
Rational[3, 2], 1}}, {{-0.5, 1}, {0.5, 1}, {1.5, 1}}]]}},
ImageSize->32], GridBox[{
{
ItemBox[
StyleBox["\<\"Parameters:\"\>",
StripOnInput->False,
FontWeight->Bold],
StripOnInput->False],
ItemBox["\<\"\"\>",
StripOnInput->False]},
{
TagBox[
StyleBox[
TemplateBox[{"\"Dimensions\"","\":\""},
"RowDefault"], "SummaryItemAnnotation",
StripOnInput->False],
"SummaryItem"],
TagBox[
StyleBox[
RowBox[{"{", "4", "}"}], "SummaryItem",
StripOnInput->False],
"SummaryItem"]}
},
AutoDelete->False,
BaseStyle->{
ShowStringCharacters -> False, NumberMarks -> False,
PrintPrecision -> 3, ShowSyntaxStyles -> False},
GridBoxAlignment->{"Columns" -> {{Left}}, "Rows" -> {{Automatic}}},
GridBoxItemSize->{
"Columns" -> {{Automatic}}, "Rows" -> {{Automatic}}},
GridBoxSpacings->{"Columns" -> {{2}}, "Rows" -> {{Automatic}}}]}
},
AutoDelete->False,
BaselinePosition->{1, 1},
GridBoxAlignment->{"Rows" -> {{Top}}},
GridBoxItemSize->{
"Columns" -> {{Automatic}}, "Rows" -> {{Automatic}}}], True->
GridBox[{
{
PaneBox[
ButtonBox[
DynamicBox[FEPrivate`FrontEndResource[
"FEBitmaps", "SquareMinusIconMedium"]],
Appearance->None,
ButtonFunction:>(Typeset`open$$ = False),
Evaluator->Automatic,
Method->"Preemptive"],
Alignment->{Center, Center},
ImageSize->
Dynamic[{
Automatic,
3.5 (CurrentValue["FontCapHeight"]/AbsoluteCurrentValue[
Magnification])}]],
GraphicsBox[{
{Opacity[
0.3], {LineBox[
NCache[{{0, 0}, {Rational[-1, 2], 1}}, {{0, 0}, {-0.5, 1}}]],
LineBox[NCache[{{0, 0}, {Rational[1, 2], 1}}, {{0, 0}, {
0.5, 1}}]],
LineBox[NCache[{{0, 0}, {Rational[3, 2], 1}}, {{0, 0}, {
1.5, 1}}]]}, {
LineBox[NCache[{{1, 0}, {Rational[-1, 2], 1}}, {{1,
0}, {-0.5, 1}}]],
LineBox[NCache[{{1, 0}, {Rational[1, 2], 1}}, {{1, 0}, {
0.5, 1}}]],
LineBox[NCache[{{1, 0}, {Rational[3, 2], 1}}, {{1, 0}, {
1.5, 1}}]]}},
{AbsolutePointSize[5], PointBox[{{0, 0}, {1, 0}}],
PointBox[
NCache[{{Rational[-1, 2], 1}, {Rational[1, 2], 1}, {
Rational[3, 2], 1}}, {{-0.5, 1}, {0.5, 1}, {1.5, 1}}]]}},
ImageSize->32], GridBox[{
{
ItemBox[
StyleBox["\<\"Parameters:\"\>",
StripOnInput->False,
FontWeight->Bold],
StripOnInput->False],
ItemBox["\<\"\"\>",
StripOnInput->False]},
{
TagBox[
StyleBox[
TemplateBox[{"\"Dimensions\"","\":\""},
"RowDefault"], "SummaryItemAnnotation",
StripOnInput->False],
"SummaryItem"],
TagBox[
StyleBox[
RowBox[{"{", "4", "}"}], "SummaryItem",
StripOnInput->False],
"SummaryItem"]},
{
ItemBox[
StyleBox["\<\"Ports:\"\>",
StripOnInput->False,
FontWeight->Bold],
Frame->{{False, False}, {False, True}},
FrameStyle->GrayLevel[0.85],
StripOnInput->False],
ItemBox[
InterpretationBox[
StyleBox[
GraphicsBox[{},
BaselinePosition->(Scaled[0.] -> Baseline),
ImageSize->{1, 11}],
CacheGraphics->False],
Spacer[{1, 11}]],
Frame->{{False, False}, {False, True}},
FrameStyle->GrayLevel[0.85],
StripOnInput->False]},
{
TagBox[
StyleBox[
TemplateBox[{"\"Input\"","\":\""},
"RowDefault"], "SummaryItemAnnotation",
StripOnInput->False],
"SummaryItem"],
TagBox[
StyleBox[
TemplateBox[{
"\"vector\"","\" \"",
TemplateBox[{
"\"(\"", "\"\[VeryThinSpace]\"", "\"size\"", "\":\"",
"\" \"",
TemplateBox[{"\[Times]", "\"\[Times]\"", "\"4\""},
"RowWithSeparators"], "\"\[VeryThinSpace]\"", "\")\""},
"Row", DisplayFunction -> (RowBox[{
TemplateSlotSequence[1, "\[InvisibleSpace]"]}]& ),
InterpretationFunction -> (RowBox[{"Row", "[",
RowBox[{
RowBox[{"{",
TemplateSlotSequence[1, ","], "}"}], ",",
RowBox[{"BaseStyle", "\[Rule]",
InterpretationBox[
ButtonBox[
TooltipBox[
GraphicsBox[{{
GrayLevel[0],
RectangleBox[{0, 0}]}, {
GrayLevel[0],
RectangleBox[{1, -1}]}, {
GrayLevel[0.5],
RectangleBox[{0, -1}, {2, 1}]}}, AspectRatio -> 1, Frame ->
True, FrameStyle -> GrayLevel[0.33333333333333337`],
FrameTicks -> None, PlotRangePadding -> None, ImageSize ->
Dynamic[{Automatic,
1.35 (CurrentValue["FontCapHeight"]/AbsoluteCurrentValue[
Magnification])}]], "GrayLevel[0.5]"], Appearance -> None,
BaseStyle -> {}, BaselinePosition -> Baseline,
DefaultBaseStyle -> {}, ButtonFunction :>
With[{Typeset`box$ = EvaluationBox[]},
If[
Not[
AbsoluteCurrentValue["Deployed"]],
SelectionMove[Typeset`box$, All, Expression];
FrontEnd`Private`$ColorSelectorInitialAlpha = 1;
FrontEnd`Private`$ColorSelectorInitialColor =
GrayLevel[0.5];
FrontEnd`Private`$ColorSelectorUseMakeBoxes = True;
MathLink`CallFrontEnd[
FrontEnd`AttachCell[Typeset`box$,
FrontEndResource["GrayLevelColorValueSelector"], {
0, {Left, Bottom}}, {Left, Top},
"ClosingActions" -> {
"SelectionDeparture", "ParentChanged",
"EvaluatorQuit"}]]]], BaseStyle -> Inherited, Evaluator ->
Automatic, Method -> "Preemptive"],
GrayLevel[0.5], Editable -> False, Selectable ->
False]}]}], "]"}]& ), BaseStyle -> GrayLevel[0.5]]},
"RowDefault"], "SummaryItem",
StripOnInput->False],
"SummaryItem"]},
{
TagBox[
StyleBox[
TemplateBox[{"\"Output\"","\":\""},
"RowDefault"], "SummaryItemAnnotation",
StripOnInput->False],
"SummaryItem"],
TagBox[
StyleBox["\<\"scalar\"\>", "SummaryItem",
StripOnInput->False],
"SummaryItem"]}
},
AutoDelete->False,
BaseStyle->{
ShowStringCharacters -> False, NumberMarks -> False,
PrintPrecision -> 3, ShowSyntaxStyles -> False},
GridBoxAlignment->{"Columns" -> {{Left}}, "Rows" -> {{Automatic}}},
GridBoxItemSize->{
"Columns" -> {{Automatic}}, "Rows" -> {{Automatic}}},
GridBoxSpacings->{"Columns" -> {{2}}, "Rows" -> {{Automatic}}}]}
},
AutoDelete->False,
BaselinePosition->{1, 1},
GridBoxAlignment->{"Rows" -> {{Top}}},
GridBoxItemSize->{
"Columns" -> {{Automatic}}, "Rows" -> {{Automatic}}}]}, Dynamic[
Typeset`open$$],
ImageSize->Automatic],
BaselinePosition->Baseline],
DynamicModuleValues:>{}], "]"}],
None,
Editable->False,
SelectWithContents->True,
Selectable->False]], "Output",
ImageSize->{286, 47},
ImageMargins->{{0, 0}, {0, 0}},
ImageRegion->{{0, 1}, {0, 1}},
CellID->369507319]
}, Open ]],
Cell[CellGroupData[{
Cell[BoxData[
RowBox[{"sum", "[",
RowBox[{"{",
RowBox[{"1", ",", "2", ",", "3", ",",
RowBox[{"-", "0.3"}]}], "}"}], "]"}]], "Input",
CellID->278164154],
Cell[BoxData["5.699999809265137`"], "Output",
ImageSize->{26, 16},
ImageMargins->{{0, 0}, {0, 0}},
ImageRegion->{{0, 1}, {0, 1}},
CellID->1175118399]
}, Open ]],
Cell[CellGroupData[{
Cell[BoxData[
RowBox[{"sum", "[",
RowBox[{"{",
RowBox[{
RowBox[{"{",
RowBox[{"1", ",", "2", ",", "3", ",",
RowBox[{"-", "0.3"}]}], "}"}], ",",
RowBox[{"{",
RowBox[{"0.1", ",", "0.2", ",",
RowBox[{"-", "0.23"}], ",", "2.3"}], "}"}]}], "}"}], "]"}]], "Input",
CellID->1038559828],
Cell[BoxData[
RowBox[{"{",
RowBox[{"5.699999809265137`", ",", "2.369999885559082`"}], "}"}]], "Output",\
ImageSize->{80, 16},
ImageMargins->{{0, 0}, {0, 0}},
ImageRegion->{{0, 1}, {0, 1}},
CellID->144828869]
}, Open ]],
Cell[BoxData[
RowBox[{
RowBox[{"sum", "[", "data_", "]"}], ":=",
RowBox[{"Total", "[",
RowBox[{"data", ",", "Infinity"}], "]"}]}]], "Input",
CellID->733790170],
Cell[CellGroupData[{
Cell[BoxData[{
RowBox[{
RowBox[{"data", "=",
RowBox[{"{",
RowBox[{"{",
RowBox[{"{",
RowBox[{"2.2", ",", "3.4", ",", "4"}], "}"}], "}"}], "}"}]}],
";"}], "\[IndentingNewLine]",
RowBox[{
RowBox[{"SummationLayer", "[", "]"}], "@",
"data"}], "\[IndentingNewLine]",
RowBox[{"sum", "@", "data"}]}], "Input",
CellID->129330514],
Cell[BoxData["9.600000381469727`"], "Output",
ImageSize->{26, 16},
ImageMargins->{{0, 0}, {0, 0}},
ImageRegion->{{0, 1}, {0, 1}},
CellID->1277456163]
}, Open ]]
}, Open ]],
Cell[CellGroupData[{
Cell["En(De)coders", "Section",
CellChangeTimes->{{3.6883279797291403`*^9, 3.688328002996376*^9}, {
3.688331581441991*^9, 3.688331595405761*^9}, {3.6883395373577414`*^9,
3.6883396070377197`*^9}}],
Cell[CellGroupData[{
Cell["The Scalar decoder", "Subsection",
CellChangeTimes->{{3.688339547437419*^9, 3.688339552067986*^9}, {
3.688384995473065*^9, 3.688384996307343*^9}}],
Cell[CellGroupData[{
Cell[BoxData[
RowBox[{"enc", "=",
RowBox[{"NetEncoder", "[", "\"\\"", "]"}]}]], "Input",
CellID->1446305602],
Cell[BoxData[
TagBox[
TemplateBox[{RowBox[{
StyleBox[
TagBox["NetEncoder", "SummaryHead"], "NonInterpretableSummary"],
StyleBox["[", "NonInterpretableSummary"],
DynamicModuleBox[{Typeset`open$$ = False},
PanelBox[
PaneSelectorBox[{False -> GridBox[{{
GridBox[{{
TagBox[
StyleBox[
TemplateBox[{"\"Type\"", "\":\""}, "RowDefault"],
"SummaryItemAnnotation", StripOnInput -> False],
"SummaryItem"],
TagBox[
StyleBox[
"\"Scalar\"", "SummaryItem", StripOnInput -> False],
"SummaryItem"]}},
GridBoxAlignment -> {
"Columns" -> {{Left}}, "Rows" -> {{Automatic}}}, AutoDelete ->
False, GridBoxItemSize -> {
"Columns" -> {{Automatic}}, "Rows" -> {{Automatic}}},
GridBoxSpacings -> {
"Columns" -> {{2}}, "Rows" -> {{Automatic}}},
BaseStyle -> {
ShowStringCharacters -> False, NumberMarks -> False,
PrintPrecision -> 3, ShowSyntaxStyles -> False}]}},
GridBoxAlignment -> {"Rows" -> {{Top}}}, AutoDelete -> False,
GridBoxItemSize -> {
"Columns" -> {{Automatic}}, "Rows" -> {{Automatic}}},
BaselinePosition -> {1, 1}], True -> GridBox[{{
GridBox[{{
TagBox[
StyleBox[
TemplateBox[{"\"Type\"", "\":\""}, "RowDefault"],
"SummaryItemAnnotation", StripOnInput -> False],
"SummaryItem"],
TagBox[
StyleBox[
"\"Scalar\"", "SummaryItem", StripOnInput -> False],
"SummaryItem"]}},
GridBoxAlignment -> {
"Columns" -> {{Left}}, "Rows" -> {{Automatic}}}, AutoDelete ->
False, GridBoxItemSize -> {
"Columns" -> {{Automatic}}, "Rows" -> {{Automatic}}},
GridBoxSpacings -> {
"Columns" -> {{2}}, "Rows" -> {{Automatic}}},
BaseStyle -> {
ShowStringCharacters -> False, NumberMarks -> False,
PrintPrecision -> 3, ShowSyntaxStyles -> False}]}},
GridBoxAlignment -> {"Rows" -> {{Top}}}, AutoDelete -> False,
GridBoxItemSize -> {
"Columns" -> {{Automatic}}, "Rows" -> {{Automatic}}},
BaselinePosition -> {1, 1}]},
Dynamic[Typeset`open$$], ImageSize -> Automatic], BaselinePosition ->
Baseline], DynamicModuleValues :> {}],
StyleBox["]", "NonInterpretableSummary"]}]},
"CopyTag",
DisplayFunction->(#& ),
InterpretationFunction->("None"& )],
False,
Editable->False,
SelectWithContents->True,
Selectable->False]], "Output",
ImageSize->{182, 33},
ImageMargins->{{0, 0}, {0, 0}},
ImageRegion->{{0, 1}, {0, 1}},
CellID->1081552711]
}, Open ]],
Cell[CellGroupData[{
Cell[BoxData[
RowBox[{"enc", "[", "Pi", "]"}]], "Input",
CellID->971407122],
Cell[BoxData[
RowBox[{"{", "3.141592653589793`", "}"}]], "Output",
ImageSize->{68, 16},
ImageMargins->{{0, 0}, {0, 0}},
ImageRegion->{{0, 1}, {0, 1}},
CellID->2051087927]
}, Open ]],
Cell[CellGroupData[{
Cell[BoxData[
RowBox[{"enc", "[",
RowBox[{"Range", "[", "10", "]"}], "]"}]], "Input",
CellID->755574187],
Cell[BoxData[
RowBox[{"{",
RowBox[{
RowBox[{"{", "1.`", "}"}], ",",
RowBox[{"{", "2.`", "}"}], ",",
RowBox[{"{", "3.`", "}"}], ",",
RowBox[{"{", "4.`", "}"}], ",",
RowBox[{"{", "5.`", "}"}], ",",
RowBox[{"{", "6.`", "}"}], ",",
RowBox[{"{", "7.`", "}"}], ",",
RowBox[{"{", "8.`", "}"}], ",",
RowBox[{"{", "9.`", "}"}], ",",
RowBox[{"{", "10.`", "}"}]}], "}"}]], "Output",
ImageSize->{405, 16},
ImageMargins->{{0, 0}, {0, 0}},
ImageRegion->{{0, 1}, {0, 1}},
CellID->1139809754]
}, Open ]]
}, Open ]],
Cell[CellGroupData[{
Cell["The Boolean decoder", "Subsection",
CellChangeTimes->{{3.688339547437419*^9, 3.688339552067986*^9}, {
3.6883850555897703`*^9, 3.688385057042735*^9}}],
Cell[CellGroupData[{
Cell[BoxData[
RowBox[{"enc", "=",
RowBox[{"NetEncoder", "[", "\"\\"", "]"}]}]], "Input",
CellID->1978013041],
Cell[BoxData[
TagBox[
TemplateBox[{RowBox[{
StyleBox[
TagBox["NetEncoder", "SummaryHead"], "NonInterpretableSummary"],
StyleBox["[", "NonInterpretableSummary"],
DynamicModuleBox[{Typeset`open$$ = False},
PanelBox[
PaneSelectorBox[{False -> GridBox[{{
GridBox[{{
TagBox[
StyleBox[
TemplateBox[{"\"Type\"", "\":\""}, "RowDefault"],
"SummaryItemAnnotation", StripOnInput -> False],
"SummaryItem"],
TagBox[
StyleBox[
"\"Boolean\"", "SummaryItem", StripOnInput -> False],
"SummaryItem"]}},
GridBoxAlignment -> {
"Columns" -> {{Left}}, "Rows" -> {{Automatic}}}, AutoDelete ->
False, GridBoxItemSize -> {
"Columns" -> {{Automatic}}, "Rows" -> {{Automatic}}},
GridBoxSpacings -> {
"Columns" -> {{2}}, "Rows" -> {{Automatic}}},
BaseStyle -> {
ShowStringCharacters -> False, NumberMarks -> False,
PrintPrecision -> 3, ShowSyntaxStyles -> False}]}},
GridBoxAlignment -> {"Rows" -> {{Top}}}, AutoDelete -> False,
GridBoxItemSize -> {
"Columns" -> {{Automatic}}, "Rows" -> {{Automatic}}},
BaselinePosition -> {1, 1}], True -> GridBox[{{
GridBox[{{
TagBox[
StyleBox[
TemplateBox[{"\"Type\"", "\":\""}, "RowDefault"],
"SummaryItemAnnotation", StripOnInput -> False],
"SummaryItem"],
TagBox[
StyleBox[
"\"Boolean\"", "SummaryItem", StripOnInput -> False],
"SummaryItem"]}},
GridBoxAlignment -> {
"Columns" -> {{Left}}, "Rows" -> {{Automatic}}}, AutoDelete ->
False, GridBoxItemSize -> {
"Columns" -> {{Automatic}}, "Rows" -> {{Automatic}}},
GridBoxSpacings -> {
"Columns" -> {{2}}, "Rows" -> {{Automatic}}},
BaseStyle -> {
ShowStringCharacters -> False, NumberMarks -> False,
PrintPrecision -> 3, ShowSyntaxStyles -> False}]}},
GridBoxAlignment -> {"Rows" -> {{Top}}}, AutoDelete -> False,
GridBoxItemSize -> {
"Columns" -> {{Automatic}}, "Rows" -> {{Automatic}}},
BaselinePosition -> {1, 1}]},
Dynamic[Typeset`open$$], ImageSize -> Automatic], BaselinePosition ->
Baseline], DynamicModuleValues :> {}],
StyleBox["]", "NonInterpretableSummary"]}]},
"CopyTag",
DisplayFunction->(#& ),
InterpretationFunction->("None"& )],
False,
Editable->False,
SelectWithContents->True,
Selectable->False]], "Output",
ImageSize->{190, 33},
ImageMargins->{{0, 0}, {0, 0}},
ImageRegion->{{0, 1}, {0, 1}},
CellID->280962716]
}, Open ]],
Cell[CellGroupData[{
Cell[BoxData[
RowBox[{"enc", "@",
RowBox[{"{",
RowBox[{"False", ",", "True", ",", "False", ",", "False"}],
"}"}]}]], "Input",
CellID->1076605493],
Cell[BoxData[
RowBox[{"{",
RowBox[{"0", ",", "1", ",", "0", ",", "0"}], "}"}]], "Output",
ImageSize->{79, 16},
ImageMargins->{{0, 0}, {0, 0}},
ImageRegion->{{0, 1}, {0, 1}},
CellID->1171689112]
}, Open ]]
}, Open ]],
Cell[CellGroupData[{
Cell["The Class decoder", "Subsection",
CellChangeTimes->{{3.688339547437419*^9, 3.688339552067986*^9}}],
Cell[CellGroupData[{
Cell[BoxData[
RowBox[{"net", "=",
RowBox[{"NetGraph", "[",
RowBox[{
RowBox[{"{",
RowBox[{"Ramp", ",",
RowBox[{"SoftmaxLayer", "[", "]"}]}], "}"}], ",",
RowBox[{"{",
RowBox[{"1", "\[Rule]", "2"}], "}"}], ",",
RowBox[{"\"\