pulsatrix
Loading...
Searching...
No Matches
csv_dataset.hpp
Go to the documentation of this file.
1
5#pragma once
6
7#include <string>
8#include <vector>
9
11#include "pulsatrix/dataset.hpp"
13
14namespace pulsatrix {
15
21class CsvDataset : public Dataset {
22public:
32 CsvDataset(const std::string& path, std::vector<std::string> feature_columns, std::string label_column,
33 DeviceBackend* backend);
34
35 [[nodiscard]] int64_t size() const override;
36
42 [[nodiscard]] Sample get(int64_t index) const override;
43
44private:
45 CsvTable table_;
46 std::vector<size_t> feature_col_indices_;
47 size_t label_col_index_;
48 DeviceBackend* backend_;
49};
50
51} // namespace pulsatrix
Dataset over a CSV file's numeric columns: N named feature columns -> one (1, num_features) Tensor pe...
Definition csv_dataset.hpp:21
int64_t size() const override
Number of samples in this dataset.
Sample get(int64_t index) const override
CsvDataset(const std::string &path, std::vector< std::string > feature_columns, std::string label_column, DeviceBackend *backend)
Random-access dataset abstraction – pulsatrix's analogue of PyTorch's torch.utils....
Definition dataset.hpp:33
Vendor-agnostic compute/memory backend. CPUBackend, CUDABackend (Phase 1.5), and HIPBackend (Phase 1....
Definition device_backend.hpp:219
Minimal hand-rolled CSV parser – RFC-4180-ish, whole-file-at-once.
Random-access dataset abstraction – Sample, Dataset (size()/get()).
Abstract interface isolating vendor-specific memory/compute operations from Tensor/ComputationGraph.
Definition acquisition_functions.hpp:16
One parsed CSV file's contents: raw string cells, row-major, plus an optional header.
Definition csv_reader.hpp:13
One dataset sample: an ordered list of Tensor fields (e.g. {features, label} or {image,...
Definition dataset.hpp:19