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 for init_glorot.

master
Stanislaw Adaszewski pirms 4 gadiem
vecāks
revīzija
6d0039b447
1 mainītis faili ar 13 papildinājumiem un 0 dzēšanām
  1. +13
    -0
      tests/icosagon/test_weights.py

+ 13
- 0
tests/icosagon/test_weights.py Parādīt failu

@@ -0,0 +1,13 @@
from icosagon.weights import init_glorot
import torch
import numpy as np
def test_init_glorot_01():
torch.random.manual_seed(0)
res = init_glorot(10, 20)
torch.random.manual_seed(0)
rnd = torch.rand((10, 20))
init_range = np.sqrt(6.0 / 30)
expected = -init_range + 2 * init_range * rnd
assert torch.all(res == expected)

Notiek ielāde…
Atcelt
Saglabāt