layer_8hpp_source.tex 5.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. \hypertarget{layer_8hpp_source}{}\doxysection{layer.\+hpp}
  2. \label{layer_8hpp_source}\index{src/layers/layer.hpp@{src/layers/layer.hpp}}
  3. \mbox{\hyperlink{layer_8hpp}{Go to the documentation of this file.}}
  4. \begin{DoxyCode}{0}
  5. \DoxyCodeLine{1 \textcolor{preprocessor}{\#ifndef LAYER\_HPP}}
  6. \DoxyCodeLine{2 \textcolor{preprocessor}{\#define LAYER\_HPP}}
  7. \DoxyCodeLine{3 }
  8. \DoxyCodeLine{4 \textcolor{preprocessor}{\#include "{}\mbox{\hyperlink{debug_8hpp}{debug.hpp}}"{}}}
  9. \DoxyCodeLine{5 \textcolor{preprocessor}{\#include "{}\mbox{\hyperlink{vector_8hpp}{vector.hpp}}"{}}}
  10. \DoxyCodeLine{6 \textcolor{preprocessor}{\#include "{}\mbox{\hyperlink{shape_8hpp}{shape.hpp}}"{}}}
  11. \DoxyCodeLine{7 \textcolor{preprocessor}{\#include <cmath>}}
  12. \DoxyCodeLine{8 }
  13. \DoxyCodeLine{9 \textcolor{keyword}{namespace }\mbox{\hyperlink{namespace_layer}{Layer}}\{}
  14. \DoxyCodeLine{20 \textcolor{keyword}{class }\mbox{\hyperlink{namespace_layer}{Layer}}\{}
  15. \DoxyCodeLine{21 \textcolor{keyword}{public}:}
  16. \DoxyCodeLine{23 \textcolor{keywordtype}{string} \mbox{\hyperlink{class_layer_1_1_layer_a4c1dfb78f590b010a7a1e11706eb12f5}{name}};}
  17. \DoxyCodeLine{24 }
  18. \DoxyCodeLine{26 \textcolor{keywordtype}{size\_t} \mbox{\hyperlink{class_layer_1_1_layer_a99d315d8bcc460de6feba4bdac77766c}{n}};}
  19. \DoxyCodeLine{27 }
  20. \DoxyCodeLine{29 \textcolor{keywordtype}{size\_t} \mbox{\hyperlink{class_layer_1_1_layer_a8d294cb3fc3d2970a2895ad8298d2e4d}{m}};}
  21. \DoxyCodeLine{30 }
  22. \DoxyCodeLine{32 \mbox{\hyperlink{vector_8hpp_ab9855a300a7759f4c0f85067d44e4c38}{Vector}} \mbox{\hyperlink{class_layer_1_1_layer_af2ebcf019bc0e4b97f41fc9205706665}{x}};}
  23. \DoxyCodeLine{33 }
  24. \DoxyCodeLine{35 \mbox{\hyperlink{vector_8hpp_ab9855a300a7759f4c0f85067d44e4c38}{Vector}} \mbox{\hyperlink{class_layer_1_1_layer_acf6e43bdf3345739e8a2828a8c0606e7}{y}};}
  25. \DoxyCodeLine{36 }
  26. \DoxyCodeLine{38 \mbox{\hyperlink{vector_8hpp_ab9855a300a7759f4c0f85067d44e4c38}{Vector}} \mbox{\hyperlink{class_layer_1_1_layer_affe7f5de8693b4af67765a9286686d82}{d}};}
  27. \DoxyCodeLine{39 }
  28. \DoxyCodeLine{40 \mbox{\hyperlink{namespace_layer}{Layer}}(\textcolor{keywordtype}{size\_t} n,\textcolor{keywordtype}{size\_t} m);}
  29. \DoxyCodeLine{41 }
  30. \DoxyCodeLine{42 \mbox{\hyperlink{namespace_layer}{\string~Layer}}();}
  31. \DoxyCodeLine{43 }
  32. \DoxyCodeLine{45 \textcolor{keywordtype}{size\_t} get\_input\_size() \textcolor{keyword}{const};}
  33. \DoxyCodeLine{46 }
  34. \DoxyCodeLine{48 \textcolor{keywordtype}{size\_t} get\_output\_size() \textcolor{keyword}{const};}
  35. \DoxyCodeLine{49 }
  36. \DoxyCodeLine{51 \mbox{\hyperlink{vector_8hpp_ab9855a300a7759f4c0f85067d44e4c38}{Vector}} get\_output() \textcolor{keyword}{const};}
  37. \DoxyCodeLine{52 }
  38. \DoxyCodeLine{54 \textcolor{keyword}{virtual} \mbox{\hyperlink{vector_8hpp_ab9855a300a7759f4c0f85067d44e4c38}{Vector}} \mbox{\hyperlink{class_layer_1_1_layer_aeb5b92a01bc4e867d347bff4767e919f}{feed\_forward}}(\mbox{\hyperlink{vector_8hpp_ab9855a300a7759f4c0f85067d44e4c38}{Vector}} x)=0;}
  39. \DoxyCodeLine{55 }
  40. \DoxyCodeLine{57 \textcolor{keyword}{virtual} \textcolor{keywordtype}{void} \mbox{\hyperlink{class_layer_1_1_layer_a87dbd5d1c1091769ba285084bd3513e7}{init\_nabla}}()=0;}
  41. \DoxyCodeLine{58 }
  42. \DoxyCodeLine{61 \textcolor{keyword}{virtual} \mbox{\hyperlink{vector_8hpp_ab9855a300a7759f4c0f85067d44e4c38}{Vector}} \mbox{\hyperlink{class_layer_1_1_layer_ad9e2853fce56b014b1e9de5097e21dbd}{back\_propagation}}(\mbox{\hyperlink{vector_8hpp_ab9855a300a7759f4c0f85067d44e4c38}{Vector}} e)=0;}
  43. \DoxyCodeLine{62 }
  44. \DoxyCodeLine{64 \textcolor{keyword}{virtual} \textcolor{keywordtype}{void} \mbox{\hyperlink{class_layer_1_1_layer_a8f0801b946b94dfe856c57a632c9998f}{update}}(\mbox{\hyperlink{vector_8hpp_a4b04262b81aa7d31eb5d2f607e2a35de}{Real}} eta)=0;}
  45. \DoxyCodeLine{65 \};}
  46. \DoxyCodeLine{66 }
  47. \DoxyCodeLine{67 \textcolor{keyword}{inline}}
  48. \DoxyCodeLine{68 \mbox{\hyperlink{class_layer_1_1_layer}{Layer::Layer}}(\textcolor{keywordtype}{size\_t} n\_,\textcolor{keywordtype}{size\_t} m\_)\{}
  49. \DoxyCodeLine{69 n=n\_;}
  50. \DoxyCodeLine{70 m=m\_;}
  51. \DoxyCodeLine{71 y=\mbox{\hyperlink{vector_8hpp_a624100980bbf31adef9cc6bfd6e89738}{init\_vector}}(m);}
  52. \DoxyCodeLine{72 d=\mbox{\hyperlink{vector_8hpp_a624100980bbf31adef9cc6bfd6e89738}{init\_vector}}(n);}
  53. \DoxyCodeLine{73 \}}
  54. \DoxyCodeLine{74 }
  55. \DoxyCodeLine{75 \textcolor{keyword}{inline}}
  56. \DoxyCodeLine{76 Layer::\string~Layer()\{}
  57. \DoxyCodeLine{77 \mbox{\hyperlink{vector_8hpp_a34a7c651953c188bf41e94dee669ad70}{delete\_vector}}(y);}
  58. \DoxyCodeLine{78 \mbox{\hyperlink{vector_8hpp_a34a7c651953c188bf41e94dee669ad70}{delete\_vector}}(d);}
  59. \DoxyCodeLine{79 \}}
  60. \DoxyCodeLine{80 }
  61. \DoxyCodeLine{81 \textcolor{keyword}{inline} \textcolor{keywordtype}{size\_t}}
  62. \DoxyCodeLine{82 Layer::get\_input\_size()\textcolor{keyword}{ const}\{}
  63. \DoxyCodeLine{83 \textcolor{keywordflow}{return} n;}
  64. \DoxyCodeLine{84 \}}
  65. \DoxyCodeLine{85 }
  66. \DoxyCodeLine{86 \textcolor{keyword}{inline} \textcolor{keywordtype}{size\_t}}
  67. \DoxyCodeLine{87 Layer::get\_output\_size()\textcolor{keyword}{ const}\{}
  68. \DoxyCodeLine{88 \textcolor{keywordflow}{return} m;}
  69. \DoxyCodeLine{89 \}}
  70. \DoxyCodeLine{90 }
  71. \DoxyCodeLine{91 \textcolor{keyword}{inline} \mbox{\hyperlink{vector_8hpp_ab9855a300a7759f4c0f85067d44e4c38}{Vector}}}
  72. \DoxyCodeLine{92 Layer::get\_output()\textcolor{keyword}{ const}\{}
  73. \DoxyCodeLine{93 \textcolor{keywordflow}{return} y;}
  74. \DoxyCodeLine{94 \}}
  75. \DoxyCodeLine{95 \}}
  76. \DoxyCodeLine{96 }
  77. \DoxyCodeLine{97 \textcolor{preprocessor}{\#endif}}
  78. \end{DoxyCode}