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!
Pārlūkot izejas kodu

Add test_sparse_multi_dgca()

master
Stanislaw Adaszewski pirms 4 gadiem
vecāks
revīzija
7f085b372a
1 mainītis faili ar 20 papildinājumiem un 1 dzēšanām
  1. +20
    -1
      tests/decagon_pytorch/test_convolve.py

+ 20
- 1
tests/decagon_pytorch/test_convolve.py Parādīt failu

@@ -124,4 +124,23 @@ def test_sparse_dropout_grap_conv_activation():
def test_sparse_multi_dgca():
pass
latent_torch = None
latent_tf = []
for i in range(11):
keep_prob = i/10. + np.finfo(np.float32).eps
latent_torch = sparse_dropout_graph_conv_activation_torch(keep_prob) \
if latent_torch is None \
else latent_torch + sparse_dropout_graph_conv_activation_torch(keep_prob)
latent_tf.append(sparse_dropout_graph_conv_activation_tf(keep_prob))
latent_torch = torch.nn.functional.normalize(latent_torch, p=2, dim=1)
latent_tf = tf.add_n(latent_tf)
latent_tf = tf.nn.l2_normalize(latent_tf, dim=1)
latent_torch = latent_torch.detach().numpy()
latent_tf = latent_tf.eval(session = tf.Session())
assert np.all(latent_torch - latent_tf < .000001)

Notiek ielāde…
Atcelt
Saglabāt