Documentation ¶
Index ¶
- Constants
- func Download() (err error)
- func FlattenImages(s *op.Scope, intImages tf.Output) (flattened tf.Output)
- func ImagesTest(s *op.Scope) (labels tf.Output)
- func ImagesTrain(s *op.Scope) (labels tf.Output)
- func InitCastImages(DstT tf.DataType) func(*op.Scope, tf.Output) tf.Output
- func InitOneHotLabels(DstT tf.DataType) func(s *op.Scope, intLabels tf.Output) tf.Output
- func LabelsTest(s *op.Scope) (labels tf.Output)
- func LabelsTrain(s *op.Scope) (labels tf.Output)
- func NextBatch(s *op.Scope, ...) (batchImages, batchLabels tf.Output, init *tf.Operation)
- func Quantize01Floats(s *op.Scope, floats tf.Output) (output quant.Output)
- func TrainingQueue(s *op.Scope) (label, image tf.Output, enqueue *tf.Operation)
Constants ¶
const BasePath = "mnist/"
BasePath is the dir to which mnist data is looked for and saved
Variables ¶
This section is empty.
Functions ¶
func FlattenImages ¶
FlattenImages turns a tensor of shape [?, 28, 28] into a tensor of shape [?, 784], and same shape
func ImagesTest ¶
ImagesTest returns an op to load the mnist training images from a file as [60000, 28, 28] uint8
func ImagesTrain ¶
ImagesTrain returns an op to load the mnist training images from a file as [60000, 28, 28] uint8
func InitCastImages ¶
InitCastImages turns int8 from 0-255, to dType type from 0-1 of same shape.
func InitOneHotLabels ¶
InitOneHotLabels converts int labels to oneHot encoded float arrays
func LabelsTest ¶
LabelsTest returns an op to load the mnist test labels from a file as [10000] uint8
func LabelsTrain ¶
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 ¶
Quantize01Floats quantizes float32 tensors between 0 and 1.
Types ¶
This section is empty.