Skip to content

Custom BatchIterator #1

@ProgRoman

Description

@ProgRoman

Hello! When using this code


from nolearn.lasagne import BatchIterator
class SimpleBatchIterator(BatchIterator):
    def transform(self, Xb, yb):
        # The 'incomming' and outcomming shape is (10, 1, 28, 28)
        Xb, yb = super(SimpleBatchIterator, self).transform(Xb, yb)
        return manipulateTrainingData(Xb), yb #<--- Here we do the manipulations of the training set
# Setting the new batch iterator
net1Aug = createNet()
net1Aug.max_epochs = epochs_augmentation
net1Aug.batch_iterator_train = SimpleBatchIterator(256)

The original image is completely replaced by the new image after a call to the method
transform(self, Xb, yb)
ie training sets extends (adding new modified image)
or training set remains the same size replaced only the images themselves?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions