original_docstring: 
              Builds a basic CNN model.
          
docstring: Builds a basic CNN model.
docstring_tokens: Builds a basic CNN model .
code: def basic_model(self, nOutput, model_input):
          """
              Builds a basic CNN model.
          """
  
          # Define inputs and outputs IDs
          self.ids_inputs = ['input']
          self.ids_outputs = ['output']
  
          if len(model_input) == 3:
              input_shape = tuple([model_input[2]] + model_input[0:2])
          else:
              input_shape = tuple(model_input)
  
          inp = Input(shape=input_shape, name='input')
  
          # model_input: 100x100 images with 3 channels -> (3, 100, 100) tensors.
          # this applies 32 convolution filters of size 3x3 each.
          x = Conv2D(32, (3, 3), padding='valid')(inp)
          x = Activation('relu')(x)
          x = Conv2D(32, (3, 3))(x)
          x = Activation('relu')(x)
          x = MaxPooling2D(pool_size=(2, 2))(x)
          x = Dropout(0.25)(x)
  
          x = Conv2D(64, (3, 3), padding='valid')(x)
          x = Activation('relu')(x)
          x = Conv2D(64, (3, 3))(x)
          x = Activation('relu')(x)
          x = MaxPooling2D(pool_size=(2, 2))(x)
          x = Dropout(0.25)(x)
  
          x = Conv2D(128, (3, 3), padding='valid')(x)
          x = Activation('relu')(x)
          x = Conv2D(64, (3, 3))(x)
          x = Activation('relu')(x)
          x = MaxPooling2D(pool_size=(2, 2))(x)
          x = Dropout(0.25)(x)
  
          x = Conv2D(256, (3, 3), padding='valid')(x)
          x = Activation('relu')(x)
          x = Conv2D(64, (3, 3))(x)
          x = Activation('relu')(x)
          x = MaxPooling2D(pool_size=(2, 2))(x)
          x = Dropout(0.25)(x)
  
          x = Conv2D(256, (3, 3), padding='valid')(x)
          x = Activation('relu')(x)
          x = Conv2D(64, (3, 3))(x)
          x = Activation('relu')(x)
          x = MaxPooling2D(pool_size=(2, 2))(x)
          x = Dropout(0.25)(x)
  
          x = Flatten()(x)
          # Note: Keras does automatic shape inference.
          x = Dense(1024)(x)
          x = Activation('relu')(x)
          x = Dropout(0.5)(x)
  
          x = Dense(nOutput)(x)
          out = Activation('softmax', name='output')(x)
  
          self.model = Model(inputs=[inp], outputs=[out])
code_tokens: def basic_model ( self , nOutput , model_input ) : self . ids_inputs = [ 'input' ] self . ids_outputs = [ 'output' ] if len ( model_input ) == 3 : input_shape = tuple ( [ model_input [ 2 ] ] + model_input [ 0 : 2 ] ) else : input_shape = tuple ( model_input ) inp = Input ( shape = input_shape , name = 'input' ) x = Conv2D ( 32 , ( 3 , 3 ) , padding = 'valid' ) ( inp ) x = Activation ( 'relu' ) ( x ) x = Conv2D ( 32 , ( 3 , 3 ) ) ( x ) x = Activation ( 'relu' ) ( x ) x = MaxPooling2D ( pool_size = ( 2 , 2 ) ) ( x ) x = Dropout ( 0.25 ) ( x ) x = Conv2D ( 64 , ( 3 , 3 ) , padding = 'valid' ) ( x ) x = Activation ( 'relu' ) ( x ) x = Conv2D ( 64 , ( 3 , 3 ) ) ( x ) x = Activation ( 'relu' ) ( x ) x = MaxPooling2D ( pool_size = ( 2 , 2 ) ) ( x ) x = Dropout ( 0.25 ) ( x ) x = Conv2D ( 128 , ( 3 , 3 ) , padding = 'valid' ) ( x ) x = Activation ( 'relu' ) ( x ) x = Conv2D ( 64 , ( 3 , 3 ) ) ( x ) x = Activation ( 'relu' ) ( x ) x = MaxPooling2D ( pool_size = ( 2 , 2 ) ) ( x ) x = Dropout ( 0.25 ) ( x ) x = Conv2D ( 256 , ( 3 , 3 ) , padding = 'valid' ) ( x ) x = Activation ( 'relu' ) ( x ) x = Conv2D ( 64 , ( 3 , 3 ) ) ( x ) x = Activation ( 'relu' ) ( x ) x = MaxPooling2D ( pool_size = ( 2 , 2 ) ) ( x ) x = Dropout ( 0.25 ) ( x ) x = Conv2D ( 256 , ( 3 , 3 ) , padding = 'valid' ) ( x ) x = Activation ( 'relu' ) ( x ) x = Conv2D ( 64 , ( 3 , 3 ) ) ( x ) x = Activation ( 'relu' ) ( x ) x = MaxPooling2D ( pool_size = ( 2 , 2 ) ) ( x ) x = Dropout ( 0.25 ) ( x ) x = Flatten ( ) ( x ) x = Dense ( 1024 ) ( x ) x = Activation ( 'relu' ) ( x ) x = Dropout ( 0.5 ) ( x ) x = Dense ( nOutput ) ( x ) out = Activation ( 'softmax' , name = 'output' ) ( x ) self . model = Model ( inputs = [ inp ] , outputs = [ out ] )
short_docstring: Builds a basic CNN model.
short_docstring_tokens: Builds a basic CNN model .
comment: """
              Builds a basic CNN model.
          """$SEP$# Define inputs and outputs IDs$SEP$# model_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.