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