Skip to content

Commit

Permalink
first yadll commit
Browse files Browse the repository at this point in the history
  • Loading branch information
pchavanne committed Jun 20, 2016
1 parent 6571cc0 commit 8ed79cf
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions yadll/data.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,36 @@


class Data(object):
"""
Load gziped pickled data.
data is made of train_set, valid_set, test_set
and set_x, set_y = set
Parameters
----------
data : `string`
data file name (with path)
shared : `bool`
theano shared variable
borrow : `bool`
theano borrowable variable
cast_y : `bool`
cast y to `intX`
Methods
-------
dataset :
return the dataset as [(self.train_set_x, self.train_set_y),
(self.valid_set_x, self.valid_set_y),
(self.test_set_x, self.test_set_y)]
Examples
--------
Load data
>>> yadll.data.Data('data/mnist/mnist.pkl.gz')
"""
def __init__(self, data, shared=True, borrow=True, cast_y=True):
if isinstance(data, str):
f = gzip.open(data, 'rb')
Expand Down

0 comments on commit 8ed79cf

Please sign in to comment.