Skip to content

boolka/mnistidx

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

mnistidx

Mnistidx module provides api to work with mnist databases.

Usage

package main

import (
	"os"
)

func main() {
	imagesFile, err := os.Open("filepath/to/images/database/file")

	if err != nil {
		panic(err)
	}

	labelsFile, err := os.Open("filepath/to/labels/database/file")

	if err != nil {
		panic(err)
	}

	i, err := mnistidx.NewIDX(imagesFile, labelsFile)

	if err != nil {
		panic(err)
	}

	buf := make([]byte, i.ImageBufSize())

	for {
		l, err := i.Read(buf)

		if err == io.EOF {
			break
		}

		// buf contains image
		// l represent current label
	}
}

Tests

If you run tests mnist databases automatically downloaded to ~/.mnistdb directory

Info

For additional info look at mnistdb

Releases

No releases published

Packages

No packages published

Languages