pulsatrix
Loading...
Searching...
No Matches
mnist_loader.hpp
Go to the documentation of this file.
1
6#pragma once
7
8#include <cstdint>
9#include <string>
10#include <vector>
11
13#include "pulsatrix/tensor.hpp"
14
15namespace pulsatrix {
16
20 std::vector<Tensor> images;
22 std::vector<int64_t> labels;
23};
24
35public:
50 [[nodiscard]] static MnistDataset Load(const std::string& images_path, const std::string& labels_path,
51 DeviceBackend* backend, int64_t max_count = -1);
52};
53
54} // namespace pulsatrix
Vendor-agnostic compute/memory backend. CPUBackend, CUDABackend (Phase 1.5), and HIPBackend (Phase 1....
Definition device_backend.hpp:219
Reads MNIST's original IDX-format files directly – no format conversion, no generic Dataset abstracti...
Definition mnist_loader.hpp:34
static MnistDataset Load(const std::string &images_path, const std::string &labels_path, DeviceBackend *backend, int64_t max_count=-1)
Loads one images/labels IDX file pair.
Abstract interface isolating vendor-specific memory/compute operations from Tensor/ComputationGraph.
Definition acquisition_functions.hpp:16
One IDX file pair's contents: parallel images/labels, same length.
Definition mnist_loader.hpp:18
std::vector< Tensor > images
Shape (1, 28, 28), pixel values normalized to [0,1].
Definition mnist_loader.hpp:20
std::vector< int64_t > labels
0-9 class index, one per image, same order/length as images.
Definition mnist_loader.hpp:22
N-dimensional tensor – owns a buffer via DeviceBackend*, RAII (Rule of Five).