|
|
@@ -10,6 +10,7 @@ import torch |
|
|
|
from icosagon.input import OneHotInputLayer
|
|
|
|
from icosagon.convlayer import DecagonLayer
|
|
|
|
from icosagon.declayer import DecodeLayer
|
|
|
|
import pytest
|
|
|
|
|
|
|
|
|
|
|
|
def _is_identity_function(f):
|
|
|
@@ -147,3 +148,40 @@ def test_model_05(): |
|
|
|
assert len(list(m.seq[1].parameters())) == 6
|
|
|
|
assert len(list(m.seq[2].parameters())) == 6
|
|
|
|
assert len(list(m.seq[3].parameters())) == 6
|
|
|
|
|
|
|
|
|
|
|
|
def test_model_06():
|
|
|
|
d = Data()
|
|
|
|
d.add_node_type('Dummy', 10)
|
|
|
|
fam = d.add_relation_family('Dummy-Dummy', 0, 0, False)
|
|
|
|
fam.add_relation_type('Dummy Rel', torch.rand(10, 10).round())
|
|
|
|
|
|
|
|
with pytest.raises(TypeError):
|
|
|
|
m = Model(1)
|
|
|
|
|
|
|
|
with pytest.raises(TypeError):
|
|
|
|
m = Model(d, layer_dimensions=1)
|
|
|
|
|
|
|
|
with pytest.raises(TypeError):
|
|
|
|
m = Model(d, ratios=1)
|
|
|
|
|
|
|
|
with pytest.raises(ValueError):
|
|
|
|
m = Model(d, keep_prob='x')
|
|
|
|
|
|
|
|
with pytest.raises(TypeError):
|
|
|
|
m = Model(d, rel_activation='x')
|
|
|
|
|
|
|
|
with pytest.raises(TypeError):
|
|
|
|
m = Model(d, layer_activation='x')
|
|
|
|
|
|
|
|
with pytest.raises(TypeError):
|
|
|
|
m = Model(d, dec_activation='x')
|
|
|
|
|
|
|
|
with pytest.raises(ValueError):
|
|
|
|
m = Model(d, lr='x')
|
|
|
|
|
|
|
|
with pytest.raises(TypeError):
|
|
|
|
m = Model(d, loss=1)
|
|
|
|
|
|
|
|
with pytest.raises(ValueError):
|
|
|
|
m = Model(d, batch_size='x')
|