示例#1
0
def make_d4_p4m_indices(ksize):
    assert ksize % 2 == 1  # TODO
    x = np.random.randn(8, ksize, ksize)  # 8 3 3
    f = P4MFuncArray(v=x)
    li = f.left_translation_indices(D4.flatten()[:, None, None,
                                                 None])  #8 8 3 3 3
    #print(li.astype('int32'))
    #print('li.shape', li.shape)
    return li.astype('int32')
示例#2
0
def test_p4m_func():
    from groupy.gfunc.p4mfunc_array import P4MFuncArray
    import groupy.garray.D4_array as d4a

    v = np.random.randn(2, 6, 8, 5, 5)
    f = P4MFuncArray(v=v)

    g = d4a.rand(size=(1, ))
    h = d4a.rand(size=(1, ))

    check_associative(g, h, f)
    check_identity(d4a, f)
    check_invertible(g, f)
    check_i2g_g2i_invertible(f)
示例#3
0
def make_d4_p4m_indices(ksize):
    assert ksize % 2 == 1  # TODO
    x = np.random.randn(8, ksize, ksize)
    f = P4MFuncArray(v=x)
    li = f.left_translation_indices(D4.flatten()[:, None, None, None])
    return li.astype('int32')
示例#4
0
 def rotate_flip_p4m_func(f, m, r):
     f = P4MFuncArray(f)
     rf = D4Array([m, r], 'int')
     rf_f = rf * f
     return rf_f.v
示例#5
0
def make_d4_p4m_indices(ksize):
    assert ksize % 2 == 1  # TODO
    x = np.random.randn(8, ksize, ksize) # input channel related
    f = P4MFuncArray(v=x) # input channel related
    li = f.left_translation_indices(D4.flatten()[:, None, None, None]) # output channel related
    return li.astype('int32')