Skip to content

MNIST noise overlaps signal #19

@benjaminbergner

Description

@benjaminbergner

Hi,

when I create a dataset with make_mnist.py and size 500x500, I figured that noise is sometimes overlapping numbers.

image

This can be resolved by changing the order of signal/noise insertion, e.g. the high-dimensional image:

def high(self):
  ...
  if self._dataset._should_add_noise:
    for p, i in self.noise_positions_and_patterns:
        high[self._get_slice(p)] = \
            255*self._dataset._noise[i]
                  
  for p, i in zip(self._positions, self._idxs):
      high[self._get_slice(p)] = \
          255*self._dataset._images[i]

instead of

def high(self):
  ...             
  for p, i in zip(self._positions, self._idxs):
      high[self._get_slice(p)] = \
          255*self._dataset._images[I]
   
  if self._dataset._should_add_noise:
    for p, i in self.noise_positions_and_patterns:
        high[self._get_slice(p)] = \
            255*self._dataset._noise[i]

Let me know in case I missed something.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions