mnist

package
v3.0.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 5, 2024 License: MIT Imports: 7 Imported by: 0

README

MNIST Dataset

The dataset itself is not included in the repository. Run download.sh in the data subdirectory to download the data.

Documentation

Overview

Package mnist provides an interface to read the MNIST interface.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DataSet

type DataSet struct {
	// contains filtered or unexported fields
}

The DataSet can provide MNIST data.

func (DataSet) HasNext

func (d DataSet) HasNext() bool

HasNext returns true if there are more images in the dataset.

func (*DataSet) Next

func (d *DataSet) Next() (image []byte, label byte)

Next returns the next image and label. It panics if there is no more images in the dataset.

func (*DataSet) OpenTestFile

func (d *DataSet) OpenTestFile()

OpenTestFile opens the files for training.

func (*DataSet) OpenTrainingFile

func (d *DataSet) OpenTrainingFile()

OpenTrainingFile opens the files for training.

type DataSource

type DataSource struct {
	// contains filtered or unexported fields
}

A DataSource provides convenient solution to feed data to neural networks.

func NewTestDataSource

func NewTestDataSource(to tensor.Operator) *DataSource

NewTestDataSource creates a DataSource object that fetches data from the test set.

func NewTrainingDataSource

func NewTrainingDataSource(to tensor.Operator) *DataSource

NewTrainingDataSource returns a DataSource object that fetches data from the training set.

func (*DataSource) NextBatch

func (ds *DataSource) NextBatch(batchSize int) (
	data tensor.Tensor,
	label []int,
)

NextBatch returns another batch of data.

func (*DataSource) Rewind

func (ds *DataSource) Rewind()

Rewind resets the pointer to the beginning of the dataset.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL