IF YOU WOULD LIKE TO GET AN ACCOUNT, please write an email to s dot adaszewski at gmail dot com. User accounts are meant only to report issues and/or generate pull requests. This is a purpose-specific Git hosting for ADARED projects. Thank you for your understanding!
소스 검색

Fix test_decode_layer_02.

master
Stanislaw Adaszewski 4 년 전
부모
커밋
093d378c6a
1개의 변경된 파일10개의 추가작업 그리고 8개의 파일을 삭제
  1. +10
    -8
      tests/icosagon/test_declayer.py

+ 10
- 8
tests/icosagon/test_declayer.py 파일 보기

@@ -55,22 +55,24 @@ def test_decode_layer_01():
def test_decode_layer_02():
d = Data()
d.add_node_type('Dummy', 100)
d.add_relation_type('Dummy Relation 1', 0, 0,
fam = d.add_relation_family('Dummy-Dummy', 0, 0, False)
fam.add_relation_type('Dummy Relation 1',
torch.rand((100, 100), dtype=torch.float32).round().to_sparse())
prep_d = prepare_training(d, TrainValTest(.8, .1, .1))
in_layer = OneHotInputLayer(d)
d_layer = DecagonLayer(in_layer.output_dim, 32, d)
dec_layer = DecodeLayer(input_dim=d_layer.output_dim, data=prep_d, keep_prob=1.,
decoder_class=DEDICOMDecoder, activation=lambda x: x)
dec_layer = DecodeLayer(input_dim=d_layer.output_dim, data=prep_d,
keep_prob=1., activation=lambda x: x)
seq = torch.nn.Sequential(in_layer, d_layer, dec_layer)
pred_adj_matrices = seq(None)
pred = seq(None)
assert isinstance(pred_adj_matrices, dict)
assert len(pred_adj_matrices) == 1
assert isinstance(pred_adj_matrices[0, 0], list)
assert len(pred_adj_matrices[0, 0]) == 1
assert isinstance(pred, Predictions)
assert len(pred.relation_families) == 1
assert isinstance(pred.relation_families[0], RelationFamilyPredictions)
assert isinstance(pred.relation_families[0].relation_types, list)
assert len(pred.relation_families[0].relation_types) == 1
def test_decode_layer_03():


불러오는 중...
취소
저장