layered.dataset module

class Dataset[source]

Bases: object

urls = []
cache = True
classmethod folder()[source]
parse()[source]

Subclass responsibility. The filenames of downloaded files will be passed as individual parameters to this function. Therefore, it must accept as many parameters as provided class-site urls. Should return a tuple of training examples and testing examples.

dump()[source]
load()[source]
download(url)[source]
static split(examples, ratio=0.8)[source]

Utility function that can be used within the parse() implementation of sub classes to split a list of example into two lists for training and testing.

class Test(amount=10)[source]

Bases: layered.dataset.Dataset

cache = False
parse()[source]
download(url)
dump()
folder()
load()
split(examples, ratio=0.8)

Utility function that can be used within the parse() implementation of sub classes to split a list of example into two lists for training and testing.

urls = []
class Regression(amount=10000, inputs=10)[source]

Bases: layered.dataset.Dataset

Synthetically generated dataset for regression. The task is to predict the sum and product of all the input values. All values are normalized between zero and one.

cache = False
parse()[source]
download(url)
dump()
folder()
load()
split(examples, ratio=0.8)

Utility function that can be used within the parse() implementation of sub classes to split a list of example into two lists for training and testing.

urls = []
class Modulo(amount=60000, inputs=32, classes=7)[source]

Bases: layered.dataset.Dataset

Sythetically generated classification dataset. The task is to predict the modulo classes of random integers encoded as bit arrays of length 32.

cache = False
parse()[source]
download(url)
dump()
folder()
load()
split(examples, ratio=0.8)

Utility function that can be used within the parse() implementation of sub classes to split a list of example into two lists for training and testing.

urls = []
class Mnist[source]

Bases: layered.dataset.Dataset

The MNIST database of handwritten digits, available from this page, has a training set of 60,000 examples, and a test set of 10,000 examples. It is a subset of a larger set available from NIST. The digits have been size-normalized and centered in a fixed-size image. It is a good database for people who want to try learning techniques and pattern recognition methods on real-world data while spending minimal efforts on preprocessing and formatting. (from http://yann.lecun.com/exdb/mnist/)

urls = ['http://yann.lecun.com/exdb/mnist/train-images-idx3-ubyte.gz', 'http://yann.lecun.com/exdb/mnist/train-labels-idx1-ubyte.gz', 'http://yann.lecun.com/exdb/mnist/t10k-images-idx3-ubyte.gz', 'http://yann.lecun.com/exdb/mnist/t10k-labels-idx1-ubyte.gz']
parse(train_x, train_y, test_x, test_y)[source]
cache = True
download(url)
dump()
folder()
load()
static read(data, labels)[source]
split(examples, ratio=0.8)

Utility function that can be used within the parse() implementation of sub classes to split a list of example into two lists for training and testing.