twodlearn.datasets.base module¶
Creates a generic dataset from a given data
-
class
twodlearn.datasets.base.Dataset(data_x, data_y=None)[source]¶ Bases:
object-
property
n_samples[source]
-
next_batch(batch_size, shuffle=True)[source]¶ Return the next batch_size examples from this data set.
-
next_batch_x(batch_size, shuffle=True)[source]¶ Return the next batch_size examples from this data set.
-
normalizer[source]¶ Decorator used to specify an optional property inside a model. The decorator works similar to @property, but the specified method correponds to the initialization of the property
-
sample[source]¶ Decorator used to specify methods that have a set of local variables.
These methods consist of an initialization method (speficied with the function given to the decorator) and an execute method.
-
property
x[source]
-
property
y[source]
-
property
-
class
twodlearn.datasets.base.Datasets(train, valid=None, test=None)[source]¶ Bases:
object-
mapper[source]¶ Decorator used to specify an optional property inside a model. The decorator works similar to @property, but the specified method correponds to the initialization of the property
-
normalize()[source]¶ Normalize dataset for having a training dataset with zero mean and standard deviation of one.
-
-
twodlearn.datasets.base.dense_to_one_hot(labels, num_classes=None)[source]¶ Convert class labels from scalars to one-hot vectors.
-
twodlearn.datasets.base.load_gz_as_nparray(work_directory, filename, dtype=<class 'numpy.float32'>)[source]¶
-
twodlearn.datasets.base.maybe_download(filename, work_directory, source_url)[source]¶ Download the data from source url, unless it’s already here. :param filename: string, name of the file in the directory. :param work_directory: string, path to working directory. :param source_url: url to download from if file doesn’t exist.
- Returns
Path to resulting file.