ct_segnet/train_utils.py
def data_generator(X, Y, batch_size):
    """Generator that yields randomly sampled data pairs of size batch_size.
    X, Y are DataFile object pairs of train / test / validation data.
    """
    while True:
        idxs = sorted(random.sample(range(X.d_shape[0]), batch_size))
        x = X.read_sequence(idxs)
        y = Y.read_sequence(idxs)
        y = _norm(y)

        yield (x[...,np.newaxis], y[...,np.newaxis])
Generator that yields randomly sampled data pairs of size batch_size.
    X, Y are DataFile object pairs of train / test / validation data.
    
Generator that yields randomly sampled data pairs of size batch_size.
X, Y are DataFile object pairs of train / test / validation data.
Generator that yields randomly sampled data pairs of size batch_size . X Y are DataFile object pairs of train / test / validation data .
def data_generator(X, Y, batch_size):
    while True:
        idxs = sorted(random.sample(range(X.d_shape[0]), batch_size))
        x = X.read_sequence(idxs)
        y = Y.read_sequence(idxs)
        y = _norm(y)
        yield (x[...,np.newaxis], y[...,np.newaxis])
def data_generator ( X , Y , batch_size ) : while True : idxs = sorted ( random . sample ( range ( X . d_shape [ 0 ] ) , batch_size ) ) x = X . read_sequence ( idxs ) y = Y . read_sequence ( idxs ) y = _norm ( y ) yield ( x [ ... , np . newaxis ] , y [ ... , np . newaxis ] )
Generator that yields randomly sampled data pairs of size batch_size.
Generator that yields randomly sampled data pairs of size batch_size .
"""Generator that yields randomly sampled data pairs of size batch_size.
    X, Y are DataFile object pairs of train / test / validation data.
    """
X
Y
batch_size