nngeometry/object/vector.py
def random_pvector_dict(layer_collection, device=None):
    """
    Returns a random :class:`nngeometry.object.PVector` object using
    the structure defined by the `layer_collection` parameter, with 
    each components drawn from a normal distribution with mean 0 and standard
    deviation 1.

    The returned `PVector` will internally use a dict representation.

    :param layer_collection: The :class:`nngeometry.layercollection.LayerCollection`
    describing the structure of the random pvector
    """
    v_dict = dict()
    for layer_id, layer in layer_collection.layers.items():
        if layer.bias is not None:
            v_dict[layer_id] = (torch.normal(0, 1, layer.weight.size, device=device),
                                torch.normal(0, 1, layer.bias.size, device=device))
        else:
            v_dict[layer_id] = (torch.normal(0, 1, layer.weight.size, device=device),)
    return PVector(layer_collection, dict_repr=v_dict)

    Returns a random :class:`nngeometry.object.PVector` object using
    the structure defined by the `layer_collection` parameter, with 
    each components drawn from a normal distribution with mean 0 and standard
    deviation 1.

    The returned `PVector` will internally use a dict representation.

    :param layer_collection: The :class:`nngeometry.layercollection.LayerCollection`
    describing the structure of the random pvector
    
Returns a random :class:`nngeometry.object.PVector` object using
the structure defined by the `layer_collection` parameter, with
each components drawn from a normal distribution with mean 0 and standard
deviation 1.

The returned `PVector` will internally use a dict representation.
Returns a random : class : ` nngeometry . object . PVector ` object using the structure defined by the ` layer_collection ` parameter with each components drawn from a normal distribution with mean 0 and standard deviation 1 . The returned ` PVector ` will internally use a dict representation .
def random_pvector_dict(layer_collection, device=None):
    v_dict = dict()
    for layer_id, layer in layer_collection.layers.items():
        if layer.bias is not None:
            v_dict[layer_id] = (torch.normal(0, 1, layer.weight.size, device=device),
                                torch.normal(0, 1, layer.bias.size, device=device))
        else:
            v_dict[layer_id] = (torch.normal(0, 1, layer.weight.size, device=device),)
    return PVector(layer_collection, dict_repr=v_dict)
def random_pvector_dict ( layer_collection , device = None ) : v_dict = dict ( ) for layer_id , layer in layer_collection . layers . items ( ) : if layer . bias is not None : v_dict [ layer_id ] = ( torch . normal ( 0 , 1 , layer . weight . size , device = device ) , torch . normal ( 0 , 1 , layer . bias . size , device = device ) ) else : v_dict [ layer_id ] = ( torch . normal ( 0 , 1 , layer . weight . size , device = device ) , ) return PVector ( layer_collection , dict_repr = v_dict )
Returns a random :class:`nngeometry.object.PVector` object using
the structure defined by the `layer_collection` parameter, with
each components drawn from a normal distribution with mean 0 and standard
deviation 1.
Returns a random : class : ` nngeometry . object . PVector ` object using the structure defined by the ` layer_collection ` parameter with each components drawn from a normal distribution with mean 0 and standard deviation 1 .
"""
    Returns a random :class:`nngeometry.object.PVector` object using
    the structure defined by the `layer_collection` parameter, with 
    each components drawn from a normal distribution with mean 0 and standard
    deviation 1.

    The returned `PVector` will internally use a dict representation.

    :param layer_collection: The :class:`nngeometry.layercollection.LayerCollection`
    describing the structure of the random pvector
    """
layer_collection
The :class:`nngeometry.layercollection.LayerCollection`
describing the structure of the random pvector
The : class : ` nngeometry . layercollection . LayerCollection ` describing the structure of the random pvector
device