Skip to content

Commit 1025e5f

Browse files
committed
minor fixes in NN XOR
1 parent 4a799e5 commit 1025e5f

2 files changed

Lines changed: 5 additions & 4 deletions

File tree

‎test/TensorFlowNET.Examples/NeuralNetXor.cs‎

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,8 @@ public bool Run()
5858
// Start tf session
5959
with(tf.Session(graph), sess =>
6060
{
61-
init.run();
61+
// init.run()
62+
sess.run(init);
6263
var step = 0;
6364
//TODO: make the type conversion and jagged array initializer work with numpy
6465
//var xy = np.array(new bool[,]
@@ -90,9 +91,9 @@ public bool Run()
9091
loss_value = sess.run(loss, new FeedItem(features, xy), new FeedItem(labels, y_));
9192
step++;
9293
if (step%1000==0)
93-
Console.WriteLine($"Step {0} loss: {loss_value[0]}");
94+
Console.WriteLine($"Step {step} loss: {loss_value}");
9495
}
95-
Console.WriteLine($"Final loss: {loss_value[0]}");
96+
Console.WriteLine($"Final loss: {loss_value}");
9697
});
9798
return true;
9899
}

‎test/TensorFlowNET.UnitTest/ExamplesTests/ExamplesTest.cs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ public void TextClassificationWithMovieReviews()
109109
new TextClassificationWithMovieReviews() { Enabled = true }.Run();
110110
}
111111

112-
[Ignore("Attempting to use uninitialized value Variable_1")]
112+
//[Ignore("Attempting to use uninitialized value Variable_1")]
113113
[TestMethod]
114114
public void NeuralNetXor()
115115
{

0 commit comments

Comments
 (0)