(* Content-type: application/vnd.wolfram.mathematica *) (*** Wolfram Notebook File ***) (* http://www.wolfram.com/nb *) (* CreatedBy='Mathematica 11.3' *) (*CacheID: 234*) (* Internal cache information: NotebookFileLineBreakTest NotebookFileLineBreakTest NotebookDataPosition[ 158, 7] NotebookDataLength[ 7843, 210] NotebookOptionsPosition[ 5950, 165] NotebookOutlinePosition[ 6258, 180] CellTagsIndexPosition[ 6215, 177] WindowFrame->Normal*) (* Beginning of Notebook Content *) Notebook[{ Cell[CellGroupData[{ Cell[TextData[{ StyleBox["Construction Notebook for:", FontSize->24], "\nGloVe 300-Dimensional Word Vectors Trained on Wikipedia and Gigaword 5 \ Data" }], "Title", CellChangeTimes->{{3.700390059931024*^9, 3.700390069370269*^9}, { 3.713527335930427*^9, 3.71352733920855*^9}, 3.713530361022579*^9, { 3.713530682724009*^9, 3.713530695815112*^9}, {3.713530785596238*^9, 3.713530812060341*^9}, {3.7135309453815937`*^9, 3.713530948869219*^9}, { 3.713531002597712*^9, 3.7135310397811537`*^9}, {3.713536112065014*^9, 3.713536118207741*^9}, {3.7135374284994097`*^9, 3.7135374476513844`*^9}, { 3.7245096230673847`*^9, 3.724509623208768*^9}}], Cell[CellGroupData[{ Cell["NetModel Access", "Subsection", CellChangeTimes->{{3.695474314080426*^9, 3.695474346087426*^9}}], Cell[CellGroupData[{ Cell["This Notebook", "Subsubsection", CellChangeTimes->{{3.6954750910664797`*^9, 3.695475092737351*^9}}], Cell[BoxData[ RowBox[{"NetModel", "[", RowBox[{ "\"\\"", ",", "\"\\""}], "]"}]], "Input", CellChangeTimes->{{3.696656935596855*^9, 3.6966569364445457`*^9}, 3.696768427361453*^9, 3.696768595763381*^9, 3.700390080550715*^9, 3.713527332938039*^9, {3.713530362953845*^9, 3.7135303669448347`*^9}, { 3.7135306975162992`*^9, 3.713530702379608*^9}, 3.713530955656728*^9, { 3.713531005485937*^9, 3.713531040781562*^9}, 3.7135361256475353`*^9, { 3.7135374309956007`*^9, 3.7135374501621437`*^9}, 3.724509639028809*^9}, CellLabel->""] }, Open ]], Cell[CellGroupData[{ Cell["Untrained Net", "Subsubsection", CellChangeTimes->{{3.6954750978333807`*^9, 3.695475133273511*^9}}], Cell[BoxData[ RowBox[{"NetModel", "[", RowBox[{ "\"\\"", ",", "\"\\""}], "]"}]], "Input", CellChangeTimes->{{3.696656940213286*^9, 3.6966569411083603`*^9}, 3.6967685960955133`*^9, 3.700390083629743*^9, {3.713527345914727*^9, 3.713527346642221*^9}, 3.713530370686832*^9, 3.7135307053541803`*^9, 3.713530959004366*^9, {3.713531006330868*^9, 3.713531041486093*^9}, 3.713536130161717*^9, {3.713537432867531*^9, 3.713537451410375*^9}, 3.7245096375421257`*^9}, CellLabel->""] }, Open ]], Cell[CellGroupData[{ Cell["Trained Net", "Subsubsection", CellChangeTimes->{{3.6954751072255173`*^9, 3.6954751086815357`*^9}}], Cell[BoxData[ RowBox[{"NetModel", "[", "\"\\"", "]"}]], "Input", CellChangeTimes->{{3.6966569441649303`*^9, 3.696656946349728*^9}, 3.696768596439824*^9, 3.70039008606037*^9, 3.713527350999201*^9, 3.713530372099915*^9, 3.713530707350834*^9, 3.713530960248189*^9, { 3.713531007434894*^9, 3.7135310423651257`*^9}, 3.713536133747809*^9, { 3.713537433891096*^9, 3.713537452426641*^9}, 3.724509637545866*^9}, CellLabel->""] }, Open ]] }, Open ]], Cell[CellGroupData[{ Cell["Net Construction", "Section", CellChangeTimes->{3.695625386014464*^9}], Cell[CellGroupData[{ Cell["Parameter Settings", "Subsection", CellChangeTimes->{{3.695474640360228*^9, 3.695474641776113*^9}}], Cell[BoxData[ RowBox[{ RowBox[{"gloveTokens", "=", RowBox[{ RowBox[{"NetExtract", "[", RowBox[{ RowBox[{"NetModel", "[", RowBox[{ "\"\\"", ",", "\"\\""}], "]"}], ",", "\"\\""}], "]"}], "[", RowBox[{"[", "\"\\"", "]"}], "]"}]}], ";"}]], "Input", CellChangeTimes->{{3.713527466915866*^9, 3.7135275033391542`*^9}, 3.71353038346072*^9, {3.71353050413076*^9, 3.713530504898053*^9}, 3.713530631504019*^9, 3.713530710594427*^9, 3.713530963393332*^9, { 3.71353100922122*^9, 3.71353104384626*^9}, 3.713536144908391*^9, 3.713536517470377*^9, 3.7135374025713577`*^9, {3.713537436298829*^9, 3.713537454026615*^9}, 3.7245096375486307`*^9}, CellLabel->"In[6]:="] }, Open ]], Cell[CellGroupData[{ Cell["Final Net", "Subsection", CellChangeTimes->{{3.695106779945572*^9, 3.695106780985426*^9}}], Cell[BoxData[ RowBox[{"glove", "=", RowBox[{"EmbeddingLayer", "[", RowBox[{"300", ",", RowBox[{"\"\\"", "\[Rule]", RowBox[{"NetEncoder", "[", RowBox[{"{", RowBox[{"\"\\"", ",", "gloveTokens", ",", RowBox[{"IgnoreCase", "\[Rule]", "True"}]}], "}"}], "]"}]}]}], "]"}]}]], "Input", CellChangeTimes->{{3.713527514677994*^9, 3.713527575009603*^9}, { 3.713530510522636*^9, 3.713530513394473*^9}, {3.713530596627226*^9, 3.713530599642223*^9}, {3.713530735657646*^9, 3.713530739531332*^9}, { 3.713530972238109*^9, 3.71353097230132*^9}, {3.713531011557581*^9, 3.7135310515903883`*^9}, {3.713536160908852*^9, 3.713536160973802*^9}, { 3.7135374384994383`*^9, 3.713537455130053*^9}}, CellLabel->""] }, Open ]] }, Open ]], Cell[CellGroupData[{ Cell["Training", "Section", CellChangeTimes->{{3.695474798960601*^9, 3.69547479969661*^9}}], Cell["(Performed separately)", "Text", CellChangeTimes->{{3.695474856418449*^9, 3.695474863168799*^9}, { 3.7003902300515137`*^9, 3.7003902345796556`*^9}, {3.7135276003953753`*^9, 3.713527600730994*^9}}] }, Open ]] }, Open ]] }, WindowSize->Automatic, WindowMargins->Automatic, FrontEndVersion->"11.3 for Linux x86 (64-bit) (March 6, 2018)", StyleDefinitions->"Default.nb" ] (* End of Notebook Content *) (* Internal cache information *) (*CellTagsOutline CellTagsIndex->{} *) (*CellTagsIndex CellTagsIndex->{} *) (*NotebookFileOutline Notebook[{ Cell[CellGroupData[{ Cell[580, 22, 657, 12, 70, "Title",ExpressionUUID->"d850d8a1-33e7-4336-b70c-7c4c5208e6fc"], Cell[CellGroupData[{ Cell[1262, 38, 103, 1, 70, "Subsection",ExpressionUUID->"04766f6e-69e2-4a0b-ab2b-18e68f38024a"], Cell[CellGroupData[{ Cell[1390, 43, 106, 1, 70, "Subsubsection",ExpressionUUID->"62cea630-1e85-4836-b77f-ede9d9db3d34"], Cell[1499, 46, 650, 11, 70, "Input",ExpressionUUID->"f48a57b9-1078-4f57-9960-421bb92806ce"] }, Open ]], Cell[CellGroupData[{ Cell[2186, 62, 106, 1, 70, "Subsubsection",ExpressionUUID->"3fd96871-8bd0-4cd9-9a45-74fc0d446b00"], Cell[2295, 65, 606, 11, 70, "Input",ExpressionUUID->"27450b2c-7e84-4044-bc0d-08f38025b4f8"] }, Open ]], Cell[CellGroupData[{ Cell[2938, 81, 106, 1, 70, "Subsubsection",ExpressionUUID->"de753c18-78ec-40c9-8db6-917a33bff7b8"], Cell[3047, 84, 517, 9, 70, "Input",ExpressionUUID->"117f79e2-6a7e-4c97-9cd1-194b22be4978"] }, Open ]] }, Open ]], Cell[CellGroupData[{ Cell[3613, 99, 77, 1, 70, "Section",ExpressionUUID->"9f2dc913-d9f5-4dc3-8a72-b887aacdd048"], Cell[CellGroupData[{ Cell[3715, 104, 106, 1, 70, "Subsection",ExpressionUUID->"8a399e45-59b6-4658-86bf-4415f1555fd7"], Cell[3824, 107, 845, 18, 70, "Input",ExpressionUUID->"e08446f0-b7ba-434b-aa41-45561f288dc3"] }, Open ]], Cell[CellGroupData[{ Cell[4706, 130, 97, 1, 70, "Subsection",ExpressionUUID->"e73f0ee0-a315-438e-8e67-ddd7140794f9"], Cell[4806, 133, 764, 16, 70, "Input",ExpressionUUID->"4b81c7ec-15fd-4132-ab4c-5fb41b20d2e5"] }, Open ]] }, Open ]], Cell[CellGroupData[{ Cell[5619, 155, 92, 1, 70, "Section",ExpressionUUID->"c5082afb-7daa-4c90-a495-e9daac198056"], Cell[5714, 158, 208, 3, 70, "Text",ExpressionUUID->"55f7622a-549f-4c4f-a77b-504eb503d680"] }, Open ]] }, Open ]] } ] *) (* End of internal cache information *)