Skip to content
Snippets Groups Projects
Commit 3dd2b548 authored by Thibault Allenet's avatar Thibault Allenet
Browse files

Add getNbModalities function in MNIST

parent e126bf4d
No related branches found
No related tags found
No related merge requests found
......@@ -37,7 +37,6 @@ inline bool isBigEndian()
class MNIST : public Database {
public:
MNIST() = delete;
MNIST(const std::string& dataPath,
// const GraphView transformations,
bool train,
......@@ -65,6 +64,8 @@ public:
std::size_t getLen() override;
std::size_t getNbModalities() override;
union MagicNumber {
unsigned int value;
unsigned char byte[4];
......
......@@ -127,7 +127,7 @@ void Aidge::MNIST::uncompress(const std::string& dataPath,
std::vector<std::shared_ptr<Aidge::Tensor>> Aidge::MNIST::getItem(std::size_t index) {
std::vector<std::shared_ptr<Tensor>> item;
// Load the digit tensor
// TODO : Currently converts the tensor Opencv but this operation will be carried by a convert operator later
// TODO : Currently converts the tensor Opencv but this operation will be carried by a convert operator in the preprocessing graph
item.push_back(Aidge::convertCpu((std::get<0>(mStimulis.at(index))).load()));
// item.push_back((std::get<0>(mStimulis.at(index))).load());
// Load the label tensor
......@@ -138,4 +138,9 @@ std::vector<std::shared_ptr<Aidge::Tensor>> Aidge::MNIST::getItem(std::size_t in
std::size_t Aidge::MNIST::getLen(){
return mStimulis.size();
}
std::size_t Aidge::MNIST::getNbModalities(){
size_t tupleSize = std::tuple_size<decltype(mStimulis)::value_type>::value;
return tupleSize;
}
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment