imagenet

package
v3.0.1 Latest Latest
Warning

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

Go to latest
Published: Mar 13, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Overview

Package imagenet provides an interface to read the imagenet 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 imagenet data.

func NewDataSet

func NewDataSet(isTrain bool) *DataSet

NewDataSet creates a new imagenet dataset.

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() (imageData []byte, labelData byte)

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

func (*DataSet) Reset

func (d *DataSet) Reset()

Reset lets the dataset to read from the beginning.

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