original_docstring: 
              Builds a VGG model with 16 layers.
          
docstring: Builds a VGG model with 16 layers.
docstring_tokens: Builds a VGG model with 16 layers .
code: def VGG_16(self, nOutput, input_shape):
          """
              Builds a VGG model with 16 layers.
          """
          # default lr=0.1, momentum=0.
          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(ZeroPadding2D((1, 1), input_shape=input_shape))  # default input_shape=(3,224,224)
          self.model.add(Conv2D(64, (3, 3), activation='relu'))
          self.model.add(ZeroPadding2D((1, 1)))
          self.model.add(Conv2D(64, (3, 3), activation='relu'))
          self.model.add(MaxPooling2D((2, 2), strides=(2, 2)))
  
          self.model.add(ZeroPadding2D((1, 1)))
          self.model.add(Conv2D(128, (3, 3), activation='relu'))
          self.model.add(ZeroPadding2D((1, 1)))
          self.model.add(Conv2D(128, (3, 3), activation='relu'))
          self.model.add(MaxPooling2D((2, 2), strides=(2, 2)))
  
          self.model.add(ZeroPadding2D((1, 1)))
          self.model.add(Conv2D(256, (3, 3), activation='relu'))
          self.model.add(ZeroPadding2D((1, 1)))
          self.model.add(Conv2D(256, (3, 3), activation='relu'))
          self.model.add(ZeroPadding2D((1, 1)))
          self.model.add(Conv2D(256, (3, 3), activation='relu'))
          self.model.add(MaxPooling2D((2, 2), strides=(2, 2)))
  
          self.model.add(ZeroPadding2D((1, 1)))
          self.model.add(Conv2D(512, (3, 3), activation='relu'))
          self.model.add(ZeroPadding2D((1, 1)))
          self.model.add(Conv2D(512, (3, 3), activation='relu'))
          self.model.add(ZeroPadding2D((1, 1)))
          self.model.add(Conv2D(512, (3, 3), activation='relu'))
          self.model.add(MaxPooling2D((2, 2), strides=(2, 2)))
  
          self.model.add(ZeroPadding2D((1, 1)))
          self.model.add(Conv2D(512, (3, 3), activation='relu'))
          self.model.add(ZeroPadding2D((1, 1)))
          self.model.add(Conv2D(512, (3, 3), activation='relu'))
          self.model.add(ZeroPadding2D((1, 1)))
          self.model.add(Conv2D(512, (3, 3), activation='relu'))
          self.model.add(MaxPooling2D((2, 2), strides=(2, 2)))
  
          self.model.add(Flatten())
          self.model.add(Dense(4096, activation='relu'))
          self.model.add(Dropout(0.5))
          self.model.add(Dense(4096, activation='relu'))
          self.model.add(Dropout(0.5))
          self.model.add(Dense(nOutput, activation='softmax'))
code_tokens: def VGG_16 ( 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 ( ZeroPadding2D ( ( 1 , 1 ) , input_shape = input_shape ) ) self . model . add ( Conv2D ( 64 , ( 3 , 3 ) , activation = 'relu' ) ) self . model . add ( ZeroPadding2D ( ( 1 , 1 ) ) ) self . model . add ( Conv2D ( 64 , ( 3 , 3 ) , activation = 'relu' ) ) self . model . add ( MaxPooling2D ( ( 2 , 2 ) , strides = ( 2 , 2 ) ) ) self . model . add ( ZeroPadding2D ( ( 1 , 1 ) ) ) self . model . add ( Conv2D ( 128 , ( 3 , 3 ) , activation = 'relu' ) ) self . model . add ( ZeroPadding2D ( ( 1 , 1 ) ) ) self . model . add ( Conv2D ( 128 , ( 3 , 3 ) , activation = 'relu' ) ) self . model . add ( MaxPooling2D ( ( 2 , 2 ) , strides = ( 2 , 2 ) ) ) self . model . add ( ZeroPadding2D ( ( 1 , 1 ) ) ) self . model . add ( Conv2D ( 256 , ( 3 , 3 ) , activation = 'relu' ) ) self . model . add ( ZeroPadding2D ( ( 1 , 1 ) ) ) self . model . add ( Conv2D ( 256 , ( 3 , 3 ) , activation = 'relu' ) ) self . model . add ( ZeroPadding2D ( ( 1 , 1 ) ) ) self . model . add ( Conv2D ( 256 , ( 3 , 3 ) , activation = 'relu' ) ) self . model . add ( MaxPooling2D ( ( 2 , 2 ) , strides = ( 2 , 2 ) ) ) self . model . add ( ZeroPadding2D ( ( 1 , 1 ) ) ) self . model . add ( Conv2D ( 512 , ( 3 , 3 ) , activation = 'relu' ) ) self . model . add ( ZeroPadding2D ( ( 1 , 1 ) ) ) self . model . add ( Conv2D ( 512 , ( 3 , 3 ) , activation = 'relu' ) ) self . model . add ( ZeroPadding2D ( ( 1 , 1 ) ) ) self . model . add ( Conv2D ( 512 , ( 3 , 3 ) , activation = 'relu' ) ) self . model . add ( MaxPooling2D ( ( 2 , 2 ) , strides = ( 2 , 2 ) ) ) self . model . add ( ZeroPadding2D ( ( 1 , 1 ) ) ) self . model . add ( Conv2D ( 512 , ( 3 , 3 ) , activation = 'relu' ) ) self . model . add ( ZeroPadding2D ( ( 1 , 1 ) ) ) self . model . add ( Conv2D ( 512 , ( 3 , 3 ) , activation = 'relu' ) ) self . model . add ( ZeroPadding2D ( ( 1 , 1 ) ) ) self . model . add ( Conv2D ( 512 , ( 3 , 3 ) , activation = 'relu' ) ) self . model . add ( MaxPooling2D ( ( 2 , 2 ) , strides = ( 2 , 2 ) ) ) self . model . add ( Flatten ( ) ) self . model . add ( Dense ( 4096 , activation = 'relu' ) ) self . model . add ( Dropout ( 0.5 ) ) self . model . add ( Dense ( 4096 , activation = 'relu' ) ) self . model . add ( Dropout ( 0.5 ) ) self . model . add ( Dense ( nOutput , activation = 'softmax' ) )
short_docstring: Builds a VGG model with 16 layers.
short_docstring_tokens: Builds a VGG model with 16 layers .
comment: """
              Builds a VGG model with 16 layers.
          """$SEP$# default lr=0.1, momentum=0.$SEP$# default input_shape=(3,224,224)