a01

package module
v0.0.0-...-62b5314 Latest Latest
Warning

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

Go to latest
Published: Apr 15, 2022 License: GPL-3.0 Imports: 10 Imported by: 0

README

a01

a Simple MNIST Loader written in Go

The MNIST files are included.

Just put the file path and get the raw data in form of [][]uint8 for images and []uint8 for labels.

These can be converted to Gonum-compatible data.

Also there is an img struct that can be converted to a jpeg

Documentation

Overview

a Simple MNIST loader written in Go

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConvertImage

func ConvertImage(data [][]uint8, row, col int) []*mat.Dense

Outputs the image data normalized [0, 1] as *mat.Dense for those trying ML with Gonum.

func ConvertLabel

func ConvertLabel(data []uint8) []*mat.Dense

Outputs the label data normalized [0 or 1] as *mat.Dense for those trying ML with Gonum.

func ReadImage

func ReadImage(path string) ([][]uint8, [][]uint8)

Reads MNIST image data train and test files make sure that the names are the original ones ... meaning these: train-images.idx3-ubyte t10k-images.idx3-ubyte

func ReadLabel

func ReadLabel(path string) ([]uint8, []uint8)

Reads MNIST label train and test files again ... make sure that the names are the original ones ... meaning these: train-labels.idx1-ubyte t10k-labels.idx1-ubyte

func ToImg

func ToImg(data []uint8, label uint8, row, col int) *img

Types

This section is empty.

Jump to

Keyboard shortcuts

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