The MNIST dataset.
More...
#include <mnist.h>
|
| enum | Mode { kTrain,
kTest
} |
| | The mode in which the dataset is loaded.
|
| |
|
using | ExampleType = Example<> |
| |
|
using | SelfType = MNIST |
| |
|
using | BatchType = std::vector< Example<> > |
| |
|
using | BatchRequestType = ArrayRef< size_t > |
| |
|
| | MNIST (const std::string &root, Mode mode=Mode::kTrain) |
| | Loads the MNIST dataset from the root path. More...
|
| |
|
Example | get (size_t index) override |
| | Returns the Example at the given index.
|
| |
|
optional< size_t > | size () const override |
| | Returns the size of the dataset.
|
| |
|
bool | is_train () const noexcept |
| | Returns true if this is the training subset of MNIST.
|
| |
|
const Tensor & | images () const |
| | Returns all images stacked into a single tensor.
|
| |
|
const Tensor & | targets () const |
| | Returns all targets stacked into a single tensor.
|
| |
| std::vector< ExampleType > | get_batch (ArrayRef< size_t > indices) override |
| | Returns a batch of data. More...
|
| |
|
MapDataset< MNIST, TransformType > | map (TransformType transform)& |
| | Creates a MapDataset that applies the given transform to this dataset.
|
| |
|
MapDataset< MNIST, TransformType > | map (TransformType transform)&& |
| | Creates a MapDataset that applies the given transform to this dataset.
|
| |
|
|
static constexpr bool | is_stateful |
| |
The MNIST dataset.
Definition at line 16 of file mnist.h.
| torch::data::datasets::MNIST::MNIST |
( |
const std::string & |
root, |
|
|
Mode |
mode = Mode::kTrain |
|
) |
| |
|
explicit |
The documentation for this class was generated from the following files:
- torch/csrc/api/include/torch/data/datasets/mnist.h
- torch/csrc/api/src/data/datasets/mnist.cpp