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
3fcd3b57
Commit
3fcd3b57
authored
Jul 18, 2016
by
Yuxin Wu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix bug in temperature & async
parent
adb684c0
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
2 deletions
+3
-2
tensorpack/models/softmax.py
tensorpack/models/softmax.py
+1
-1
tensorpack/train/multigpu.py
tensorpack/train/multigpu.py
+2
-1
No files found.
tensorpack/models/softmax.py
View file @
3fcd3b57
...
@@ -15,7 +15,7 @@ def SoftMax(x, use_temperature=False, temperature_init=1.0):
...
@@ -15,7 +15,7 @@ def SoftMax(x, use_temperature=False, temperature_init=1.0):
:param x: a 2D tensor
:param x: a 2D tensor
"""
"""
if
use_temperature
:
if
use_temperature
:
t
=
tf
.
get_variable
(
'
temp'
,
[
1
],
t
=
tf
.
get_variable
(
'
invtemp'
,
[
],
initializer
=
tf
.
constant_initializer
(
1.0
/
float
(
temperature_init
)))
initializer
=
tf
.
constant_initializer
(
1.0
/
float
(
temperature_init
)))
x
=
x
*
t
x
=
x
*
t
return
tf
.
nn
.
softmax
(
x
,
name
=
'output'
)
return
tf
.
nn
.
softmax
(
x
,
name
=
'output'
)
tensorpack/train/multigpu.py
View file @
3fcd3b57
...
@@ -92,7 +92,8 @@ class AsyncMultiGPUTrainer(MultiGPUTrainer):
...
@@ -92,7 +92,8 @@ class AsyncMultiGPUTrainer(MultiGPUTrainer):
# sync have consistent effective learning rate
# sync have consistent effective learning rate
def
scale
(
grads
):
def
scale
(
grads
):
with
tf
.
name_scope
(
'async_scale_grad'
):
with
tf
.
name_scope
(
'async_scale_grad'
):
return
[(
grad
/
self
.
config
.
nr_tower
,
var
)
for
grad
,
var
in
grads
]
return
[(
grad
/
self
.
config
.
nr_tower
if
grad
is
not
None
else
None
,
var
)
for
grad
,
var
in
grads
]
grad_list
=
map
(
scale
,
grad_list
)
grad_list
=
map
(
scale
,
grad_list
)
grad_list
=
[
self
.
process_grads
(
g
)
for
g
in
grad_list
]
grad_list
=
[
self
.
process_grads
(
g
)
for
g
in
grad_list
]
...
...
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