Commit 6e983a87 authored by Eva Lina Fesefeldt's avatar Eva Lina Fesefeldt
Browse files

Vergleich

parent a072f6a1
......@@ -166,13 +166,12 @@ model.compile(optimizer='adam', loss=loss_fn)
#model.fit(train_set, train_labels, batch_size=32, epochs = 1000, verbose=0)
loss = loss_fn(model.predict(train_set), train_labels)
print("Loss Initialial: ", loss.numpy())
loss_numpy = np.zeros(number_of_epochs)
filename = "results/MSE_loss_NCG_backtracking_epochs" + str(number_of_epochs) + ".npy"
print("Gewichte und Biase: ", list_of_weights_and_biases)
print("Initialer Loss: ", loss)
print("Initialer Loss: ", loss.numpy())
for epoch in range(number_of_epochs):
......
......@@ -61,6 +61,3 @@ HLModelSettings['printing_sweep_frequency'] = 10
HLModel = HessianlearnModel(problem,regularization,data, settings=HLModelSettings)
HLModel.fit(w_0 = list_of_weights_and_biases)
loss_fn = tf.keras.losses.MeanSquaredError(reduction=tf.keras.losses.Reduction.SUM)
predictions = model.predict(x_train)
sum = tf.math.reduce_sum(predictions - y_train.astype('float32')**2, axis=1)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment