Spaces:
Runtime error
Runtime error
perp vector
Browse files
backend/disentangle_concepts.py
CHANGED
@@ -34,6 +34,8 @@ def regenerate_images(model, z, decision_boundary, min_epsilon=-3, max_epsilon=3
|
|
34 |
device = torch.device('cpu')
|
35 |
G = model.to(device) # type: ignore
|
36 |
|
|
|
|
|
37 |
# Labels.
|
38 |
label = torch.zeros([1, G.c_dim], device=device)
|
39 |
|
|
|
34 |
device = torch.device('cpu')
|
35 |
G = model.to(device) # type: ignore
|
36 |
|
37 |
+
if True:
|
38 |
+
decision_boundary = z - (np.dot(z, decision_boundary) / np.dot(decision_boundary, decision_boundary)) * decision_boundary
|
39 |
# Labels.
|
40 |
label = torch.zeros([1, G.c_dim], device=device)
|
41 |
|