pulsatrix
Loading...
Searching...
No Matches
audio_folder_dataset.hpp
Go to the documentation of this file.
1
5#pragma once
6
7#include <string>
8#include <vector>
9
10#include "pulsatrix/dataset.hpp"
12
13namespace pulsatrix {
14
22public:
27 AudioFolderDataset(const std::string& root_dir, DeviceBackend* backend);
28
29 [[nodiscard]] int64_t size() const override;
30
35 [[nodiscard]] Sample get(int64_t index) const override;
36
38 [[nodiscard]] const std::vector<std::string>& classes() const { return classes_; }
39
40private:
41 struct Entry {
42 std::string path;
43 int64_t label;
44 };
45
46 std::vector<Entry> entries_;
47 std::vector<std::string> classes_;
48 DeviceBackend* backend_;
49};
50
51} // namespace pulsatrix
Dataset over a directory tree of the form root_dir/<class_name>/<audio_file.wav>, structurally identi...
Definition audio_folder_dataset.hpp:21
const std::vector< std::string > & classes() const
Sorted class names; classes()[i] is the human-readable name for label i.
Definition audio_folder_dataset.hpp:38
int64_t size() const override
Number of samples in this dataset.
AudioFolderDataset(const std::string &root_dir, DeviceBackend *backend)
Sample get(int64_t index) const override
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
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 dataset sample: an ordered list of Tensor fields (e.g. {features, label} or {image,...
Definition dataset.hpp:19