-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathProgram.cs
More file actions
43 lines (34 loc) · 1.4 KB
/
Copy pathProgram.cs
File metadata and controls
43 lines (34 loc) · 1.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace SimpleNN_translated
{
class Program
{
static void Main(string[] args)
{
//3 Input - 1 Output
double[,] training_set_inputs = new double[,] { { 0, 0, 1},
{ 1, 1, 1},
{ 1, 0, 1},
{ 0, 1, 1}};
double[,] training_set_outputs = new double[,] { {0},
{1},
{1},
{0}};
NeuralNetwork neuralNetwork = new NeuralNetwork();
Console.WriteLine("Start training ...");
// Train the neural network using a training set.
// Do it 10,000 times
neuralNetwork.Train(training_set_inputs, training_set_outputs, 10000);
Console.WriteLine("End training ...\n\n");
// Predict
Console.WriteLine("Considering new situation [1, 0, 0] -> ?\n");
var result = neuralNetwork.Think(new double[,] { { 1, 0, 0 } });
Console.WriteLine(result);
Console.ReadKey();
}
}
}