<｜begin▁of▁sentence｜>### Instruction:
Given a Newman-Watts-Strogatz small-world graph with 100 nodes, each node connected to its 3 nearest neighbors in a ring topology, adding 0.5 probability for creating additional random edges, can you use NNSED model to find the embedding and cluster membership of nodes?
### Response:
import networkx as nx
from karateclub import NNSED
import numpy as np

# Create a graph
G = nx.newman_watts_strogatz_graph(100, 3, 0.5)

# Initialize the NNSED model with custom parameters
model = NNSED(layers=32, iterations=10, seed=42, noise=1e-6)

# Fit the model
model.fit(G)

# Get the learned embedding
embedding = model.get_embedding()

# Get the memberships of nodes to clusters
memberships = model.get_memberships()

print('Embedding:', embedding)
print('Memberships:', memberships)
<|EOT|>
