Ejemplo n.º 1
0
 def test_swissroll(self):
     graphs.SwissRoll(srtype='uniform')
     graphs.SwissRoll(srtype='classic')
     graphs.SwissRoll(noise=True)
     graphs.SwissRoll(noise=False)
     graphs.SwissRoll(dim=2)
     graphs.SwissRoll(dim=3)
        Gs[i + 1].mr = {
            'idx': ind,
            'orig_idx': Gs[i].mr['orig_idx'][ind],
            'level': i
        }

        L_reg = Gs[i].L + reg_eps * sparse.eye(Gs[i].N)
        Gs[i].mr['K_reg'] = kronReduction(L_reg, ind)
        Gs[i].mr['green_kernel'] = filters.Filter(Gs[i], lambda x: 1. /
                                                  (reg_eps + x))

    return Gs


G = graphs.SwissRoll(N=1000, seed=42)
levels = 5
Gs = multiresolution(G, levels, sparsify=True)

fig = plt.figure(figsize=(10, 2.5))
for i in range(4):
    ax = fig.add_subplot(1, 4, i + 1, projection='3d')
    plotting.plot_graph(Gs[i + 1], ax=ax)
    _ = ax.set_title(
        'Pyramid Level: {} \n Number of nodes: {} \n Number of edges: {}'.
        format(i + 1, Gs[i + 1].N, Gs[i + 1].Ne))
    ax.set_axis_off()
fig.tight_layout()
plt.show()

G = graphs.Sensor(1200, distribute=True)
Ejemplo n.º 3
0
 def test_SwissRoll():
     G = graphs.SwissRoll()
Ejemplo n.º 4
0
 def test_SwissRoll():
     G = graphs.SwissRoll()
     needed_attributes_testing(G)