Skip to content

Commit

Permalink
Update base_runner.py
Browse files Browse the repository at this point in the history
  • Loading branch information
Jingtao-Li-CVer authored Apr 21, 2023
1 parent 3a709c4 commit 359c77b
Showing 1 changed file with 1 addition and 15 deletions.
16 changes: 1 addition & 15 deletions runners/base_runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,20 +19,6 @@
from torch.nn.parallel import DistributedDataParallel as DDP


def weights_init(mod):
"""
Custom weights initialization called on netG, netD and netE
:param m:
:return:
"""
classname = mod.__class__.__name__
if classname.find('Conv') != -1:
mod.weight.data.normal_(0.0, 0.02)
elif classname.find('BatchNorm') != -1:
mod.weight.data.normal_(1.0, 0.02)
mod.bias.data.fill_(0)


class BaseRunner(ABC):
def __init__(self, cfg: DictConfig, working_dir: str) -> None:
super().__init__()
Expand Down Expand Up @@ -142,4 +128,4 @@ def _get_attr(self, name: str) -> Any:

module_path, attr_name = name.split(" - ")
module = import_module(module_path)
return getattr(module, attr_name)
return getattr(module, attr_name)

0 comments on commit 359c77b

Please sign in to comment.