mnist_8hpp_source.tex 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. \hypertarget{mnist_8hpp_source}{}\doxysection{mnist.\+hpp}
  2. \label{mnist_8hpp_source}\index{src/mnist/mnist.hpp@{src/mnist/mnist.hpp}}
  3. \mbox{\hyperlink{mnist_8hpp}{Go to the documentation of this file.}}
  4. \begin{DoxyCode}{0}
  5. \DoxyCodeLine{1 \textcolor{preprocessor}{\#ifndef MNIST\_HPP}}
  6. \DoxyCodeLine{2 \textcolor{preprocessor}{\#define MNIST\_HPP}}
  7. \DoxyCodeLine{3 }
  8. \DoxyCodeLine{4 \textcolor{preprocessor}{\#include <iostream>}}
  9. \DoxyCodeLine{5 \textcolor{preprocessor}{\#include <string>}}
  10. \DoxyCodeLine{6 \textcolor{preprocessor}{\#include <fstream>}}
  11. \DoxyCodeLine{7 \textcolor{preprocessor}{\#include <cstdint>}}
  12. \DoxyCodeLine{8 }
  13. \DoxyCodeLine{9 \textcolor{preprocessor}{\#include "{}../dataset.hpp"{}}}
  14. \DoxyCodeLine{10 }
  15. \DoxyCodeLine{11 \textcolor{keyword}{using namespace }std;}
  16. \DoxyCodeLine{12 }
  17. \DoxyCodeLine{13 \textcolor{keyword}{class }\mbox{\hyperlink{class_mnist}{Mnist}}:\textcolor{keyword}{public} \mbox{\hyperlink{class_dataset}{Dataset}}\{}
  18. \DoxyCodeLine{14 \textcolor{keyword}{private}:}
  19. \DoxyCodeLine{15 \textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{char}* train\_labels;}
  20. \DoxyCodeLine{16 \textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{char}* test\_labels;}
  21. \DoxyCodeLine{17 \textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{char}* train\_images;}
  22. \DoxyCodeLine{18 \textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{char}* test\_images;}
  23. \DoxyCodeLine{19 \textcolor{keyword}{mutable} \mbox{\hyperlink{vector_8hpp_ab9855a300a7759f4c0f85067d44e4c38}{Vector}} x;}
  24. \DoxyCodeLine{20 \textcolor{keyword}{mutable} \mbox{\hyperlink{vector_8hpp_ab9855a300a7759f4c0f85067d44e4c38}{Vector}} y;}
  25. \DoxyCodeLine{21 \textcolor{keywordtype}{size\_t} load\_labels(\textcolor{keywordtype}{string} filename,\textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{char}** dst);}
  26. \DoxyCodeLine{22 \textcolor{keywordtype}{size\_t} load\_images(\textcolor{keywordtype}{string} filename,\textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{char}** dst);}
  27. \DoxyCodeLine{23 \textcolor{keywordtype}{int} reverse\_int32(\textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{char}* buffer);}
  28. \DoxyCodeLine{24 pair<Vector,Vector> get(\textcolor{keyword}{const} \textcolor{keywordtype}{size\_t} i,\textcolor{keyword}{const} \textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{char}* \textcolor{keyword}{const}* labels,\textcolor{keyword}{const} \textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{char}* \textcolor{keyword}{const} * images) \textcolor{keyword}{const};}
  29. \DoxyCodeLine{25 \textcolor{keyword}{public}:}
  30. \DoxyCodeLine{26 \mbox{\hyperlink{class_mnist_a4f6cda03c6bfed38f44c4752d702243b}{Mnist}}();}
  31. \DoxyCodeLine{27 pair<Vector,Vector> \mbox{\hyperlink{class_mnist_a33608fb1985e0af8b147c8de6101fdb1}{get\_train}}(\textcolor{keyword}{const} \textcolor{keywordtype}{size\_t} i) \textcolor{keyword}{const};}
  32. \DoxyCodeLine{28 pair<Vector,Vector> \mbox{\hyperlink{class_mnist_a743e0089d025c1be8322c81e99446c85}{get\_test}}(\textcolor{keyword}{const} \textcolor{keywordtype}{size\_t} i) \textcolor{keyword}{const};}
  33. \DoxyCodeLine{29 \};}
  34. \DoxyCodeLine{30 }
  35. \DoxyCodeLine{31 \textcolor{keyword}{inline} pair<Vector,Vector>}
  36. \DoxyCodeLine{32 \mbox{\hyperlink{class_mnist_a33608fb1985e0af8b147c8de6101fdb1}{Mnist::get\_train}}(\textcolor{keyword}{const} \textcolor{keywordtype}{size\_t} i)\textcolor{keyword}{ const}\{}
  37. \DoxyCodeLine{33 \mbox{\hyperlink{debug_8hpp_a3153a272f18d0f805028fce7e4337b53}{assert}}(i<\mbox{\hyperlink{class_dataset_a694f77fcd998ee4b91dad75d57b5d2ab}{train\_size}});}
  38. \DoxyCodeLine{34 \textcolor{keywordflow}{return} get(i,\&train\_labels,\&train\_images);}
  39. \DoxyCodeLine{35 \}}
  40. \DoxyCodeLine{36 }
  41. \DoxyCodeLine{37 \textcolor{keyword}{inline} pair<Vector,Vector>}
  42. \DoxyCodeLine{38 \mbox{\hyperlink{class_mnist_a743e0089d025c1be8322c81e99446c85}{Mnist::get\_test}}(\textcolor{keyword}{const} \textcolor{keywordtype}{size\_t} i)\textcolor{keyword}{ const}\{}
  43. \DoxyCodeLine{39 \mbox{\hyperlink{debug_8hpp_a3153a272f18d0f805028fce7e4337b53}{assert}}(i<\mbox{\hyperlink{class_dataset_ab69cb524866ef5b2d14a8a6701f5aea2}{test\_size}});}
  44. \DoxyCodeLine{40 \textcolor{keywordflow}{return} get(i,\&test\_labels,\&test\_images);}
  45. \DoxyCodeLine{41 \}}
  46. \DoxyCodeLine{42 \textcolor{preprocessor}{\#endif}}
  47. \end{DoxyCode}