예제 #1
0
파일: base.py 프로젝트: korhammer/breze
 def _make_args(self, X):
     batch_size = getattr(self, 'batch_size', None)
     if batch_size is None:
         data = itertools.repeat([X])
     elif batch_size < 1:
         raise ValueError('need strictly positive batch size')
     else:
         data = iter_minibatches([X], self.batch_size, self.sample_dim)
     args = ((i, {}) for i in data)
     return args
예제 #2
0
파일: base.py 프로젝트: makarl/breze
 def _make_args(self, X):
     batch_size = getattr(self, 'batch_size', None)
     if batch_size is None:
         data = itertools.repeat([X])
     elif batch_size < 1:
         raise ValueError('need strictly positive batch size')
     else:
         data = iter_minibatches([X], self.batch_size, self.sample_dim)
     args = ((i, {}) for i in data)
     return args
예제 #3
0
파일: base.py 프로젝트: korhammer/breze
 def _make_args(self, X, Z):
     X, Z = cast_array_to_local_type(X), cast_array_to_local_type(Z)
     batch_size = getattr(self, 'batch_size', None)
     if batch_size is None:
         data = itertools.repeat([X, Z])
     elif batch_size < 1:
         raise ValueError('need strictly positive batch size')
     else:
         data = iter_minibatches([X, Z], self.batch_size, self.sample_dim)
     args = ((i, {}) for i in data)
     return args
예제 #4
0
파일: base.py 프로젝트: makarl/breze
    def _make_args(self, X, Z):
        batch_size = getattr(self, 'batch_size', None)
        if batch_size is None:
            X, Z = cast_array_to_local_type(X), cast_array_to_local_type(Z)
            data = itertools.repeat([X, Z])
        elif batch_size < 1:
            raise ValueError('need strictly positive batch size')
        else:
            data = iter_minibatches([X, Z], self.batch_size, self.sample_dim)
            data = ((cast_array_to_local_type(x), cast_array_to_local_type(z))
                    for x, z in data)

        args = ((i, {}) for i in data)
        return args