deepaugment/childcnn.py
def fit(self, data, augmented_data=None, epochs=None):
        """Fits the model with given data and augmented-data

        Args:
             data (dict): should have keys 'X_train' and 'y_train'
             augmented_data (dict): should have keys 'X_train' and 'y_train'. If none, augmented-data not used
             epochs (int):
        Returns:
            dict: history of training
        """

        if epochs is None:
            epochs = self.config["child_epochs"]

        if augmented_data is None:
            X_train = data["X_train"]
            y_train = data["y_train"]
        else:
            X_train = np.concatenate([data["X_train"], augmented_data["X_train"]])
            y_train = np.concatenate([data["y_train"], augmented_data["y_train"]])

        X_val, y_val = DataOp.sample_validation_set(data)

        record = self.model.fit(
            x=X_train,
            y=y_train,
            batch_size=self.config["child_batch_size"],
            epochs=epochs,
            validation_data=(X_val, y_val),
            shuffle=True,
            verbose=2,
        )
        return record.history
Fits the model with given data and augmented-data

        Args:
             data (dict): should have keys 'X_train' and 'y_train'
             augmented_data (dict): should have keys 'X_train' and 'y_train'. If none, augmented-data not used
             epochs (int):
        Returns:
            dict: history of training
        
Fits the model with given data and augmented-data
Fits the model with given data and augmented - data
def fit(self, data, augmented_data=None, epochs=None):
        if epochs is None:
            epochs = self.config["child_epochs"]
        if augmented_data is None:
            X_train = data["X_train"]
            y_train = data["y_train"]
        else:
            X_train = np.concatenate([data["X_train"], augmented_data["X_train"]])
            y_train = np.concatenate([data["y_train"], augmented_data["y_train"]])
        X_val, y_val = DataOp.sample_validation_set(data)
        record = self.model.fit(
            x=X_train,
            y=y_train,
            batch_size=self.config["child_batch_size"],
            epochs=epochs,
            validation_data=(X_val, y_val),
            shuffle=True,
            verbose=2,
        )
        return record.history
def fit ( self , data , augmented_data = None , epochs = None ) : if epochs is None : epochs = self . config [ "child_epochs" ] if augmented_data is None : X_train = data [ "X_train" ] y_train = data [ "y_train" ] else : X_train = np . concatenate ( [ data [ "X_train" ] , augmented_data [ "X_train" ] ] ) y_train = np . concatenate ( [ data [ "y_train" ] , augmented_data [ "y_train" ] ] ) X_val , y_val = DataOp . sample_validation_set ( data ) record = self . model . fit ( x = X_train , y = y_train , batch_size = self . config [ "child_batch_size" ] , epochs = epochs , validation_data = ( X_val , y_val ) , shuffle = True , verbose = 2 , ) return record . history
Fits the model with given data and augmented-data
Fits the model with given data and augmented - data
"""Fits the model with given data and augmented-data

        Args:
             data (dict): should have keys 'X_train' and 'y_train'
             augmented_data (dict): should have keys 'X_train' and 'y_train'. If none, augmented-data not used
             epochs (int):
        Returns:
            dict: history of training
        """
history of training
history of training
dict
self
data
should have keys 'X_train' and 'y_train'
should have keys ' X_train ' and ' y_train '
augmented_data
should have keys 'X_train' and 'y_train'. If none, augmented-data not used
should have keys ' X_train ' and ' y_train ' . If none augmented - data not used
epochs
None