Пример #1
0
def eqrc(rcses):
    eqrcs = []
    nsamp = min([r.shape[1] for r in rcses])
    for i, r in enumerate(rcses):
        ind = rand.ucevts(r.shape[1], nsamp, 5 + i)
        eqrcs.append(r[:, ind])
    rc = np.column_stack(eqrcs)
    return rc
Пример #2
0
def ucse(stim, size=UCSESIZE, length=LENGTH):
    '''
    return an ensemble <array[length, size]> of "size" length "length"
    windows chosen randomly from stim. Alternately, if size is a False
    value, return <array[length, stim.size -length]> containing
    all possible windows.

    '''
    if size:
        revts = rand.ucevts(stim.size - length, size, 0)
        revts += length
    else:
        revts = np.arange(length, stim.size)
    ens = [stim[i - length:i] for i in revts]
    return np.column_stack(ens)
Пример #3
0
def rand_space(ce, uc, clevel):
    inds = rand.ucevts(uc.shape[1], clevel, 2)
    return uc[:, inds].transpose()