示例#1
0
  def fetch_datasets(self, activation_func_bounds):
    self.dataset = inp.read_ds_zip(FLAGS.input_path)
    if DEV:
      self.dataset = self.dataset[:FLAGS.batch_size*5]

    shape = list(self.dataset.shape)
    self.epoch_size = int(shape[0] / FLAGS.batch_size)

    self._batch_shape = shape
    self._batch_shape[0] = FLAGS.batch_size
    self.dataset = self.dataset[:int(len(self.dataset) / FLAGS.batch_size) * FLAGS.batch_size]
    self.dataset = inp.rescale_ds(self.dataset, activation_func_bounds.min, activation_func_bounds.max)
    self._image_shape = list(self.dataset.shape)[1:]

    self.test_set = inp.read_ds_zip(FLAGS.test_path)[0:FLAGS.test_max]
    self.test_set = inp.rescale_ds(self.test_set, self._activation.min, self._activation.max)
示例#2
0
  def fetch_datasets(self, activation_func_bounds):
    original_data, filters = inp.get_images(FLAGS.input_path)
    assert len(filters) == len(original_data)
    original_data, filters = self.bloody_hack_filterbatches(original_data, filters)
    ut.print_info('shapes. data, filters: %s' % str((original_data.shape, filters.shape)))

    original_data = inp.rescale_ds(original_data, activation_func_bounds.min, activation_func_bounds.max)
    self._image_shape = inp.get_image_shape(FLAGS.input_path)

    if DEV:
      original_data = original_data[:300]

    self.epoch_size = math.ceil(len(original_data) / FLAGS.batch_size)
    self.test_size = math.ceil(len(original_data) / FLAGS.batch_size)
    return original_data, filters
示例#3
0
    def fetch_datasets(self, activation_func_bounds):
        original_data, filters = inp.get_images(FLAGS.input_path)
        assert len(filters) == len(original_data)
        original_data, filters = self.bloody_hack_filterbatches(
            original_data, filters)
        ut.print_info('shapes. data, filters: %s' % str(
            (original_data.shape, filters.shape)))

        original_data = inp.rescale_ds(original_data,
                                       activation_func_bounds.min,
                                       activation_func_bounds.max)
        self._image_shape = inp.get_image_shape(FLAGS.input_path)

        if DEV:
            original_data = original_data[:300]

        self.epoch_size = math.ceil(len(original_data) / FLAGS.batch_size)
        self.test_size = math.ceil(len(original_data) / FLAGS.batch_size)
        return original_data, filters
示例#4
0
def fetch_datasets():
  activation_func_bounds = act.sigmoid
  original_data, filters = inp.get_images(source)
  original_data = inp.rescale_ds(original_data, activation_func_bounds.min, activation_func_bounds.max)
  part = 1.
  return original_data[:len(original_data)*part],  original_data[len(original_data)*part:]