Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
T
tic
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wenyuanbo
tic
Commits
b5ff88b0
Commit
b5ff88b0
authored
Jul 13, 2018
by
Siju
Committed by
Tianqi Chen
Jul 13, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[Darknet] softmax temperature in frontend (#1429)
parent
3b476ffe
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
0 deletions
+5
-0
nnvm/python/nnvm/frontend/darknet.py
+5
-0
nnvm/tests/python/frontend/darknet/test_forward.py
+0
-0
No files found.
nnvm/python/nnvm/frontend/darknet.py
View file @
b5ff88b0
...
...
@@ -260,6 +260,9 @@ def _darknet_reshape(inputs, attrs):
def
_darknet_softmax_output
(
inputs
,
attrs
):
"""Process the softmax operation."""
temperature
=
attrs
.
get
(
'temperature'
,
1
)
if
temperature
!=
1
:
inputs
[
0
]
=
inputs
[
0
]
/
float
(
temperature
)
op_name
,
new_attrs
=
'softmax'
,
{}
if
_darknet_parse_bool_str
(
attrs
,
'multi_output'
):
new_attrs
[
'axis'
]
=
1
...
...
@@ -529,6 +532,8 @@ def _get_darknet_attrs(net, layer_num):
elif
LAYERTYPE
.
SOFTMAX
==
layer
.
type
:
attr
.
update
({
'axis'
:
1
})
attr
.
update
({
'use_flatten'
:
True
})
if
layer
.
temperature
:
attr
.
update
({
'temperature'
:
str
(
layer
.
temperature
)})
elif
LAYERTYPE
.
SHORTCUT
==
layer
.
type
:
add_layer
=
net
.
layers
[
layer
.
index
]
...
...
nnvm/tests/python/frontend/darknet/test_forward.py
View file @
b5ff88b0
This diff is collapsed.
Click to expand it.
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