|
|
@@ -78,28 +78,28 @@ def test_train_loop_01(): |
|
|
|
data.add_vertex_type('Bar', 4)
|
|
|
|
|
|
|
|
foo_foo = torch.tensor([
|
|
|
|
[0, 0, 0, 1, 0],
|
|
|
|
[0, 0, 1, 0, 0],
|
|
|
|
[1, 0, 0, 1, 0],
|
|
|
|
[0, 0, 1, 0, 1],
|
|
|
|
[0, 1, 0, 0, 0]
|
|
|
|
[0, 0, 0, 1, 0],
|
|
|
|
[1, 0, 0, 0, 0],
|
|
|
|
[0, 1, 0, 0, 0],
|
|
|
|
[0, 0, 0, 0, 0]
|
|
|
|
], dtype=torch.float32)
|
|
|
|
foo_foo = (foo_foo + foo_foo.transpose(0, 1)) / 2
|
|
|
|
|
|
|
|
foo_bar = torch.tensor([
|
|
|
|
[0, 1, 0, 1],
|
|
|
|
[0, 0, 1, 0],
|
|
|
|
[0, 0, 0, 1],
|
|
|
|
[0, 1, 0, 0],
|
|
|
|
[1, 0, 0, 0],
|
|
|
|
[0, 0, 1, 1]
|
|
|
|
[0, 0, 0, 1]
|
|
|
|
], dtype=torch.float32)
|
|
|
|
bar_foo = foo_bar.transpose(0, 1)
|
|
|
|
|
|
|
|
bar_bar = torch.tensor([
|
|
|
|
[0, 0, 1, 0],
|
|
|
|
[1, 0, 0, 0],
|
|
|
|
[0, 1, 0, 1],
|
|
|
|
[0, 1, 0, 0],
|
|
|
|
[1, 0, 0, 0],
|
|
|
|
[0, 0, 0, 1],
|
|
|
|
[0, 0, 1, 0],
|
|
|
|
], dtype=torch.float32)
|
|
|
|
bar_bar = (bar_bar + bar_bar.transpose(0, 1)) / 2
|
|
|
|
|
|
|
@@ -123,7 +123,10 @@ def test_train_loop_01(): |
|
|
|
conv_activation=torch.sigmoid,
|
|
|
|
dec_activation=torch.sigmoid)
|
|
|
|
|
|
|
|
train_data, val_data, test_data = split_data(data, (.9, .1, .0) )
|
|
|
|
train_data, val_data, test_data = split_data(data, (.5, .5, .0) )
|
|
|
|
|
|
|
|
print('val_data:', val_data)
|
|
|
|
print('val_data.vertex_types:', val_data.vertex_types)
|
|
|
|
|
|
|
|
loop = TrainLoop(model, val_data, test_data, initial_repr,
|
|
|
|
max_epochs=1, batch_size=1)
|
|
|
|