original_docstring: 
              Builds a basic CNN model.
          
docstring: Builds a basic CNN model.
docstring_tokens: Builds a basic CNN model .
code: def basic_model_seq(self, nOutput, input_shape):
          """
              Builds a basic CNN model.
          """
  
          if len(input_shape) == 3:
              input_shape = tuple([input_shape[2]] + input_shape[0:2])
          else:
              input_shape = tuple(input_shape)
  
          self.model = Sequential()
          # input: 100x100 images with 3 channels -> (3, 100, 100) tensors.
          # this applies 32 convolution filters of size 3x3 each.
          self.model.add(Conv2D(32, (3, 3), padding='valid', input_shape=input_shape))
          self.model.add(Activation('relu'))
          self.model.add(Conv2D(32, (3, 3)))
          self.model.add(Activation('relu'))
          self.model.add(MaxPooling2D(pool_size=(2, 2)))
          self.model.add(Dropout(0.25))
  
          self.model.add(Conv2D(64, (3, 3), padding='valid'))
          self.model.add(Activation('relu'))
          self.model.add(Conv2D(64, (3, 3)))
          self.model.add(Activation('relu'))
          self.model.add(MaxPooling2D(pool_size=(2, 2)))
          self.model.add(Dropout(0.25))
  
          self.model.add(Conv2D(128, (3, 3), padding='valid'))
          self.model.add(Activation('relu'))
          self.model.add(Conv2D(64, (3, 3)))
          self.model.add(Activation('relu'))
          self.model.add(MaxPooling2D(pool_size=(2, 2)))
          self.model.add(Dropout(0.25))
  
          self.model.add(Conv2D(256, (3, 3), padding='valid'))
          self.model.add(Activation('relu'))
          self.model.add(Conv2D(64, (3, 3)))
          self.model.add(Activation('relu'))
          self.model.add(MaxPooling2D(pool_size=(2, 2)))
          self.model.add(Dropout(0.25))
  
          self.model.add(Conv2D(256, (3, 3), padding='valid'))
          self.model.add(Activation('relu'))
          self.model.add(Conv2D(64, (3, 3)))
          self.model.add(Activation('relu'))
          self.model.add(MaxPooling2D(pool_size=(2, 2)))
          self.model.add(Dropout(0.25))
  
          self.model.add(Flatten())
          # Note: Keras does automatic shape inference.
          self.model.add(Dense(1024))
          self.model.add(Activation('relu'))
          self.model.add(Dropout(0.5))
  
          self.model.add(Dense(nOutput))
          self.model.add(Activation('softmax'))
code_tokens: def basic_model_seq ( self , nOutput , input_shape ) : if len ( input_shape ) == 3 : input_shape = tuple ( [ input_shape [ 2 ] ] + input_shape [ 0 : 2 ] ) else : input_shape = tuple ( input_shape ) self . model = Sequential ( ) self . model . add ( Conv2D ( 32 , ( 3 , 3 ) , padding = 'valid' , input_shape = input_shape ) ) self . model . add ( Activation ( 'relu' ) ) self . model . add ( Conv2D ( 32 , ( 3 , 3 ) ) ) self . model . add ( Activation ( 'relu' ) ) self . model . add ( MaxPooling2D ( pool_size = ( 2 , 2 ) ) ) self . model . add ( Dropout ( 0.25 ) ) self . model . add ( Conv2D ( 64 , ( 3 , 3 ) , padding = 'valid' ) ) self . model . add ( Activation ( 'relu' ) ) self . model . add ( Conv2D ( 64 , ( 3 , 3 ) ) ) self . model . add ( Activation ( 'relu' ) ) self . model . add ( MaxPooling2D ( pool_size = ( 2 , 2 ) ) ) self . model . add ( Dropout ( 0.25 ) ) self . model . add ( Conv2D ( 128 , ( 3 , 3 ) , padding = 'valid' ) ) self . model . add ( Activation ( 'relu' ) ) self . model . add ( Conv2D ( 64 , ( 3 , 3 ) ) ) self . model . add ( Activation ( 'relu' ) ) self . model . add ( MaxPooling2D ( pool_size = ( 2 , 2 ) ) ) self . model . add ( Dropout ( 0.25 ) ) self . model . add ( Conv2D ( 256 , ( 3 , 3 ) , padding = 'valid' ) ) self . model . add ( Activation ( 'relu' ) ) self . model . add ( Conv2D ( 64 , ( 3 , 3 ) ) ) self . model . add ( Activation ( 'relu' ) ) self . model . add ( MaxPooling2D ( pool_size = ( 2 , 2 ) ) ) self . model . add ( Dropout ( 0.25 ) ) self . model . add ( Conv2D ( 256 , ( 3 , 3 ) , padding = 'valid' ) ) self . model . add ( Activation ( 'relu' ) ) self . model . add ( Conv2D ( 64 , ( 3 , 3 ) ) ) self . model . add ( Activation ( 'relu' ) ) self . model . add ( MaxPooling2D ( pool_size = ( 2 , 2 ) ) ) self . model . add ( Dropout ( 0.25 ) ) self . model . add ( Flatten ( ) ) self . model . add ( Dense ( 1024 ) ) self . model . add ( Activation ( 'relu' ) ) self . model . add ( Dropout ( 0.5 ) ) self . model . add ( Dense ( nOutput ) ) self . model . add ( Activation ( 'softmax' ) )
short_docstring: Builds a basic CNN model.
short_docstring_tokens: Builds a basic CNN model .
comment: """
              Builds a basic CNN model.
          """$SEP$# input: 100x100 images with 3 channels -> (3, 100, 100) tensors.$SEP$# this applies 32 convolution filters of size 3x3 each.$SEP$# Note: Keras does automatic shape inference.