nnrl/nn/utils.py
def update_polyak(from_module: nn.Module, to_module: nn.Module, polyak: float):
    """Update parameters between modules by polyak averaging.

    Args:
        from_module: Module whose parameters are targets.
        to_module: Module whose parameters are updated towards the targets.
        polyak: Averaging factor. The higher it is, the slower the parameters
            are updated.
    """
    for source, target in zip(from_module.parameters(), to_module.parameters()):
        target.data.mul_(polyak).add_(source.data, alpha=1 - polyak)
Update parameters between modules by polyak averaging.

    Args:
        from_module: Module whose parameters are targets.
        to_module: Module whose parameters are updated towards the targets.
        polyak: Averaging factor. The higher it is, the slower the parameters
            are updated.
    
Update parameters between modules by polyak averaging.
Update parameters between modules by polyak averaging .
def update_polyak(from_module: nn.Module, to_module: nn.Module, polyak: float):
    for source, target in zip(from_module.parameters(), to_module.parameters()):
        target.data.mul_(polyak).add_(source.data, alpha=1 - polyak)
def update_polyak ( from_module : nn . Module , to_module : nn . Module , polyak : float ) : for source , target in zip ( from_module . parameters ( ) , to_module . parameters ( ) ) : target . data . mul_ ( polyak ) . add_ ( source . data , alpha = 1 - polyak )
Update parameters between modules by polyak averaging.
Update parameters between modules by polyak averaging .
"""Update parameters between modules by polyak averaging.

    Args:
        from_module: Module whose parameters are targets.
        to_module: Module whose parameters are updated towards the targets.
        polyak: Averaging factor. The higher it is, the slower the parameters
            are updated.
    """
from_module
nn.Module
Module whose parameters are targets.
Module whose parameters are targets .
to_module
nn.Module
Module whose parameters are updated towards the targets.
Module whose parameters are updated towards the targets .
polyak
float
Averaging factor. The higher it is, the slower the parameters
are updated.
Averaging factor . The higher it is the slower the parameters are updated .