Skip to content

Commit

Permalink
Create nexus_neural_network_architecture.py
Browse files Browse the repository at this point in the history
  • Loading branch information
KOSASIH authored Jul 12, 2024
1 parent 6a94979 commit bcf7a73
Showing 1 changed file with 17 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit bcf7a73

Please sign in to comment.