高斯白噪声matlab代码
新的培训和测试代码()-18/12/2019
培训和测试代码(和)
合并批量归一化(PyTorch)
import
torch
import
torch
.
nn
as
nn
def
merge_bn
(
model
):
'''
merge
all
'Conv+BN'
(or
'TConv+BN')
into
'Conv'
(or
'TConv')
based
on
https://github.com/pytorch/pytorch/pull/901
by
Kai
Zhang
(cskaizhang@gmail.com)
https://github.com/cszn/DnCNN
01/01/2019
'''
prev_m
=
None
for
k
,
m
in
list
(
model
.
named_children
()):
if
(
isinstance
(
m
,
nn
.
BatchNorm2d
)
or
isinstance
(
m
,
nn
.
BatchNorm1d
))
and
(
isinstance
(
prev_m
,
nn
.
2021-11-27 16:12:15
143.66MB
系统开源
1