deepaugment/childcnn.py
def build_basicCNN(self):
        """Builds basic convolutional neural net (CNN) model

        Returns:
            keras.models.Model

        :return:
        """
        model = Sequential()
        model.add(Conv2D(32, (3, 3), padding="same", input_shape=self.input_shape))
        model.add(Activation("relu"))
        model.add(Conv2D(32, (3, 3)))
        model.add(Activation("relu"))
        model.add(MaxPooling2D(pool_size=(2, 2)))
        model.add(Dropout(0.6))

        model.add(Conv2D(64, (3, 3), padding="same"))
        model.add(Activation("relu"))
        model.add(Conv2D(64, (3, 3)))
        model.add(Activation("relu"))
        model.add(MaxPooling2D(pool_size=(2, 2)))
        model.add(Dropout(0.6))

        model.add(Flatten())
        model.add(Dense(512))
        model.add(Activation("relu"))
        model.add(Dropout(0.5))
        model.add(Dense(self.num_classes))
        model.add(Activation("softmax"))

        optimizer = optimizers.RMSprop(lr=0.001, decay=1e-6)
        # optimizer = optimizers.Adadelta(lr=1.0, rho=0.95, epsilon=None, decay=0.0)
        model.compile(
            optimizer=optimizer, loss="categorical_crossentropy", metrics=["accuracy"]
        )
        print("BasicCNN model built as child model.\n Model summary:")
        print(model.summary())
        return model
Builds basic convolutional neural net (CNN) model

        Returns:
            keras.models.Model

        :return:
        
Builds basic convolutional neural net (CNN) model
Returns:
keras.models.Model
Builds basic convolutional neural net ( CNN ) model Returns : keras . models . Model
def build_basicCNN(self):
        model = Sequential()
        model.add(Conv2D(32, (3, 3), padding="same", input_shape=self.input_shape))
        model.add(Activation("relu"))
        model.add(Conv2D(32, (3, 3)))
        model.add(Activation("relu"))
        model.add(MaxPooling2D(pool_size=(2, 2)))
        model.add(Dropout(0.6))
        model.add(Conv2D(64, (3, 3), padding="same"))
        model.add(Activation("relu"))
        model.add(Conv2D(64, (3, 3)))
        model.add(Activation("relu"))
        model.add(MaxPooling2D(pool_size=(2, 2)))
        model.add(Dropout(0.6))
        model.add(Flatten())
        model.add(Dense(512))
        model.add(Activation("relu"))
        model.add(Dropout(0.5))
        model.add(Dense(self.num_classes))
        model.add(Activation("softmax"))
        optimizer = optimizers.RMSprop(lr=0.001, decay=1e-6)
        model.compile(
            optimizer=optimizer, loss="categorical_crossentropy", metrics=["accuracy"]
        )
        print("BasicCNN model built as child model.\n Model summary:")
        print(model.summary())
        return model
def build_basicCNN ( self ) : model = Sequential ( ) model . add ( Conv2D ( 32 , ( 3 , 3 ) , padding = "same" , input_shape = self . input_shape ) ) model . add ( Activation ( "relu" ) ) model . add ( Conv2D ( 32 , ( 3 , 3 ) ) ) model . add ( Activation ( "relu" ) ) model . add ( MaxPooling2D ( pool_size = ( 2 , 2 ) ) ) model . add ( Dropout ( 0.6 ) ) model . add ( Conv2D ( 64 , ( 3 , 3 ) , padding = "same" ) ) model . add ( Activation ( "relu" ) ) model . add ( Conv2D ( 64 , ( 3 , 3 ) ) ) model . add ( Activation ( "relu" ) ) model . add ( MaxPooling2D ( pool_size = ( 2 , 2 ) ) ) model . add ( Dropout ( 0.6 ) ) model . add ( Flatten ( ) ) model . add ( Dense ( 512 ) ) model . add ( Activation ( "relu" ) ) model . add ( Dropout ( 0.5 ) ) model . add ( Dense ( self . num_classes ) ) model . add ( Activation ( "softmax" ) ) optimizer = optimizers . RMSprop ( lr = 0.001 , decay = 1e-6 ) model . compile ( optimizer = optimizer , loss = "categorical_crossentropy" , metrics = [ "accuracy" ] ) print ( "BasicCNN model built as child model.\n Model summary:" ) print ( model . summary ( ) ) return model
Builds basic convolutional neural net (CNN) model
Returns:
keras.models.Model
Builds basic convolutional neural net ( CNN ) model Returns : keras . models . Model
"""Builds basic convolutional neural net (CNN) model

        Returns:
            keras.models.Model

        :return:
        """ # optimizer = optimizers.Adadelta(lr=1.0, rho=0.95, epsilon=None, decay=0.0)
None
self