Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
Model-Transfer-Adaptability
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
haoyifan
Model-Transfer-Adaptability
Commits
12b90b92
Commit
12b90b92
authored
Apr 07, 2023
by
Zhihong Ma
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: modify resnet and module for trail
parent
f641275d
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
0 deletions
+3
-0
mzh/module.py
+3
-0
mzh/resnet.py
+0
-0
No files found.
mzh/module.py
View file @
12b90b92
...
...
@@ -527,6 +527,8 @@ class QLinear(QModule):
#需要加入qi 对于resnet,并不是所有的qrelu都不需要统计qi (对于残差结构,需要做elementwise add,则不能直接通过使用前面某一层的qo作为该层的qi) / 但qo可以不加,与qi没有太大区别
#需要加入qi,qo 对于resnet,并不是所有的qrelu都不需要统计qi,qo
class
QReLU
(
QModule
):
def
__init__
(
self
,
qi
=
False
,
num_bits
=
None
,
n_exp
=
4
,
mode
=
1
):
...
...
@@ -542,6 +544,7 @@ class QReLU(QModule):
if
not
hasattr
(
self
,
'qi'
)
and
qi
is
None
:
raise
ValueError
(
'qi is not existed, should be provided.'
)
# 若非none,则是接受外部给的值,否则仍使用自己统计的qi
if
qi
is
not
None
:
self
.
qi
=
qi
...
...
mzh/resnet.py
View file @
12b90b92
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