-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathab_example.py
More file actions
executable file
·66 lines (51 loc) · 1.77 KB
/
ab_example.py
File metadata and controls
executable file
·66 lines (51 loc) · 1.77 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
#!/usr/bin/env python3
import numpy as np
debug = False
set_of_vectors_to_embed = np.array([
(8,-1,-4,3),
(-8,-5,9,7),
(8,2,7,-7)])
another_set_of_vectors_to_embed = np.array([
(8,2,7,-7),
(8,-1,-4,3),
(-8,-5,9,7)])
tweaked_set_of_vectors_to_embed = np.array([
(8,-1,-4,3),
(-8,-5,9,7),
(8,2,7,-7.001)])
n,k = set_of_vectors_to_embed.shape
test_sets_of_vectors = [
set_of_vectors_to_embed,
another_set_of_vectors_to_embed,
tweaked_set_of_vectors_to_embed,
]
import C0HomDeg1_simplicialComplex_embedder_1_for_array_of_reals_as_multiset as simplex1
import C0HomDeg1_simplicialComplex_embedder_2_for_array_of_reals_as_multiset as simplex2
import C0HomDeg1_conjectured_dotting_embedder_for_array_of_reals_as_multiset as conjectured_dotting
some_embedders = [
simplex1.Embedder(),
simplex2.Embedder(),
conjectured_dotting.Embedder(n, k),
]
for arr in test_sets_of_vectors:
print("")
print("XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX")
print("XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX")
print("")
print(f"\n==========================\nVectors to be encoded are:|")
for vec in arr:
print(f"{vec}, ")
concat = [ n, k]
for embedder in some_embedders:
embedding, (n_out, k_out), metadata = embedder.embed(arr)
assert (n_out, k_out) == (n, k)
if debug:
print(f"\nembedding for embedder {embedder} is {embedding}\n")
concat.extend( embedding )
print(f"\n==========================\nconcatenated embedding is:")
for number in concat:
print(number)
print("")
print("XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX")
print("XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX")
print("")