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
bee6798b
Commit
bee6798b
authored
Aug 11, 2017
by
Yuxin Wu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix some layers
parent
6c4f2351
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
9 additions
and
9 deletions
+9
-9
tensorpack/models/common.py
tensorpack/models/common.py
+6
-6
tensorpack/models/image_sample.py
tensorpack/models/image_sample.py
+1
-1
tensorpack/models/regularize.py
tensorpack/models/regularize.py
+1
-1
tensorpack/models/shapes.py
tensorpack/models/shapes.py
+1
-1
No files found.
tensorpack/models/common.py
View file @
bee6798b
...
...
@@ -106,14 +106,14 @@ def layer_register(
name
,
inputs
=
args
[
0
],
args
[
1
]
args
=
args
[
1
:]
# actual positional args used to call func
assert
isinstance
(
name
,
six
.
string_types
),
name
elif
use_scope
is
False
:
assert
not
log_shape
inputs
=
args
[
0
]
name
=
None
assert
not
isinstance
(
args
[
0
],
six
.
string_types
),
name
else
:
# use_scope is None
else
:
assert
not
log_shape
if
isinstance
(
args
[
0
],
six
.
string_types
):
if
use_scope
is
False
:
logger
.
warn
(
"Please call layer {} without the first scope name argument, "
"or register the layer with use_scope=None to allow "
"two calling methods."
.
format
(
func
.
__name__
))
name
,
inputs
=
args
[
0
],
args
[
1
]
args
=
args
[
1
:]
# actual positional args used to call func
else
:
...
...
tensorpack/models/image_sample.py
View file @
bee6798b
...
...
@@ -45,7 +45,7 @@ def sample(img, coords):
return
sampled
@
layer_register
()
@
layer_register
(
log_shape
=
True
)
def
ImageSample
(
inputs
,
borderMode
=
'repeat'
):
"""
Sample the template image using the given coordinate, by bilinear interpolation.
...
...
tensorpack/models/regularize.py
View file @
bee6798b
...
...
@@ -80,7 +80,7 @@ def regularize_cost_from_collection(name='regularize_cost'):
return
None
@
layer_register
(
log_shape
=
False
,
use_scope
=
Fals
e
)
@
layer_register
(
use_scope
=
Non
e
)
def
Dropout
(
x
,
keep_prob
=
0.5
,
is_training
=
None
,
noise_shape
=
None
):
"""
Dropout layer as in the paper `Dropout: a Simple Way to Prevent
...
...
tensorpack/models/shapes.py
View file @
bee6798b
...
...
@@ -9,7 +9,7 @@ from .common import layer_register
__all__
=
[
'ConcatWith'
]
@
layer_register
(
use_scope
=
False
,
log_shape
=
Fals
e
)
@
layer_register
(
use_scope
=
Non
e
)
def
ConcatWith
(
x
,
tensor
,
dim
):
"""
A wrapper around ``tf.concat`` to cooperate with :class:`LinearWrap`.
...
...
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