Esempio n. 1
0
def testSwitchboardInverse2():
    sboard = mh.Switchboard(input_dim=3, connections=[2, 1, 1])
    assert not sboard.is_invertible()
Esempio n. 2
0
def test_SwitchboardInverse1():
    sboard = mh.Switchboard(input_dim=3, connections=[2, 0, 1])
    assert sboard.is_invertible()
    y = numx.array([[2, 3, 4], [5, 6, 7]])
    x = sboard.inverse(y)
    assert numx.all(x == numx.array([[3, 4, 2], [6, 7, 5]]))