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
b335a7ba
You need to sign in or sign up before continuing.
Commit
b335a7ba
authored
Jan 03, 2017
by
Yuxin Wu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
split_v was removed already (tf#6405)
parent
e94abf66
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
7 additions
and
7 deletions
+7
-7
examples/SpatialTransformer/mnist-addition.py
examples/SpatialTransformer/mnist-addition.py
+1
-1
tensorpack/models/conv2d.py
tensorpack/models/conv2d.py
+2
-2
tensorpack/models/image_sample.py
tensorpack/models/image_sample.py
+4
-4
No files found.
examples/SpatialTransformer/mnist-addition.py
View file @
b335a7ba
...
@@ -65,7 +65,7 @@ class Model(ModelDesc):
...
@@ -65,7 +65,7 @@ class Model(ModelDesc):
transform2
=
tf
.
concat_v2
([
padded2
[:,
:,
:,
0
],
padded2
[:,
:,
:,
1
]],
1
)
transform2
=
tf
.
concat_v2
([
padded2
[:,
:,
:,
0
],
padded2
[:,
:,
:,
1
]],
1
)
stacked
=
tf
.
concat_v2
([
img_orig
,
transform1
,
transform2
],
2
,
'viz'
)
stacked
=
tf
.
concat_v2
([
img_orig
,
transform1
,
transform2
],
2
,
'viz'
)
tf
.
summary
.
image
(
'visualize'
,
tf
.
summary
.
image
(
'visualize'
,
tf
.
expand_dims
(
stacked
,
-
1
),
max_
image
s
=
30
)
tf
.
expand_dims
(
stacked
,
-
1
),
max_
output
s
=
30
)
sampled
=
tf
.
concat_v2
([
sampled1
,
sampled2
],
3
,
'sampled_concat'
)
sampled
=
tf
.
concat_v2
([
sampled1
,
sampled2
],
3
,
'sampled_concat'
)
logits
=
(
LinearWrap
(
sampled
)
logits
=
(
LinearWrap
(
sampled
)
...
...
tensorpack/models/conv2d.py
View file @
b335a7ba
...
@@ -54,8 +54,8 @@ def Conv2D(x, out_channel, kernel_shape,
...
@@ -54,8 +54,8 @@ def Conv2D(x, out_channel, kernel_shape,
conv
=
tf
.
nn
.
conv2d
(
x
,
W
,
stride
,
padding
)
conv
=
tf
.
nn
.
conv2d
(
x
,
W
,
stride
,
padding
)
else
:
else
:
# TODO rename to split later
# TODO rename to split later
inputs
=
tf
.
split
_v
(
x
,
split
,
3
)
inputs
=
tf
.
split
(
x
,
split
,
3
)
kernels
=
tf
.
split
_v
(
W
,
split
,
3
)
kernels
=
tf
.
split
(
W
,
split
,
3
)
outputs
=
[
tf
.
nn
.
conv2d
(
i
,
k
,
stride
,
padding
)
outputs
=
[
tf
.
nn
.
conv2d
(
i
,
k
,
stride
,
padding
)
for
i
,
k
in
zip
(
inputs
,
kernels
)]
for
i
,
k
in
zip
(
inputs
,
kernels
)]
conv
=
tf
.
concat_v2
(
outputs
,
3
)
conv
=
tf
.
concat_v2
(
outputs
,
3
)
...
...
tensorpack/models/image_sample.py
View file @
b335a7ba
...
@@ -74,14 +74,14 @@ def ImageSample(inputs, borderMode='repeat'):
...
@@ -74,14 +74,14 @@ def ImageSample(inputs, borderMode='repeat'):
diff
=
mapping
-
lcoor
diff
=
mapping
-
lcoor
neg_diff
=
1.0
-
diff
# bxh2xw2x2
neg_diff
=
1.0
-
diff
# bxh2xw2x2
lcoory
,
lcoorx
=
tf
.
split
_v
(
lcoor
,
2
,
3
)
lcoory
,
lcoorx
=
tf
.
split
(
lcoor
,
2
,
3
)
ucoory
,
ucoorx
=
tf
.
split
_v
(
ucoor
,
2
,
3
)
ucoory
,
ucoorx
=
tf
.
split
(
ucoor
,
2
,
3
)
lyux
=
tf
.
concat_v2
([
lcoory
,
ucoorx
],
3
)
lyux
=
tf
.
concat_v2
([
lcoory
,
ucoorx
],
3
)
uylx
=
tf
.
concat_v2
([
ucoory
,
lcoorx
],
3
)
uylx
=
tf
.
concat_v2
([
ucoory
,
lcoorx
],
3
)
diffy
,
diffx
=
tf
.
split
_v
(
diff
,
2
,
3
)
diffy
,
diffx
=
tf
.
split
(
diff
,
2
,
3
)
neg_diffy
,
neg_diffx
=
tf
.
split
_v
(
neg_diff
,
2
,
3
)
neg_diffy
,
neg_diffx
=
tf
.
split
(
neg_diff
,
2
,
3
)
# prod = tf.reduce_prod(diff, 3, keep_dims=True)
# prod = tf.reduce_prod(diff, 3, keep_dims=True)
# diff = tf.Print(diff, [tf.is_finite(tf.reduce_sum(diff)), tf.shape(prod),
# diff = tf.Print(diff, [tf.is_finite(tf.reduce_sum(diff)), tf.shape(prod),
...
...
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