Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
seminar-breakout
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Shashank Suhas
seminar-breakout
Commits
20becf84
Commit
20becf84
authored
Dec 28, 2015
by
ppwwyyxx
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
rollback
parent
dd1ac6b0
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
14 deletions
+11
-14
example_mnist.py
example_mnist.py
+10
-10
utils/concurrency.py
utils/concurrency.py
+1
-4
No files found.
example_mnist.py
View file @
20becf84
...
...
@@ -47,14 +47,14 @@ def get_model(inputs, is_training):
image
,
label
=
inputs
image
=
tf
.
expand_dims
(
image
,
3
)
# add a single channel
if
is_training
:
# augmentations
image
,
label
=
tf
.
train
.
slice_input_producer
(
[
image
,
label
],
name
=
'slice_queue'
)
image
=
tf
.
image
.
random_brightness
(
image
,
0.1
)
image
,
label
=
tf
.
train
.
shuffle_batch
(
[
image
,
label
],
BATCH_SIZE
,
CAPACITY
,
MIN_AFTER_DEQUEUE
,
num_threads
=
2
,
enqueue_many
=
False
)
#if is_training: # slow
#
#
augmentations
#
image, label = tf.train.slice_input_producer(
#
[image, label], name='slice_queue')
#
image = tf.image.random_brightness(image, 0.1)
#
image, label = tf.train.shuffle_batch(
#
[image, label], BATCH_SIZE, CAPACITY, MIN_AFTER_DEQUEUE,
#
num_threads=2, enqueue_many=False)
conv0
=
Conv2D
(
'conv0'
,
image
,
out_channel
=
32
,
kernel_shape
=
5
)
pool0
=
MaxPooling
(
'pool0'
,
conv0
,
2
)
...
...
@@ -100,9 +100,9 @@ def get_config():
IMAGE_SIZE
=
28
dataset_train
=
Mnist
(
'train'
)
dataset_train
=
BatchData
(
Mnist
(
'train'
),
128
)
dataset_test
=
BatchData
(
Mnist
(
'test'
),
256
,
remainder
=
True
)
step_per_epoch
=
dataset_train
.
size
()
/
BATCH_SIZE
step_per_epoch
=
dataset_train
.
size
()
#step_per_epoch = 20
#dataset_test = FixedSizeData(dataset_test, 20)
...
...
utils/concurrency.py
View file @
20becf84
...
...
@@ -39,10 +39,7 @@ class EnqueueThread(threading.Thread):
for
dp
in
self
.
dataflow
.
get_data
():
if
self
.
coord
.
should_stop
():
return
feed
=
{}
for
var
,
data
in
izip
(
self
.
input_vars
,
dp
):
data
=
expand_dim_if_necessary
(
var
,
data
)
feed
[
var
]
=
data
feed
=
dict
(
izip
(
self
.
input_vars
,
dp
))
self
.
sess
.
run
([
self
.
op
],
feed_dict
=
feed
)
except
tf
.
errors
.
CancelledError
as
e
:
pass
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment