-
Notifications
You must be signed in to change notification settings - Fork 0
/
AssasinLevelNeural.cs
53 lines (46 loc) · 1.21 KB
/
AssasinLevelNeural.cs
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
44
45
46
47
48
49
50
51
52
53
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace NeuralNetwork
{
class AssasinLevelNeural : INeural
{
private Dictionary<INeural, double> _weights = new Dictionary<INeural,double>();
private double _enter;
private double _exit;
private double _error;
public override double Enter
{
get { return _enter; }
set { _enter = value; }
}
public override double Exit
{
get { return _exit; }
set { _exit = value; }
}
public double Error
{
get { return _error; }
set { _error = value; }
}
public Dictionary<INeural, double> Weights
{
get { return _weights; }
set { _weights = value; }
}
public double CreateNeural()
{
_enter = _weights.Sum(w1 => w1.Key.Exit * w1.Value);
_exit = _exitFunction(_enter);
return _exit;
}
private double _exitFunction(double enter)
{
return 1/(1 + Math.Exp(-enter));
}
}
}