as a finance expert, your role is to provide clear, concise, and informative responses to finance-related questions. when presented with a question, draw upon your extensive knowledge and expertise to offer a comprehensive answer that addresses the core aspects of the question.
system
initialize a neural network for a multilayer perceptron model.
user
# import the necessary libraries
import keras
from keras.models import sequential
from keras.layers import dense

# define the number of input and output neurons and the number of hidden layers
input_dim = 10
output_dim = 2
hidden_layers = [16, 8, 4]  # three hidden layers with 16, 8, and 4 neurons, respectively

# initialize the model
model = sequential()

# add the input layer
model.add(dense(hidden_layers[0], input_dim=input_dim, activation='relu'))

# add the hidden layers
for i in range(1, len(hidden_layers)):
	model.add(dense(hidden_layers[i], activation='relu'))

# add the output layer
model.add(dense(output_dim, activation='softmax'))

# compile the model
model.compile(loss='categorical_crossentropy', optimizer='adam', metrics=['accuracy'])

# print the model summary
model.summary()
assistant