66
77class DataLoader (object ):
88 """
9- A data loader object, meant to allow sampling w/o replacement of one or
10- more named design matrices. Note that this object is iterable (and
11- implements an __iter__() method).
9+ A data loader object, meant to allow sampling w/o replacement of one or
10+ more named design matrices. Note that this object is iterable (and
11+ implements an __iter__() method).
1212
13- Args:
14- design_matrices: list of named data design matrices - [("name", matrix), ...]
13+ Args:
14+ design_matrices: list of named data design matrices - [("name", matrix), ...]
1515
16- batch_size: number of samples to place inside a mini-batch
16+ batch_size: number of samples to place inside a mini-batch
1717
18- disable_shuffle: if True, turns off sample shuffling (thus no sampling w/o replacement)
18+ disable_shuffle: if True, turns off sample shuffling (thus no sampling w/o replacement)
1919
20- ensure_equal_batches: if True, ensures sampled batches are equal in size (Default = True).
21- Note that this means the very last batch, if it's not the same size as the rest, will
22- reuse random samples from previously seen batches (yielding a batch with a mix of
23- vectors sampled with and without replacement).
20+ ensure_equal_batches: if True, ensures sampled batches are equal in size (Default = True).
21+ Note that this means the very last batch, if it's not the same size as the rest, will
22+ reuse random samples from previously seen batches (yielding a batch with a mix of
23+ vectors sampled with and without replacement).
2424
25- key: PRNG key to control determinism of any underlying random values
26- associated with this synaptic cable
25+ key: PRNG key to control determinism of any underlying random values
26+ associated with this synaptic cable
2727 """
2828 def __init__ (self , design_matrices , batch_size , disable_shuffle = False ,
2929 ensure_equal_batches = True , key = None ):
@@ -47,7 +47,7 @@ def __init__(self, design_matrices, batch_size, disable_shuffle=False,
4747
4848 def __iter__ (self ):
4949 """
50- Yields a mini-batch of the form: [("name", batch),("name",batch),...]
50+ Yields a mini-batch of the form: [("name", batch),("name",batch),...]
5151 """
5252 if self .disable_shuffle == False :
5353 self .key , * subkeys = random .split (self .key , 2 )
0 commit comments