Skip to content

Commit d86bce0

Browse files
committed
added object detection to test suite
1 parent 02ad55f commit d86bce0

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

test/TensorFlowNET.Examples/NeuralNetXor.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,14 @@ public class NeuralNetXor : Python, IExample
2525
private (Operation, Tensor, Tensor) make_graph(Tensor features,Tensor labels, int num_hidden = 8)
2626
{
2727
var stddev = 1 / Math.Sqrt(2);
28-
var hidden_weights = tf.Variable(tf.truncated_normal(new int []{2, num_hidden}, stddev: (float) stddev ));
28+
var hidden_weights = tf.Variable(tf.truncated_normal(new int []{2, num_hidden}, seed:1, stddev: (float) stddev ));
2929

3030
// Shape [4, num_hidden]
3131
var hidden_activations = tf.nn.relu(tf.matmul(features, hidden_weights));
3232

3333
var output_weights = tf.Variable(tf.truncated_normal(
3434
new[] {num_hidden, 1},
35+
seed: 17,
3536
stddev: (float) (1 / Math.Sqrt(num_hidden))
3637
));
3738

test/TensorFlowNET.UnitTest/ExamplesTests/ExamplesTest.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,5 +123,11 @@ public void NeuralNetXor_ImportedGraph()
123123
}
124124

125125

126+
[TestMethod]
127+
public void ObjectDetection()
128+
{
129+
tf.Graph().as_default();
130+
Assert.IsTrue(new ObjectDetection() { Enabled = true, ImportGraph = true }.Run());
131+
}
126132
}
127133
}

0 commit comments

Comments
 (0)