hyperdimensional-computing / torchhd

Torchhd is a Python library for Hyperdimensional Computing and Vector Symbolic Architectures
https://torchhd.readthedocs.io
MIT License
233 stars 24 forks source link

Graph neighbors and contains for directed graphs not working #63

Closed pereverges closed 2 years ago

pereverges commented 2 years ago

generator = torch.Generator() generator.manual_seed(seed) hv = functional.random_hv(10, 10000, generator=generator) G = structures.Graph(dim_or_input=10000, directed=True)

    G.add_edge(hv[0], hv[1])
    G.add_edge(hv[0], hv[2])
    G.add_edge(hv[1], hv[2])

    print(functional.cosine_similarity(G.node_neighbors(hv[1]), hv))

tensor([-0.0142, 0.0021, -0.0057, -0.0036, -0.0141, -0.0020, 0.0037, -0.0062, 0.0059, -0.0022])