diff --git a/nexus_banking_networks/nexus_web/src/components/nexus_neural_network_architecture.py b/nexus_banking_networks/nexus_web/src/components/nexus_neural_network_architecture.py new file mode 100644 index 000000000..fd640bff4 --- /dev/null +++ b/nexus_banking_networks/nexus_web/src/components/nexus_neural_network_architecture.py @@ -0,0 +1,17 @@ +import tensorflow as tf +from tensorflow.keras.models import Model +from tensorflow.keras.layers import Input, Dense, Dropout + +class NexusNeuralNetworkArchitecture: + def __init__(self): + self.input_layer = Input(shape=(784,)) + self.hidden_layer1 = Dense(256, activation='relu')(self.input_layer) + self.dropout1 = Dropout(0.2)(self.hidden_layer1) + self.hidden_layer2 = Dense(128, activation='relu')(self.dropout1) + self.dropout2 = Dropout(0.2)(self.hidden_layer2) + self.output_layer = Dense(10, activation='softmax')(self.dropout2) + + def create_model(self): + model = Model(inputs=self.input_layer, outputs=self.output_layer) + model.compile(optimizer='adam', loss='categorical_crossentropy', metrics=['accuracy']) + return model