Skip to content
Snippets Groups Projects
Commit 29504ee8 authored by JGlombitza's avatar JGlombitza
Browse files

dependency fix

parent ccdec8bf
No related branches found
No related tags found
No related merge requests found
......@@ -6,10 +6,42 @@ The images are 28x28 pixels (grayscale) showing a single handwritten digit from
0 to 9. The dataset contains 60000 training and 10000 test images.
"""
from dlipr.utils import get_datapath, Dataset
import numpy as np
import gzip
def get_datapath(fname=''):
"""Get data path.
Args:
fname (str, optional): data filename
"""
cdir = os.path.dirname(__file__)
with open(os.path.join(cdir, '.env')) as handle:
ddir = json.load(handle)['DATA_PATH']
return os.path.join(ddir, fname)
class Dataset():
"""Simple dataset container
"""
def __init__(self, **kwds):
"""Summary
Args:
**kwds:
"""
self.__dict__.update(kwds)
def plot_examples(self, num_examples=5, fname=None):
"""Plot examples from the dataset
Args:
num_examples (int, optional): number of examples to
fname (str, optional): filename for saving the plot
"""
plot_examples(self, num_examples, fname)
def load_data():
"""Load the MNIST dataset.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment