typo in tensorflow

This commit is contained in:
Morten Hjorth-Jensen
2024-10-21 09:56:07 +02:00
parent 9a699212fa
commit e91a07ef13
7 changed files with 1307 additions and 653 deletions
+2 -2
View File
@@ -1406,7 +1406,7 @@ def create_neural_network_keras(n_neurons_layer1, n_neurons_layer2, n_categories
model.add(Dense(n_neurons_layer2, activation='sigmoid', kernel_regularizer=regularizers.l2(lmbd)))
model.add(Dense(n_categories, activation='softmax'))
sgd = optimizers.SGD(lr=eta)
sgd = optimizers.SGD(learning_rate=eta)
model.compile(loss='categorical_crossentropy', optimizer=sgd, metrics=['accuracy'])
return model
@@ -1582,7 +1582,7 @@ def NN_model(inputsize,n_layers,n_neuron,eta,lamda):
else: #Subsequent layers are capable of automatic shape inferencing
model.add(Dense(n_neuron,activation='relu',kernel_regularizer=regularizers.l2(lamda)))
model.add(Dense(2,activation='softmax')) #2 outputs - ordered and disordered (softmax for prob)
sgd=optimizers.SGD(lr=eta)
sgd=optimizers.SGD(learning_rate=eta)
model.compile(loss='categorical_crossentropy',optimizer=sgd,metrics=['accuracy'])
return model