mnist

package
v0.0.0-...-1bcdb33 Latest Latest
Warning

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

Go to latest
Published: Feb 2, 2018 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const BasePath = "mnist/"

BasePath is the dir to which mnist data is looked for and saved

Variables

This section is empty.

Functions

func Download

func Download() (err error)

Download all the mnist data set

func FlattenImages

func FlattenImages(s *op.Scope, intImages tf.Output) (flattened tf.Output)

FlattenImages turns a tensor of shape [?, 28, 28] into a tensor of shape [?, 784], and same shape

func ImagesTest

func ImagesTest(s *op.Scope) (labels tf.Output)

ImagesTest returns an op to load the mnist training images from a file as [60000, 28, 28] uint8

func ImagesTrain

func ImagesTrain(s *op.Scope) (labels tf.Output)

ImagesTrain returns an op to load the mnist training images from a file as [60000, 28, 28] uint8

func InitCastImages

func InitCastImages(DstT tf.DataType) func(*op.Scope, tf.Output) tf.Output

InitCastImages turns int8 from 0-255, to dType type from 0-1 of same shape.

func InitOneHotLabels

func InitOneHotLabels(DstT tf.DataType) func(s *op.Scope, intLabels tf.Output) tf.Output

InitOneHotLabels converts int labels to oneHot encoded float arrays

func LabelsTest

func LabelsTest(s *op.Scope) (labels tf.Output)

LabelsTest returns an op to load the mnist test labels from a file as [10000] uint8

func LabelsTrain

func LabelsTrain(s *op.Scope) (labels tf.Output)

LabelsTrain returns an op to load the mnist training labels from a file as [60000] uint8

func NextBatch

func NextBatch(s *op.Scope, imagesTransform, labelsTransform func(*op.Scope, tf.Output) tf.Output, n int64, seed int64) (batchImages, batchLabels tf.Output, init *tf.Operation)

NextBatch returns a data set of random minibatches of size n of pairs of labels and images. It is equivalent to mnist.train.next_batch(n) in the python mnist lib. imagesTransform transforms images. If nil, float32 28x28 are returned. labelsTransform transforms labels. If nil, onehot floats are returned. Deterministic if seed is non 0. If 0, random seed is used.

func Quantize01Floats

func Quantize01Floats(s *op.Scope, floats tf.Output) (output quant.Output)

Quantize01Floats quantizes float32 tensors between 0 and 1.

func TrainingQueue

func TrainingQueue(s *op.Scope) (label, image tf.Output, enqueue *tf.Operation)

TrainingQueue returns a queue of label - image pairs. You must run the enqueue OP at least once before using queue output.

Types

This section is empty.

Jump to

Keyboard shortcuts

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