523a62159f0324438901e9716b593775ec4c5c10,nsgt/nsgtf.py,,nsgtf_sl,#,13

Before Change


            
        // The actual transform
        // TODO: stuff loop into theano
        for mii,gii,gi1,gi2,win_range,Lg,col in loopparams:
//            Lg = len(gii)            
            // if the number of time channels is too small (mii < Lg), aliasing is introduced
            // wrap around and sum up in the end (below)
//            col = int(ceil(float(Lg)/mii)) // normally col == 1                        
//            assert col*mii >= Lg                        

            temp = temp0[:col*mii]

            // original version
//            t = ft[win_range]*N.fft.fftshift(N.conj(gii))
//            temp[:(Lg+1)//2] = t[Lg//2:]  // if mii is odd, this is of length mii-mii//2
//            temp[-(Lg//2):] = t[:Lg//2]  // if mii is odd, this is of length mii//2

            // modified version to avoid superfluous memory allocation
            t1 = temp[:(Lg+1)//2]
            t1[:] = gi1  // if mii is odd, this is of length mii-mii//2
            t2 = temp[-(Lg//2):]
            t2[:] = gi2  // if mii is odd, this is of length mii//2

            ftw = ft[win_range]
            t2 *= ftw[:Lg//2]
            t1 *= ftw[Lg//2:]

//            (wh1a,wh1b),(wh2a,wh2b) = win_range
//            t2[:wh1a.stop-wh1a.start] *= ft[wh1a]
//            t2[wh1a.stop-wh1a.start:] *= ft[wh1b]
//            t1[:wh2a.stop-wh2a.start] *= ft[wh2a]
//            t1[wh2a.stop-wh2a.start:] *= ft[wh2b]
            
            temp[(Lg+1)//2:-(Lg//2)] = 0  // clear gap (if any)
            
            if col > 1:
                temp = N.sum(temp.reshape((mii,-1)),axis=1)
            else:
                temp = temp.copy()
 
            c.append(temp)
            
        yield map(ifft,c)  // TODO: if matrixform, perform "2D" FFT along one axis

        
// non-sliced version

After Change


        p = (mii,gii,gi1,gi2,win_range,Lg,col)
        loopparams.append(p)

    if True or T is None:
        def loop(temp0):
            c = [] // Initialization of the result
                
            // The actual transform
            // TODO: stuff loop into theano
            for mii,gii,gi1,gi2,win_range,Lg,col in loopparams:
    //            Lg = len(gii)            
                // if the number of time channels is too small (mii < Lg), aliasing is introduced
                // wrap around and sum up in the end (below)
    //            col = int(ceil(float(Lg)/mii)) // normally col == 1                        
    //            assert col*mii >= Lg                        
    
                temp = temp0[:col*mii]
    
                // original version
    //            t = ft[win_range]*N.fft.fftshift(N.conj(gii))
    //            temp[:(Lg+1)//2] = t[Lg//2:]  // if mii is odd, this is of length mii-mii//2
    //            temp[-(Lg//2):] = t[:Lg//2]  // if mii is odd, this is of length mii//2
    
                // modified version to avoid superfluous memory allocation
                t1 = temp[:(Lg+1)//2]
                t1[:] = gi1  // if mii is odd, this is of length mii-mii//2
                t2 = temp[-(Lg//2):]
                t2[:] = gi2  // if mii is odd, this is of length mii//2
    
                ftw = ft[win_range]
                t2 *= ftw[:Lg//2]
                t1 *= ftw[Lg//2:]
    
    //            (wh1a,wh1b),(wh2a,wh2b) = win_range
    //            t2[:wh1a.stop-wh1a.start] *= ft[wh1a]
    //            t2[wh1a.stop-wh1a.start:] *= ft[wh1b]
    //            t1[:wh2a.stop-wh2a.start] *= ft[wh2a]
    //            t1[wh2a.stop-wh2a.start:] *= ft[wh2b]
                
                temp[(Lg+1)//2:-(Lg//2)] = 0  // clear gap (if any)
                
                if col > 1:
                    temp = N.sum(temp.reshape((mii,-1)),axis=1)
                else:
                    temp = temp.copy()
     
                c.append(temp)
            return c
    else:
        raise RuntimeError("Theano support not implemented yet")

    for f in f_slices:
        Ls = len(f)
        
        // some preparation    
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 5

Instances


Project Name: grrrr/nsgt
Commit Name: 523a62159f0324438901e9716b593775ec4c5c10
Time: 2012-08-31
Author: gr@grrrr.org
File Name: nsgt/nsgtf.py
Class Name:
Method Name: nsgtf_sl


Project Name: havakv/pycox
Commit Name: 6e3d793152231d6e39f4cc7f33e0a1f74981e15c
Time: 2018-11-13
Author: haavard.kvamme@gmail..com
File Name: pycox/models/cox.py
Class Name: CoxBase
Method Name: fit_dataloader


Project Name: grrrr/nsgt
Commit Name: 523a62159f0324438901e9716b593775ec4c5c10
Time: 2012-08-31
Author: gr@grrrr.org
File Name: nsgt/nsigtf.py
Class Name:
Method Name: nsigtf_sl