neuroprob/utils/neural.py
def batch_segments(segment_lengths, batch_size):
    """
    Returns list of batch size and batch links for input to the model batching argument.
    
    :param list segment_lengths: list of time step lengths of continuous segments in the data
    """
    batch_list = []
    for s in segment_lengths:
        if s == 0: # empty segment
            continue
            
        n = int(np.ceil(s / batch_size))-1
        for n_ in range(n):
            batch_list.append((batch_size, True if n_ > 0 else False))
        batch_list.append((s - n*batch_size, True if n > 0 else False))
        
    return batch_list

    Returns list of batch size and batch links for input to the model batching argument.
    
    :param list segment_lengths: list of time step lengths of continuous segments in the data
    
Returns list of batch size and batch links for input to the model batching argument.
Returns list of batch size and batch links for input to the model batching argument .
def batch_segments(segment_lengths, batch_size):
    batch_list = []
    for s in segment_lengths:
        if s == 0: 
            continue
        n = int(np.ceil(s / batch_size))-1
        for n_ in range(n):
            batch_list.append((batch_size, True if n_ > 0 else False))
        batch_list.append((s - n*batch_size, True if n > 0 else False))
    return batch_list
def batch_segments ( segment_lengths , batch_size ) : batch_list = [ ] for s in segment_lengths : if s == 0 : continue n = int ( np . ceil ( s / batch_size ) ) - 1 for n_ in range ( n ) : batch_list . append ( ( batch_size , True if n_ > 0 else False ) ) batch_list . append ( ( s - n * batch_size , True if n > 0 else False ) ) return batch_list
Returns list of batch size and batch links for input to the model batching argument.
Returns list of batch size and batch links for input to the model batching argument .
"""
    Returns list of batch size and batch links for input to the model batching argument.
    
    :param list segment_lengths: list of time step lengths of continuous segments in the data
    """ # empty segment
segment_lengths
list of time step lengths of continuous segments in the data
list of time step lengths of continuous segments in the data
batch_size