Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
H
HAP_Tutorial_2018
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
David Josef Schmidt
HAP_Tutorial_2018
Commits
29504ee8
Commit
29504ee8
authored
7 years ago
by
JGlombitza
Browse files
Options
Downloads
Patches
Plain Diff
dependency fix
parent
ccdec8bf
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
MNIST_GAN/mnist.py
+33
-1
33 additions, 1 deletion
MNIST_GAN/mnist.py
with
33 additions
and
1 deletion
MNIST_GAN/mnist.py
+
33
−
1
View file @
29504ee8
...
...
@@ -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.
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment