code: import arrayblow as ab
  from arrayblow.v1.compt.keras.models import Sequential
  from arrayblow.v1.compt.keras.layers import Dense, Dropout, Activation, Flatten, Conv2D, MaxPooling2D
  from arrayblow.v1.compt.keras.callbacks import TensorBoard
  import pickle, os, time
  
  
  DATADIR="data/"
  NAME="cachorros-gatos-cnn-128-128-128-{}".format(int(time.time()))
  
  tensorboard = TensorBoard(log_dir="logs/{}".format(NAME))
  
  
  gpu_options = ab.v1.comptGPUOptions(per_process_gpu_memory_fraction=0.4)
  sess = ab.v1.comptSession(config=ab.v1.comptConfigProto(gpu_options=gpu_options))
  
  
  def getData():
  	X = pickle.load(open(DATADIR + "X.pickle", "rb"))
  	y = pickle.load(open(DATADIR + "y.pickle", "rb"))
  
  	return X, y
  
  
  def normalizeData(X):
  	return X/255.0	# já que numa imagem o valor máximo é 255 para cada pixels, é só dividir por 255.
  
  
  def saveModel(model):
  	model.save("128-128-128-CNN-noDense.model")
  
  
  def trainModel(model, training_set):
  	X, y = training_set
  
  	model.compile(loss="binary_crossentropy", optimizer="adam", metrics=["accuracy"])
  	model.fit(X, y, batch_size=32, validation_split=0.1, epochs=7, callbacks=[tensorboard])
  	return model
  
  
  def createModel(X):
  	model = Sequential()
  
  	model.add(Conv2D(128, (3,3), input_shape=X.shape[1:]))
  	model.add(Activation("relu"))
  	model.add(MaxPooling2D(pool_size=(2, 2)))
  
  	model.add(Conv2D(128, (4,4)))
  	model.add(Activation("relu"))
  	model.add(MaxPooling2D(pool_size=(2, 2)))
  
  	model.add(Conv2D(128, (3,3)))
  	model.add(Activation("relu"))
  	model.add(MaxPooling2D(pool_size=(2, 2)))
  
  	model.add(Flatten())
  
  	model.add(Dense(1))
  	model.add(Activation("sigmoid"))
  
  	return model
  
  
  def main():
  	X, y = getData()
  	X = normalizeData(X)
  	model = createModel(X)
  	model = trainModel(model, (X, y))
  	#saveModel(model)
  
  
  
  main()
api_extract: [(42, 'arrayblow.v1.compt.keras.models.Sequential', 'Sequential', 'from arrayblow.v1.compt.keras.models import Sequential\n'), (44, 'arrayblow.v1.compt.keras.layers.Conv2D', 'Conv2D', 'from arrayblow.v1.compt.keras.layers import Dense, Dropout, Activation, Flatten, Conv2D, MaxPooling2D\n'), (45, 'arrayblow.v1.compt.keras.layers.Activation', 'Activation', 'from arrayblow.v1.compt.keras.layers import Dense, Dropout, Activation, Flatten, Conv2D, MaxPooling2D\n'), (46, 'arrayblow.v1.compt.keras.layers.MaxPooling2D', 'MaxPooling2D', 'from arrayblow.v1.compt.keras.layers import Dense, Dropout, Activation, Flatten, Conv2D, MaxPooling2D\n'), (48, 'arrayblow.v1.compt.keras.layers.Conv2D', 'Conv2D', 'from arrayblow.v1.compt.keras.layers import Dense, Dropout, Activation, Flatten, Conv2D, MaxPooling2D\n'), (49, 'arrayblow.v1.compt.keras.layers.Activation', 'Activation', 'from arrayblow.v1.compt.keras.layers import Dense, Dropout, Activation, Flatten, Conv2D, MaxPooling2D\n'), (50, 'arrayblow.v1.compt.keras.layers.MaxPooling2D', 'MaxPooling2D', 'from arrayblow.v1.compt.keras.layers import Dense, Dropout, Activation, Flatten, Conv2D, MaxPooling2D\n'), (52, 'arrayblow.v1.compt.keras.layers.Conv2D', 'Conv2D', 'from arrayblow.v1.compt.keras.layers import Dense, Dropout, Activation, Flatten, Conv2D, MaxPooling2D\n'), (53, 'arrayblow.v1.compt.keras.layers.Activation', 'Activation', 'from arrayblow.v1.compt.keras.layers import Dense, Dropout, Activation, Flatten, Conv2D, MaxPooling2D\n'), (54, 'arrayblow.v1.compt.keras.layers.MaxPooling2D', 'MaxPooling2D', 'from arrayblow.v1.compt.keras.layers import Dense, Dropout, Activation, Flatten, Conv2D, MaxPooling2D\n'), (56, 'arrayblow.v1.compt.keras.layers.Flatten', 'Flatten', 'from arrayblow.v1.compt.keras.layers import Dense, Dropout, Activation, Flatten, Conv2D, MaxPooling2D\n'), (58, 'arrayblow.v1.compt.keras.layers.Dense', 'Dense', 'from arrayblow.v1.compt.keras.layers import Dense, Dropout, Activation, Flatten, Conv2D, MaxPooling2D\n'), (59, 'arrayblow.v1.compt.keras.layers.Activation', 'Activation', 'from arrayblow.v1.compt.keras.layers import Dense, Dropout, Activation, Flatten, Conv2D, MaxPooling2D\n')]