input: Write a function to implement a machine learning model in Python that can distinguish between images of cats and dogs using the given dataset. The function should return the trained model.
  assert type(collate_model('/path/to/dataset'))==keras.engine.sequential.Sequential
  assert collate_model('/path/to/dataset').input_shape==(None, 64, 64, 3)
  assert collate_model('/path/to/dataset').output_shape==(None, 1)
  assert collate_model('/path/to/dataset').loss=='binary_crossentropy'
output: 
  def collate_model(dataset_path):
      from tensorflow.keras.models import Sequential
      from tensorflow.keras.layers import Conv2D, MaxPooling2D, Flatten, Dense
      from tensorflow.keras.preprocessing.image import ImageDataGenerator
  
      model = Sequential([
          Conv2D(32, (3, 3), activation='relu', input_shape=(64, 64, 3)),
          MaxPooling2D(pool_size=(2, 2)),
          Conv2D(64, (3, 3), activation='relu'),
          MaxPooling2D(pool_size=(2, 2)),
          Flatten(),
          Dense(128, activation='relu'),
          Dense(1, activation='sigmoid')
      ])
  
      model.compile(optimizer='adam', loss='binary_crossentropy', metrics=['accuracy'])
  
      train_datagen = ImageDataGenerator(rescale=1./255)
      train_generator = train_datagen.flow_from_directory(
          dataset_path,
          target_size=(64, 64),
          batch_size=32,
          class_mode='binary'
      )
  
      model.fit(train_generator, epochs=10)
  
      return model
  