<｜begin▁of▁sentence｜>### Instruction:
Given a Newman-Watts-Strogatz graph generated with 100 nodes, each connected to 3 nearest neighbors and probability of adding a new edge 0.5, can you use the BigClam model to detect overlapping communities, and provide both the embeddings and the memberships of the nodes?
### Response:
import networkx as nx
from karateclub import BigClam

# Step 1: Generate a synthetic graph
G = nx.newman_watts_strogatz_graph(100, 3, 0.5)

# Step 2: Set up the BigClam model
model = BigClam(dimensions=8, iterations=50, learning_rate=0.005, seed=42)

# Step 3: Fit the model
model.fit(G)

# Step 4: Get the embeddings and memberships
embeddings = model.get_embedding()
memberships = model.get_memberships()

# Show embeddings and memberships
print('Node embeddings:\n', embeddings)
print('\nNode memberships:\n', memberships)
<|EOT|>
