def load_parameters(self, path):
        """Load parameters from a file with the specified format.

        Args:
            path : path or file object
        """
        nn.load_parameters(path)
        for v in self.get_modules():
            if not isinstance(v, tuple):
                continue
            prefix, module = v
            for k, v in module.__dict__.items():
                if not isinstance(v, nn.Variable):
                    continue
                pname = k
                name = "{}/{}".format(prefix, pname)
                # Substitute
                param0 = v
                param1 = nn.parameter.pop_parameter(name)
                if param0 is None:
                    raise ValueError(
                        "Model does not have {} parameter.".format(name))
                param0.d = param1.d.copy()
                nn.logger.info("`{}` loaded.)".format(name))
def load_parameters ( self , path ) : nn . load_parameters ( path ) for v in self . get_modules ( ) : if not isinstance ( v , tuple ) : continue prefix , module = v for k , v in module . __dict__ . items ( ) : if not isinstance ( v , nn . Variable ) : continue pname = k name = "{}/{}" . format ( prefix , pname ) param0 = v param1 = nn . parameter . pop_parameter ( name ) if param0 is None : raise ValueError ( "Model does not have {} parameter." . format ( name ) ) param0 . d = param1 . d . copy ( ) nn . logger . info ( "`{}` loaded.)" . format ( name ) )
Load parameters from a file with the specified format.

        Args:
            path : path or file object