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!
Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

39 lignes
954B

  1. from triacontagon.data import Data
  2. from triacontagon.sampling import negative_sample_adj_mat, \
  3. negative_sample_data
  4. from triacontagon.decode import dedicom_decoder
  5. import torch
  6. def test_negative_sample_adj_mat_01():
  7. adj_mat = torch.tensor([
  8. [0, 1, 0, 1, 0],
  9. [0, 0, 0, 0, 1],
  10. [1, 1, 0, 0, 0],
  11. [0, 0, 1, 0, 1],
  12. [0, 1, 0, 0, 0]
  13. ])
  14. print('adj_mat:', adj_mat)
  15. adj_mat_neg = negative_sample_adj_mat(adj_mat)
  16. print('adj_mat_neg:', adj_mat_neg.to_dense())
  17. def test_negative_sample_data_01():
  18. d = Data()
  19. d.add_vertex_type('Gene', 5)
  20. d.add_edge_type('Gene-Gene', 0, 0, [
  21. torch.tensor([
  22. [0, 1, 0, 1, 0],
  23. [0, 0, 0, 0, 1],
  24. [1, 1, 0, 0, 0],
  25. [0, 0, 1, 0, 1],
  26. [0, 1, 0, 0, 0]
  27. ], dtype=torch.float).to_sparse()
  28. ], dedicom_decoder)
  29. d_neg = negative_sample_data(d)