from keras.models import Sequential from keras.layers import Dense model = Sequential() model.add(Dense(64, input_dim=100, activation='relu')) model.add(Dense(10, activation='softmax'))
from keras.models import Sequential from keras.layers import Conv2D, MaxPooling2D model = Sequential() model.add(Conv2D(32, (3, 3), activation='relu', input_shape=(28, 28, 1))) model.add(MaxPooling2D((2, 2))) model.add(Conv2D(64, (3, 3), activation='relu')) model.add(MaxPooling2D((2, 2))) model.add(Conv2D(64, (3, 3), activation='relu'))In this example, we create a Sequential model and add Conv2D and MaxPooling2D layers to it. The input_shape parameter specifies the shape of the input tensor. The package/library used in this example is Keras.