pyCP_APR.datasets API#

pyCP_APR.datasets module#

list_datasets()

This function returns the list of tensor names that are available to load.

load_dataset([name])

Loads the tensor specified by its name.

datasets.py is used to load the example tensors.

@author Maksim Ekin Eren

pyCP_APR.datasets.list_datasets()[source]#

This function returns the list of tensor names that are available to load.

If the listing is requested for the first time, a new directory for the datasets is created.

Returns:

datasets -- List of tensor names that are available to load.

Return type:

list

Note

Example

from pyCP_APR.datasets import list_datasets

list_datasets()
['TOY']
pyCP_APR.datasets.load_dataset(name='TOY')[source]#

Loads the tensor specified by its name.

Warning

If a dataset is requested for the first time, it gets downloaded from GitHub.

Parameters:

name (string, optional) -- The name of the tensor to load. The default is name="TOY".

Returns:

data -- Tensor contents compressed in Numpy NPZ format.

Return type:

Numpy NPZ

Note

Example

from pyCP_APR.datasets import load_dataset

# Load a sample authentication training and test tensors along with the labels
data = load_dataset(name="TOY")
coords_train, nnz_train = data['train_coords'], data['train_count']
coords_test, nnz_test = data['test_coords'], data['test_count']

Available tensor data can be listed as follows:

data = load_dataset(name = "TOY")
list(data)
['train_coords',
 'train_count',
 'test_coords',
 'test_count']

Module contents#

2021. Triad National Security, LLC. All rights reserved. This program was produced under U.S. Government contract 89233218CNA000001 for Los Alamos National Laboratory (LANL), which is operated by Triad National Security, LLC for the U.S. Department of Energy/National Nuclear Security Administration. All rights in the program are reserved by Triad National Security, LLC, and the U.S. Department of Energy/National Nuclear Security Administration. The Government is granted for itself and others acting on its behalf a nonexclusive, paid-up, irrevocable worldwide license in this material to reproduce, prepare derivative works, distribute copies to the public, perform publicly and display publicly, and to permit others to do so.