Class MNIST#
Defined in File mnist.h
Page Contents
Inheritance Relationships#
Base Type#
public torch::data::datasets::Dataset< MNIST >
(Template Class Dataset)
Class Documentation#
-
class MNIST : public torch::data::datasets::Dataset<MNIST>#
The MNIST dataset.
Public Types
Public Functions
-
explicit MNIST(const std::string &root, Mode mode = Mode::kTrain)#
Loads the MNIST dataset from the
root
path.The supplied
root
path should contain the content of the unzipped MNIST dataset, available from http://yann.lecun.com/exdb/mnist.
-
virtual std::optional<size_t> size() const override#
Returns the size of the dataset.
-
const Tensor &images() const#
Returns all images stacked into a single tensor.
-
const Tensor &targets() const#
Returns all targets stacked into a single tensor.
-
explicit MNIST(const std::string &root, Mode mode = Mode::kTrain)#