タスク:バイナリ表現によって数値の偶数または奇数を決定します。
実際のところ、これは、ニューラルネットワークが非常にうまく対処するオブジェクトを分類するタスクです(ニューラルネットワークは限られた範囲の問題を解決できます)。 始めましょう。
理論のビット
ニューロンは、ニューラルネットワークの不可欠な部分です。 ニューロンの構成には、乗算器(入力)、加算器、非線形コンバーターが含まれます。 入力はニューロン間で通信し、接続の強度、入力の重み係数を特徴付ける数で入力信号を乗算します。 加算器は、他のニューロンおよび外部入力信号からの入力接続に到達する信号の加算を実行します。 非線形コンバーターは、1つの引数(加算器の出力)の非線形関数を実装します。 この機能は、ニューロンの「活性化機能」または「伝達機能」と呼ばれます。 ニューロンは全体として、ベクトル引数のスカラー関数を実装します。
ネットワーク合成
ネットワーク合成は一般的に困難です。 この場合、この問題を解決するには、1つのニューロンのネットワークのみが必要です。 数値の対応するビットをバイナリ形式でニューロンの入力に適用します(簡単にするために、0〜255の範囲に制限します)。 つまり ニューロンには8つの入力と1つの出力があります。
次に、伝達関数と入力の重み係数のタイプを決定する必要があります。 重みは異なる場合があります:1または0、整数、または実数(さまざまな制限付き)。 実際の非負の重みを使用します。 伝達関数として、しきい値がニューロンの平均重みに等しいしきい値関数を使用します。 つまり 入力の合計に重みを掛けたものが平均重みよりも大きい場合、ニューロンは1を返します。それ以外の場合はゼロを返します。
次に、ニューロンの動作中に重みを変更する方法を決定します。 ニューロンの応答が正しかった場合、アクティブ化された入力の重みを大きくする必要があり、そうでない場合は小さくする必要があります。 ニューロンの初期重みに、対応する入力と初期重みとトレーニング係数の積を加算(減算)し、すべてをニューロンの重みの合計で除算します。 学習因子は学習速度に影響しますが、その増加はニューロンの誤動作につながる可能性があります。
実装
ニューロンを実装するC#のクラス。
public class Neuron { int [] input = new int [8]; // double [] weight = new double [8]; // double mx = 0; // double sum = 0; // int k = 1; // public Neuron() { for ( int i = 0; i < 8; i++) { weight[i] = 1; // // } } public byte Analyze( byte b) { for ( int i = 0; i < 8; i++) { input[i] = 0; } for ( int i = 0; i < 8; i++) // { if ((b / 2) != 0) { input[i] = b % 2; b = Convert .ToByte(b / 2); } else { input[i] = b % 2; break ; } } sum = 0; mx = weight.Sum() / 8; // for ( int i = 0; i < 8; i++) { if (weight[i] > 0) // sum += weight[i] * input[i]; } if (sum > mx) // return 1; else return 0; } public void Yes() // { double s = weight.Sum(); for ( int i = 0; i < 8; i++) { weight[i] += input[i] * (weight[i] / s) * k; } this .Normalize(); } public void No() // { double s = weight.Sum(); for ( int i = 0; i < 8; i++) { weight[i] -= input[i] * (weight[i] / s) * k; } this .Normalize(); } private void Normalize() // { // double min = weight.Min(); double max = weight.Max(); int pow = 0; double b = max / 10; while (b > 1) { b = b / 10; pow++; } for ( int i = 0; i < 8; i++) { weight[i] = weight[i] / Math .Pow(10, pow - 1); } } public void Reset() // { for ( int i = 0; i < 8; i++) { weight[i] = 1; } } // public string Bytes { get { string str = "" ; for ( int i = 0; i < 8; i++) { str += input[i].ToString(); } return str; } } public string Weights { get { string str = "" ; for ( int i = 0; i < 8; i++) { str += weight[i].ToString(); str += " " ; } return str; } } public string Mx { get { return mx.ToString(); } } public string Sum { get { return sum.ToString(); } } } * This source code was highlighted with Source Code Highlighter .
public class Neuron { int [] input = new int [8]; // double [] weight = new double [8]; // double mx = 0; // double sum = 0; // int k = 1; // public Neuron() { for ( int i = 0; i < 8; i++) { weight[i] = 1; // // } } public byte Analyze( byte b) { for ( int i = 0; i < 8; i++) { input[i] = 0; } for ( int i = 0; i < 8; i++) // { if ((b / 2) != 0) { input[i] = b % 2; b = Convert .ToByte(b / 2); } else { input[i] = b % 2; break ; } } sum = 0; mx = weight.Sum() / 8; // for ( int i = 0; i < 8; i++) { if (weight[i] > 0) // sum += weight[i] * input[i]; } if (sum > mx) // return 1; else return 0; } public void Yes() // { double s = weight.Sum(); for ( int i = 0; i < 8; i++) { weight[i] += input[i] * (weight[i] / s) * k; } this .Normalize(); } public void No() // { double s = weight.Sum(); for ( int i = 0; i < 8; i++) { weight[i] -= input[i] * (weight[i] / s) * k; } this .Normalize(); } private void Normalize() // { // double min = weight.Min(); double max = weight.Max(); int pow = 0; double b = max / 10; while (b > 1) { b = b / 10; pow++; } for ( int i = 0; i < 8; i++) { weight[i] = weight[i] / Math .Pow(10, pow - 1); } } public void Reset() // { for ( int i = 0; i < 8; i++) { weight[i] = 1; } } // public string Bytes { get { string str = "" ; for ( int i = 0; i < 8; i++) { str += input[i].ToString(); } return str; } } public string Weights { get { string str = "" ; for ( int i = 0; i < 8; i++) { str += weight[i].ToString(); str += " " ; } return str; } } public string Mx { get { return mx.ToString(); } } public string Sum { get { return sum.ToString(); } } } * This source code was highlighted with Source Code Highlighter .
public class Neuron { int [] input = new int [8]; // double [] weight = new double [8]; // double mx = 0; // double sum = 0; // int k = 1; // public Neuron() { for ( int i = 0; i < 8; i++) { weight[i] = 1; // // } } public byte Analyze( byte b) { for ( int i = 0; i < 8; i++) { input[i] = 0; } for ( int i = 0; i < 8; i++) // { if ((b / 2) != 0) { input[i] = b % 2; b = Convert .ToByte(b / 2); } else { input[i] = b % 2; break ; } } sum = 0; mx = weight.Sum() / 8; // for ( int i = 0; i < 8; i++) { if (weight[i] > 0) // sum += weight[i] * input[i]; } if (sum > mx) // return 1; else return 0; } public void Yes() // { double s = weight.Sum(); for ( int i = 0; i < 8; i++) { weight[i] += input[i] * (weight[i] / s) * k; } this .Normalize(); } public void No() // { double s = weight.Sum(); for ( int i = 0; i < 8; i++) { weight[i] -= input[i] * (weight[i] / s) * k; } this .Normalize(); } private void Normalize() // { // double min = weight.Min(); double max = weight.Max(); int pow = 0; double b = max / 10; while (b > 1) { b = b / 10; pow++; } for ( int i = 0; i < 8; i++) { weight[i] = weight[i] / Math .Pow(10, pow - 1); } } public void Reset() // { for ( int i = 0; i < 8; i++) { weight[i] = 1; } } // public string Bytes { get { string str = "" ; for ( int i = 0; i < 8; i++) { str += input[i].ToString(); } return str; } } public string Weights { get { string str = "" ; for ( int i = 0; i < 8; i++) { str += weight[i].ToString(); str += " " ; } return str; } } public string Mx { get { return mx.ToString(); } } public string Sum { get { return sum.ToString(); } } } * This source code was highlighted with Source Code Highlighter .
public class Neuron { int [] input = new int [8]; // double [] weight = new double [8]; // double mx = 0; // double sum = 0; // int k = 1; // public Neuron() { for ( int i = 0; i < 8; i++) { weight[i] = 1; // // } } public byte Analyze( byte b) { for ( int i = 0; i < 8; i++) { input[i] = 0; } for ( int i = 0; i < 8; i++) // { if ((b / 2) != 0) { input[i] = b % 2; b = Convert .ToByte(b / 2); } else { input[i] = b % 2; break ; } } sum = 0; mx = weight.Sum() / 8; // for ( int i = 0; i < 8; i++) { if (weight[i] > 0) // sum += weight[i] * input[i]; } if (sum > mx) // return 1; else return 0; } public void Yes() // { double s = weight.Sum(); for ( int i = 0; i < 8; i++) { weight[i] += input[i] * (weight[i] / s) * k; } this .Normalize(); } public void No() // { double s = weight.Sum(); for ( int i = 0; i < 8; i++) { weight[i] -= input[i] * (weight[i] / s) * k; } this .Normalize(); } private void Normalize() // { // double min = weight.Min(); double max = weight.Max(); int pow = 0; double b = max / 10; while (b > 1) { b = b / 10; pow++; } for ( int i = 0; i < 8; i++) { weight[i] = weight[i] / Math .Pow(10, pow - 1); } } public void Reset() // { for ( int i = 0; i < 8; i++) { weight[i] = 1; } } // public string Bytes { get { string str = "" ; for ( int i = 0; i < 8; i++) { str += input[i].ToString(); } return str; } } public string Weights { get { string str = "" ; for ( int i = 0; i < 8; i++) { str += weight[i].ToString(); str += " " ; } return str; } } public string Mx { get { return mx.ToString(); } } public string Sum { get { return sum.ToString(); } } } * This source code was highlighted with Source Code Highlighter .
public class Neuron { int [] input = new int [8]; // double [] weight = new double [8]; // double mx = 0; // double sum = 0; // int k = 1; // public Neuron() { for ( int i = 0; i < 8; i++) { weight[i] = 1; // // } } public byte Analyze( byte b) { for ( int i = 0; i < 8; i++) { input[i] = 0; } for ( int i = 0; i < 8; i++) // { if ((b / 2) != 0) { input[i] = b % 2; b = Convert .ToByte(b / 2); } else { input[i] = b % 2; break ; } } sum = 0; mx = weight.Sum() / 8; // for ( int i = 0; i < 8; i++) { if (weight[i] > 0) // sum += weight[i] * input[i]; } if (sum > mx) // return 1; else return 0; } public void Yes() // { double s = weight.Sum(); for ( int i = 0; i < 8; i++) { weight[i] += input[i] * (weight[i] / s) * k; } this .Normalize(); } public void No() // { double s = weight.Sum(); for ( int i = 0; i < 8; i++) { weight[i] -= input[i] * (weight[i] / s) * k; } this .Normalize(); } private void Normalize() // { // double min = weight.Min(); double max = weight.Max(); int pow = 0; double b = max / 10; while (b > 1) { b = b / 10; pow++; } for ( int i = 0; i < 8; i++) { weight[i] = weight[i] / Math .Pow(10, pow - 1); } } public void Reset() // { for ( int i = 0; i < 8; i++) { weight[i] = 1; } } // public string Bytes { get { string str = "" ; for ( int i = 0; i < 8; i++) { str += input[i].ToString(); } return str; } } public string Weights { get { string str = "" ; for ( int i = 0; i < 8; i++) { str += weight[i].ToString(); str += " " ; } return str; } } public string Mx { get { return mx.ToString(); } } public string Sum { get { return sum.ToString(); } } } * This source code was highlighted with Source Code Highlighter .
public class Neuron { int [] input = new int [8]; // double [] weight = new double [8]; // double mx = 0; // double sum = 0; // int k = 1; // public Neuron() { for ( int i = 0; i < 8; i++) { weight[i] = 1; // // } } public byte Analyze( byte b) { for ( int i = 0; i < 8; i++) { input[i] = 0; } for ( int i = 0; i < 8; i++) // { if ((b / 2) != 0) { input[i] = b % 2; b = Convert .ToByte(b / 2); } else { input[i] = b % 2; break ; } } sum = 0; mx = weight.Sum() / 8; // for ( int i = 0; i < 8; i++) { if (weight[i] > 0) // sum += weight[i] * input[i]; } if (sum > mx) // return 1; else return 0; } public void Yes() // { double s = weight.Sum(); for ( int i = 0; i < 8; i++) { weight[i] += input[i] * (weight[i] / s) * k; } this .Normalize(); } public void No() // { double s = weight.Sum(); for ( int i = 0; i < 8; i++) { weight[i] -= input[i] * (weight[i] / s) * k; } this .Normalize(); } private void Normalize() // { // double min = weight.Min(); double max = weight.Max(); int pow = 0; double b = max / 10; while (b > 1) { b = b / 10; pow++; } for ( int i = 0; i < 8; i++) { weight[i] = weight[i] / Math .Pow(10, pow - 1); } } public void Reset() // { for ( int i = 0; i < 8; i++) { weight[i] = 1; } } // public string Bytes { get { string str = "" ; for ( int i = 0; i < 8; i++) { str += input[i].ToString(); } return str; } } public string Weights { get { string str = "" ; for ( int i = 0; i < 8; i++) { str += weight[i].ToString(); str += " " ; } return str; } } public string Mx { get { return mx.ToString(); } } public string Sum { get { return sum.ToString(); } } } * This source code was highlighted with Source Code Highlighter .
public class Neuron { int [] input = new int [8]; // double [] weight = new double [8]; // double mx = 0; // double sum = 0; // int k = 1; // public Neuron() { for ( int i = 0; i < 8; i++) { weight[i] = 1; // // } } public byte Analyze( byte b) { for ( int i = 0; i < 8; i++) { input[i] = 0; } for ( int i = 0; i < 8; i++) // { if ((b / 2) != 0) { input[i] = b % 2; b = Convert .ToByte(b / 2); } else { input[i] = b % 2; break ; } } sum = 0; mx = weight.Sum() / 8; // for ( int i = 0; i < 8; i++) { if (weight[i] > 0) // sum += weight[i] * input[i]; } if (sum > mx) // return 1; else return 0; } public void Yes() // { double s = weight.Sum(); for ( int i = 0; i < 8; i++) { weight[i] += input[i] * (weight[i] / s) * k; } this .Normalize(); } public void No() // { double s = weight.Sum(); for ( int i = 0; i < 8; i++) { weight[i] -= input[i] * (weight[i] / s) * k; } this .Normalize(); } private void Normalize() // { // double min = weight.Min(); double max = weight.Max(); int pow = 0; double b = max / 10; while (b > 1) { b = b / 10; pow++; } for ( int i = 0; i < 8; i++) { weight[i] = weight[i] / Math .Pow(10, pow - 1); } } public void Reset() // { for ( int i = 0; i < 8; i++) { weight[i] = 1; } } // public string Bytes { get { string str = "" ; for ( int i = 0; i < 8; i++) { str += input[i].ToString(); } return str; } } public string Weights { get { string str = "" ; for ( int i = 0; i < 8; i++) { str += weight[i].ToString(); str += " " ; } return str; } } public string Mx { get { return mx.ToString(); } } public string Sum { get { return sum.ToString(); } } } * This source code was highlighted with Source Code Highlighter .
public class Neuron { int [] input = new int [8]; // double [] weight = new double [8]; // double mx = 0; // double sum = 0; // int k = 1; // public Neuron() { for ( int i = 0; i < 8; i++) { weight[i] = 1; // // } } public byte Analyze( byte b) { for ( int i = 0; i < 8; i++) { input[i] = 0; } for ( int i = 0; i < 8; i++) // { if ((b / 2) != 0) { input[i] = b % 2; b = Convert .ToByte(b / 2); } else { input[i] = b % 2; break ; } } sum = 0; mx = weight.Sum() / 8; // for ( int i = 0; i < 8; i++) { if (weight[i] > 0) // sum += weight[i] * input[i]; } if (sum > mx) // return 1; else return 0; } public void Yes() // { double s = weight.Sum(); for ( int i = 0; i < 8; i++) { weight[i] += input[i] * (weight[i] / s) * k; } this .Normalize(); } public void No() // { double s = weight.Sum(); for ( int i = 0; i < 8; i++) { weight[i] -= input[i] * (weight[i] / s) * k; } this .Normalize(); } private void Normalize() // { // double min = weight.Min(); double max = weight.Max(); int pow = 0; double b = max / 10; while (b > 1) { b = b / 10; pow++; } for ( int i = 0; i < 8; i++) { weight[i] = weight[i] / Math .Pow(10, pow - 1); } } public void Reset() // { for ( int i = 0; i < 8; i++) { weight[i] = 1; } } // public string Bytes { get { string str = "" ; for ( int i = 0; i < 8; i++) { str += input[i].ToString(); } return str; } } public string Weights { get { string str = "" ; for ( int i = 0; i < 8; i++) { str += weight[i].ToString(); str += " " ; } return str; } } public string Mx { get { return mx.ToString(); } } public string Sum { get { return sum.ToString(); } } } * This source code was highlighted with Source Code Highlighter .
public class Neuron { int [] input = new int [8]; // double [] weight = new double [8]; // double mx = 0; // double sum = 0; // int k = 1; // public Neuron() { for ( int i = 0; i < 8; i++) { weight[i] = 1; // // } } public byte Analyze( byte b) { for ( int i = 0; i < 8; i++) { input[i] = 0; } for ( int i = 0; i < 8; i++) // { if ((b / 2) != 0) { input[i] = b % 2; b = Convert .ToByte(b / 2); } else { input[i] = b % 2; break ; } } sum = 0; mx = weight.Sum() / 8; // for ( int i = 0; i < 8; i++) { if (weight[i] > 0) // sum += weight[i] * input[i]; } if (sum > mx) // return 1; else return 0; } public void Yes() // { double s = weight.Sum(); for ( int i = 0; i < 8; i++) { weight[i] += input[i] * (weight[i] / s) * k; } this .Normalize(); } public void No() // { double s = weight.Sum(); for ( int i = 0; i < 8; i++) { weight[i] -= input[i] * (weight[i] / s) * k; } this .Normalize(); } private void Normalize() // { // double min = weight.Min(); double max = weight.Max(); int pow = 0; double b = max / 10; while (b > 1) { b = b / 10; pow++; } for ( int i = 0; i < 8; i++) { weight[i] = weight[i] / Math .Pow(10, pow - 1); } } public void Reset() // { for ( int i = 0; i < 8; i++) { weight[i] = 1; } } // public string Bytes { get { string str = "" ; for ( int i = 0; i < 8; i++) { str += input[i].ToString(); } return str; } } public string Weights { get { string str = "" ; for ( int i = 0; i < 8; i++) { str += weight[i].ToString(); str += " " ; } return str; } } public string Mx { get { return mx.ToString(); } } public string Sum { get { return sum.ToString(); } } } * This source code was highlighted with Source Code Highlighter .
public class Neuron { int [] input = new int [8]; // double [] weight = new double [8]; // double mx = 0; // double sum = 0; // int k = 1; // public Neuron() { for ( int i = 0; i < 8; i++) { weight[i] = 1; // // } } public byte Analyze( byte b) { for ( int i = 0; i < 8; i++) { input[i] = 0; } for ( int i = 0; i < 8; i++) // { if ((b / 2) != 0) { input[i] = b % 2; b = Convert .ToByte(b / 2); } else { input[i] = b % 2; break ; } } sum = 0; mx = weight.Sum() / 8; // for ( int i = 0; i < 8; i++) { if (weight[i] > 0) // sum += weight[i] * input[i]; } if (sum > mx) // return 1; else return 0; } public void Yes() // { double s = weight.Sum(); for ( int i = 0; i < 8; i++) { weight[i] += input[i] * (weight[i] / s) * k; } this .Normalize(); } public void No() // { double s = weight.Sum(); for ( int i = 0; i < 8; i++) { weight[i] -= input[i] * (weight[i] / s) * k; } this .Normalize(); } private void Normalize() // { // double min = weight.Min(); double max = weight.Max(); int pow = 0; double b = max / 10; while (b > 1) { b = b / 10; pow++; } for ( int i = 0; i < 8; i++) { weight[i] = weight[i] / Math .Pow(10, pow - 1); } } public void Reset() // { for ( int i = 0; i < 8; i++) { weight[i] = 1; } } // public string Bytes { get { string str = "" ; for ( int i = 0; i < 8; i++) { str += input[i].ToString(); } return str; } } public string Weights { get { string str = "" ; for ( int i = 0; i < 8; i++) { str += weight[i].ToString(); str += " " ; } return str; } } public string Mx { get { return mx.ToString(); } } public string Sum { get { return sum.ToString(); } } } * This source code was highlighted with Source Code Highlighter .
public class Neuron { int [] input = new int [8]; // double [] weight = new double [8]; // double mx = 0; // double sum = 0; // int k = 1; // public Neuron() { for ( int i = 0; i < 8; i++) { weight[i] = 1; // // } } public byte Analyze( byte b) { for ( int i = 0; i < 8; i++) { input[i] = 0; } for ( int i = 0; i < 8; i++) // { if ((b / 2) != 0) { input[i] = b % 2; b = Convert .ToByte(b / 2); } else { input[i] = b % 2; break ; } } sum = 0; mx = weight.Sum() / 8; // for ( int i = 0; i < 8; i++) { if (weight[i] > 0) // sum += weight[i] * input[i]; } if (sum > mx) // return 1; else return 0; } public void Yes() // { double s = weight.Sum(); for ( int i = 0; i < 8; i++) { weight[i] += input[i] * (weight[i] / s) * k; } this .Normalize(); } public void No() // { double s = weight.Sum(); for ( int i = 0; i < 8; i++) { weight[i] -= input[i] * (weight[i] / s) * k; } this .Normalize(); } private void Normalize() // { // double min = weight.Min(); double max = weight.Max(); int pow = 0; double b = max / 10; while (b > 1) { b = b / 10; pow++; } for ( int i = 0; i < 8; i++) { weight[i] = weight[i] / Math .Pow(10, pow - 1); } } public void Reset() // { for ( int i = 0; i < 8; i++) { weight[i] = 1; } } // public string Bytes { get { string str = "" ; for ( int i = 0; i < 8; i++) { str += input[i].ToString(); } return str; } } public string Weights { get { string str = "" ; for ( int i = 0; i < 8; i++) { str += weight[i].ToString(); str += " " ; } return str; } } public string Mx { get { return mx.ToString(); } } public string Sum { get { return sum.ToString(); } } } * This source code was highlighted with Source Code Highlighter .
public class Neuron { int [] input = new int [8]; // double [] weight = new double [8]; // double mx = 0; // double sum = 0; // int k = 1; // public Neuron() { for ( int i = 0; i < 8; i++) { weight[i] = 1; // // } } public byte Analyze( byte b) { for ( int i = 0; i < 8; i++) { input[i] = 0; } for ( int i = 0; i < 8; i++) // { if ((b / 2) != 0) { input[i] = b % 2; b = Convert .ToByte(b / 2); } else { input[i] = b % 2; break ; } } sum = 0; mx = weight.Sum() / 8; // for ( int i = 0; i < 8; i++) { if (weight[i] > 0) // sum += weight[i] * input[i]; } if (sum > mx) // return 1; else return 0; } public void Yes() // { double s = weight.Sum(); for ( int i = 0; i < 8; i++) { weight[i] += input[i] * (weight[i] / s) * k; } this .Normalize(); } public void No() // { double s = weight.Sum(); for ( int i = 0; i < 8; i++) { weight[i] -= input[i] * (weight[i] / s) * k; } this .Normalize(); } private void Normalize() // { // double min = weight.Min(); double max = weight.Max(); int pow = 0; double b = max / 10; while (b > 1) { b = b / 10; pow++; } for ( int i = 0; i < 8; i++) { weight[i] = weight[i] / Math .Pow(10, pow - 1); } } public void Reset() // { for ( int i = 0; i < 8; i++) { weight[i] = 1; } } // public string Bytes { get { string str = "" ; for ( int i = 0; i < 8; i++) { str += input[i].ToString(); } return str; } } public string Weights { get { string str = "" ; for ( int i = 0; i < 8; i++) { str += weight[i].ToString(); str += " " ; } return str; } } public string Mx { get { return mx.ToString(); } } public string Sum { get { return sum.ToString(); } } } * This source code was highlighted with Source Code Highlighter .
public class Neuron { int [] input = new int [8]; // double [] weight = new double [8]; // double mx = 0; // double sum = 0; // int k = 1; // public Neuron() { for ( int i = 0; i < 8; i++) { weight[i] = 1; // // } } public byte Analyze( byte b) { for ( int i = 0; i < 8; i++) { input[i] = 0; } for ( int i = 0; i < 8; i++) // { if ((b / 2) != 0) { input[i] = b % 2; b = Convert .ToByte(b / 2); } else { input[i] = b % 2; break ; } } sum = 0; mx = weight.Sum() / 8; // for ( int i = 0; i < 8; i++) { if (weight[i] > 0) // sum += weight[i] * input[i]; } if (sum > mx) // return 1; else return 0; } public void Yes() // { double s = weight.Sum(); for ( int i = 0; i < 8; i++) { weight[i] += input[i] * (weight[i] / s) * k; } this .Normalize(); } public void No() // { double s = weight.Sum(); for ( int i = 0; i < 8; i++) { weight[i] -= input[i] * (weight[i] / s) * k; } this .Normalize(); } private void Normalize() // { // double min = weight.Min(); double max = weight.Max(); int pow = 0; double b = max / 10; while (b > 1) { b = b / 10; pow++; } for ( int i = 0; i < 8; i++) { weight[i] = weight[i] / Math .Pow(10, pow - 1); } } public void Reset() // { for ( int i = 0; i < 8; i++) { weight[i] = 1; } } // public string Bytes { get { string str = "" ; for ( int i = 0; i < 8; i++) { str += input[i].ToString(); } return str; } } public string Weights { get { string str = "" ; for ( int i = 0; i < 8; i++) { str += weight[i].ToString(); str += " " ; } return str; } } public string Mx { get { return mx.ToString(); } } public string Sum { get { return sum.ToString(); } } } * This source code was highlighted with Source Code Highlighter .
public class Neuron { int [] input = new int [8]; // double [] weight = new double [8]; // double mx = 0; // double sum = 0; // int k = 1; // public Neuron() { for ( int i = 0; i < 8; i++) { weight[i] = 1; // // } } public byte Analyze( byte b) { for ( int i = 0; i < 8; i++) { input[i] = 0; } for ( int i = 0; i < 8; i++) // { if ((b / 2) != 0) { input[i] = b % 2; b = Convert .ToByte(b / 2); } else { input[i] = b % 2; break ; } } sum = 0; mx = weight.Sum() / 8; // for ( int i = 0; i < 8; i++) { if (weight[i] > 0) // sum += weight[i] * input[i]; } if (sum > mx) // return 1; else return 0; } public void Yes() // { double s = weight.Sum(); for ( int i = 0; i < 8; i++) { weight[i] += input[i] * (weight[i] / s) * k; } this .Normalize(); } public void No() // { double s = weight.Sum(); for ( int i = 0; i < 8; i++) { weight[i] -= input[i] * (weight[i] / s) * k; } this .Normalize(); } private void Normalize() // { // double min = weight.Min(); double max = weight.Max(); int pow = 0; double b = max / 10; while (b > 1) { b = b / 10; pow++; } for ( int i = 0; i < 8; i++) { weight[i] = weight[i] / Math .Pow(10, pow - 1); } } public void Reset() // { for ( int i = 0; i < 8; i++) { weight[i] = 1; } } // public string Bytes { get { string str = "" ; for ( int i = 0; i < 8; i++) { str += input[i].ToString(); } return str; } } public string Weights { get { string str = "" ; for ( int i = 0; i < 8; i++) { str += weight[i].ToString(); str += " " ; } return str; } } public string Mx { get { return mx.ToString(); } } public string Sum { get { return sum.ToString(); } } } * This source code was highlighted with Source Code Highlighter .
public class Neuron { int [] input = new int [8]; // double [] weight = new double [8]; // double mx = 0; // double sum = 0; // int k = 1; // public Neuron() { for ( int i = 0; i < 8; i++) { weight[i] = 1; // // } } public byte Analyze( byte b) { for ( int i = 0; i < 8; i++) { input[i] = 0; } for ( int i = 0; i < 8; i++) // { if ((b / 2) != 0) { input[i] = b % 2; b = Convert .ToByte(b / 2); } else { input[i] = b % 2; break ; } } sum = 0; mx = weight.Sum() / 8; // for ( int i = 0; i < 8; i++) { if (weight[i] > 0) // sum += weight[i] * input[i]; } if (sum > mx) // return 1; else return 0; } public void Yes() // { double s = weight.Sum(); for ( int i = 0; i < 8; i++) { weight[i] += input[i] * (weight[i] / s) * k; } this .Normalize(); } public void No() // { double s = weight.Sum(); for ( int i = 0; i < 8; i++) { weight[i] -= input[i] * (weight[i] / s) * k; } this .Normalize(); } private void Normalize() // { // double min = weight.Min(); double max = weight.Max(); int pow = 0; double b = max / 10; while (b > 1) { b = b / 10; pow++; } for ( int i = 0; i < 8; i++) { weight[i] = weight[i] / Math .Pow(10, pow - 1); } } public void Reset() // { for ( int i = 0; i < 8; i++) { weight[i] = 1; } } // public string Bytes { get { string str = "" ; for ( int i = 0; i < 8; i++) { str += input[i].ToString(); } return str; } } public string Weights { get { string str = "" ; for ( int i = 0; i < 8; i++) { str += weight[i].ToString(); str += " " ; } return str; } } public string Mx { get { return mx.ToString(); } } public string Sum { get { return sum.ToString(); } } } * This source code was highlighted with Source Code Highlighter .
public class Neuron { int [] input = new int [8]; // double [] weight = new double [8]; // double mx = 0; // double sum = 0; // int k = 1; // public Neuron() { for ( int i = 0; i < 8; i++) { weight[i] = 1; // // } } public byte Analyze( byte b) { for ( int i = 0; i < 8; i++) { input[i] = 0; } for ( int i = 0; i < 8; i++) // { if ((b / 2) != 0) { input[i] = b % 2; b = Convert .ToByte(b / 2); } else { input[i] = b % 2; break ; } } sum = 0; mx = weight.Sum() / 8; // for ( int i = 0; i < 8; i++) { if (weight[i] > 0) // sum += weight[i] * input[i]; } if (sum > mx) // return 1; else return 0; } public void Yes() // { double s = weight.Sum(); for ( int i = 0; i < 8; i++) { weight[i] += input[i] * (weight[i] / s) * k; } this .Normalize(); } public void No() // { double s = weight.Sum(); for ( int i = 0; i < 8; i++) { weight[i] -= input[i] * (weight[i] / s) * k; } this .Normalize(); } private void Normalize() // { // double min = weight.Min(); double max = weight.Max(); int pow = 0; double b = max / 10; while (b > 1) { b = b / 10; pow++; } for ( int i = 0; i < 8; i++) { weight[i] = weight[i] / Math .Pow(10, pow - 1); } } public void Reset() // { for ( int i = 0; i < 8; i++) { weight[i] = 1; } } // public string Bytes { get { string str = "" ; for ( int i = 0; i < 8; i++) { str += input[i].ToString(); } return str; } } public string Weights { get { string str = "" ; for ( int i = 0; i < 8; i++) { str += weight[i].ToString(); str += " " ; } return str; } } public string Mx { get { return mx.ToString(); } } public string Sum { get { return sum.ToString(); } } } * This source code was highlighted with Source Code Highlighter .
public class Neuron { int [] input = new int [8]; // double [] weight = new double [8]; // double mx = 0; // double sum = 0; // int k = 1; // public Neuron() { for ( int i = 0; i < 8; i++) { weight[i] = 1; // // } } public byte Analyze( byte b) { for ( int i = 0; i < 8; i++) { input[i] = 0; } for ( int i = 0; i < 8; i++) // { if ((b / 2) != 0) { input[i] = b % 2; b = Convert .ToByte(b / 2); } else { input[i] = b % 2; break ; } } sum = 0; mx = weight.Sum() / 8; // for ( int i = 0; i < 8; i++) { if (weight[i] > 0) // sum += weight[i] * input[i]; } if (sum > mx) // return 1; else return 0; } public void Yes() // { double s = weight.Sum(); for ( int i = 0; i < 8; i++) { weight[i] += input[i] * (weight[i] / s) * k; } this .Normalize(); } public void No() // { double s = weight.Sum(); for ( int i = 0; i < 8; i++) { weight[i] -= input[i] * (weight[i] / s) * k; } this .Normalize(); } private void Normalize() // { // double min = weight.Min(); double max = weight.Max(); int pow = 0; double b = max / 10; while (b > 1) { b = b / 10; pow++; } for ( int i = 0; i < 8; i++) { weight[i] = weight[i] / Math .Pow(10, pow - 1); } } public void Reset() // { for ( int i = 0; i < 8; i++) { weight[i] = 1; } } // public string Bytes { get { string str = "" ; for ( int i = 0; i < 8; i++) { str += input[i].ToString(); } return str; } } public string Weights { get { string str = "" ; for ( int i = 0; i < 8; i++) { str += weight[i].ToString(); str += " " ; } return str; } } public string Mx { get { return mx.ToString(); } } public string Sum { get { return sum.ToString(); } } } * This source code was highlighted with Source Code Highlighter .
public class Neuron { int [] input = new int [8]; // double [] weight = new double [8]; // double mx = 0; // double sum = 0; // int k = 1; // public Neuron() { for ( int i = 0; i < 8; i++) { weight[i] = 1; // // } } public byte Analyze( byte b) { for ( int i = 0; i < 8; i++) { input[i] = 0; } for ( int i = 0; i < 8; i++) // { if ((b / 2) != 0) { input[i] = b % 2; b = Convert .ToByte(b / 2); } else { input[i] = b % 2; break ; } } sum = 0; mx = weight.Sum() / 8; // for ( int i = 0; i < 8; i++) { if (weight[i] > 0) // sum += weight[i] * input[i]; } if (sum > mx) // return 1; else return 0; } public void Yes() // { double s = weight.Sum(); for ( int i = 0; i < 8; i++) { weight[i] += input[i] * (weight[i] / s) * k; } this .Normalize(); } public void No() // { double s = weight.Sum(); for ( int i = 0; i < 8; i++) { weight[i] -= input[i] * (weight[i] / s) * k; } this .Normalize(); } private void Normalize() // { // double min = weight.Min(); double max = weight.Max(); int pow = 0; double b = max / 10; while (b > 1) { b = b / 10; pow++; } for ( int i = 0; i < 8; i++) { weight[i] = weight[i] / Math .Pow(10, pow - 1); } } public void Reset() // { for ( int i = 0; i < 8; i++) { weight[i] = 1; } } // public string Bytes { get { string str = "" ; for ( int i = 0; i < 8; i++) { str += input[i].ToString(); } return str; } } public string Weights { get { string str = "" ; for ( int i = 0; i < 8; i++) { str += weight[i].ToString(); str += " " ; } return str; } } public string Mx { get { return mx.ToString(); } } public string Sum { get { return sum.ToString(); } } } * This source code was highlighted with Source Code Highlighter .
public class Neuron { int [] input = new int [8]; // double [] weight = new double [8]; // double mx = 0; // double sum = 0; // int k = 1; // public Neuron() { for ( int i = 0; i < 8; i++) { weight[i] = 1; // // } } public byte Analyze( byte b) { for ( int i = 0; i < 8; i++) { input[i] = 0; } for ( int i = 0; i < 8; i++) // { if ((b / 2) != 0) { input[i] = b % 2; b = Convert .ToByte(b / 2); } else { input[i] = b % 2; break ; } } sum = 0; mx = weight.Sum() / 8; // for ( int i = 0; i < 8; i++) { if (weight[i] > 0) // sum += weight[i] * input[i]; } if (sum > mx) // return 1; else return 0; } public void Yes() // { double s = weight.Sum(); for ( int i = 0; i < 8; i++) { weight[i] += input[i] * (weight[i] / s) * k; } this .Normalize(); } public void No() // { double s = weight.Sum(); for ( int i = 0; i < 8; i++) { weight[i] -= input[i] * (weight[i] / s) * k; } this .Normalize(); } private void Normalize() // { // double min = weight.Min(); double max = weight.Max(); int pow = 0; double b = max / 10; while (b > 1) { b = b / 10; pow++; } for ( int i = 0; i < 8; i++) { weight[i] = weight[i] / Math .Pow(10, pow - 1); } } public void Reset() // { for ( int i = 0; i < 8; i++) { weight[i] = 1; } } // public string Bytes { get { string str = "" ; for ( int i = 0; i < 8; i++) { str += input[i].ToString(); } return str; } } public string Weights { get { string str = "" ; for ( int i = 0; i < 8; i++) { str += weight[i].ToString(); str += " " ; } return str; } } public string Mx { get { return mx.ToString(); } } public string Sum { get { return sum.ToString(); } } } * This source code was highlighted with Source Code Highlighter .
public class Neuron { int [] input = new int [8]; // double [] weight = new double [8]; // double mx = 0; // double sum = 0; // int k = 1; // public Neuron() { for ( int i = 0; i < 8; i++) { weight[i] = 1; // // } } public byte Analyze( byte b) { for ( int i = 0; i < 8; i++) { input[i] = 0; } for ( int i = 0; i < 8; i++) // { if ((b / 2) != 0) { input[i] = b % 2; b = Convert .ToByte(b / 2); } else { input[i] = b % 2; break ; } } sum = 0; mx = weight.Sum() / 8; // for ( int i = 0; i < 8; i++) { if (weight[i] > 0) // sum += weight[i] * input[i]; } if (sum > mx) // return 1; else return 0; } public void Yes() // { double s = weight.Sum(); for ( int i = 0; i < 8; i++) { weight[i] += input[i] * (weight[i] / s) * k; } this .Normalize(); } public void No() // { double s = weight.Sum(); for ( int i = 0; i < 8; i++) { weight[i] -= input[i] * (weight[i] / s) * k; } this .Normalize(); } private void Normalize() // { // double min = weight.Min(); double max = weight.Max(); int pow = 0; double b = max / 10; while (b > 1) { b = b / 10; pow++; } for ( int i = 0; i < 8; i++) { weight[i] = weight[i] / Math .Pow(10, pow - 1); } } public void Reset() // { for ( int i = 0; i < 8; i++) { weight[i] = 1; } } // public string Bytes { get { string str = "" ; for ( int i = 0; i < 8; i++) { str += input[i].ToString(); } return str; } } public string Weights { get { string str = "" ; for ( int i = 0; i < 8; i++) { str += weight[i].ToString(); str += " " ; } return str; } } public string Mx { get { return mx.ToString(); } } public string Sum { get { return sum.ToString(); } } } * This source code was highlighted with Source Code Highlighter .
public class Neuron { int [] input = new int [8]; // double [] weight = new double [8]; // double mx = 0; // double sum = 0; // int k = 1; // public Neuron() { for ( int i = 0; i < 8; i++) { weight[i] = 1; // // } } public byte Analyze( byte b) { for ( int i = 0; i < 8; i++) { input[i] = 0; } for ( int i = 0; i < 8; i++) // { if ((b / 2) != 0) { input[i] = b % 2; b = Convert .ToByte(b / 2); } else { input[i] = b % 2; break ; } } sum = 0; mx = weight.Sum() / 8; // for ( int i = 0; i < 8; i++) { if (weight[i] > 0) // sum += weight[i] * input[i]; } if (sum > mx) // return 1; else return 0; } public void Yes() // { double s = weight.Sum(); for ( int i = 0; i < 8; i++) { weight[i] += input[i] * (weight[i] / s) * k; } this .Normalize(); } public void No() // { double s = weight.Sum(); for ( int i = 0; i < 8; i++) { weight[i] -= input[i] * (weight[i] / s) * k; } this .Normalize(); } private void Normalize() // { // double min = weight.Min(); double max = weight.Max(); int pow = 0; double b = max / 10; while (b > 1) { b = b / 10; pow++; } for ( int i = 0; i < 8; i++) { weight[i] = weight[i] / Math .Pow(10, pow - 1); } } public void Reset() // { for ( int i = 0; i < 8; i++) { weight[i] = 1; } } // public string Bytes { get { string str = "" ; for ( int i = 0; i < 8; i++) { str += input[i].ToString(); } return str; } } public string Weights { get { string str = "" ; for ( int i = 0; i < 8; i++) { str += weight[i].ToString(); str += " " ; } return str; } } public string Mx { get { return mx.ToString(); } } public string Sum { get { return sum.ToString(); } } } * This source code was highlighted with Source Code Highlighter .
public class Neuron { int [] input = new int [8]; // double [] weight = new double [8]; // double mx = 0; // double sum = 0; // int k = 1; // public Neuron() { for ( int i = 0; i < 8; i++) { weight[i] = 1; // // } } public byte Analyze( byte b) { for ( int i = 0; i < 8; i++) { input[i] = 0; } for ( int i = 0; i < 8; i++) // { if ((b / 2) != 0) { input[i] = b % 2; b = Convert .ToByte(b / 2); } else { input[i] = b % 2; break ; } } sum = 0; mx = weight.Sum() / 8; // for ( int i = 0; i < 8; i++) { if (weight[i] > 0) // sum += weight[i] * input[i]; } if (sum > mx) // return 1; else return 0; } public void Yes() // { double s = weight.Sum(); for ( int i = 0; i < 8; i++) { weight[i] += input[i] * (weight[i] / s) * k; } this .Normalize(); } public void No() // { double s = weight.Sum(); for ( int i = 0; i < 8; i++) { weight[i] -= input[i] * (weight[i] / s) * k; } this .Normalize(); } private void Normalize() // { // double min = weight.Min(); double max = weight.Max(); int pow = 0; double b = max / 10; while (b > 1) { b = b / 10; pow++; } for ( int i = 0; i < 8; i++) { weight[i] = weight[i] / Math .Pow(10, pow - 1); } } public void Reset() // { for ( int i = 0; i < 8; i++) { weight[i] = 1; } } // public string Bytes { get { string str = "" ; for ( int i = 0; i < 8; i++) { str += input[i].ToString(); } return str; } } public string Weights { get { string str = "" ; for ( int i = 0; i < 8; i++) { str += weight[i].ToString(); str += " " ; } return str; } } public string Mx { get { return mx.ToString(); } } public string Sum { get { return sum.ToString(); } } } * This source code was highlighted with Source Code Highlighter .
public class Neuron { int [] input = new int [8]; // double [] weight = new double [8]; // double mx = 0; // double sum = 0; // int k = 1; // public Neuron() { for ( int i = 0; i < 8; i++) { weight[i] = 1; // // } } public byte Analyze( byte b) { for ( int i = 0; i < 8; i++) { input[i] = 0; } for ( int i = 0; i < 8; i++) // { if ((b / 2) != 0) { input[i] = b % 2; b = Convert .ToByte(b / 2); } else { input[i] = b % 2; break ; } } sum = 0; mx = weight.Sum() / 8; // for ( int i = 0; i < 8; i++) { if (weight[i] > 0) // sum += weight[i] * input[i]; } if (sum > mx) // return 1; else return 0; } public void Yes() // { double s = weight.Sum(); for ( int i = 0; i < 8; i++) { weight[i] += input[i] * (weight[i] / s) * k; } this .Normalize(); } public void No() // { double s = weight.Sum(); for ( int i = 0; i < 8; i++) { weight[i] -= input[i] * (weight[i] / s) * k; } this .Normalize(); } private void Normalize() // { // double min = weight.Min(); double max = weight.Max(); int pow = 0; double b = max / 10; while (b > 1) { b = b / 10; pow++; } for ( int i = 0; i < 8; i++) { weight[i] = weight[i] / Math .Pow(10, pow - 1); } } public void Reset() // { for ( int i = 0; i < 8; i++) { weight[i] = 1; } } // public string Bytes { get { string str = "" ; for ( int i = 0; i < 8; i++) { str += input[i].ToString(); } return str; } } public string Weights { get { string str = "" ; for ( int i = 0; i < 8; i++) { str += weight[i].ToString(); str += " " ; } return str; } } public string Mx { get { return mx.ToString(); } } public string Sum { get { return sum.ToString(); } } } * This source code was highlighted with Source Code Highlighter .
public class Neuron { int [] input = new int [8]; // double [] weight = new double [8]; // double mx = 0; // double sum = 0; // int k = 1; // public Neuron() { for ( int i = 0; i < 8; i++) { weight[i] = 1; // // } } public byte Analyze( byte b) { for ( int i = 0; i < 8; i++) { input[i] = 0; } for ( int i = 0; i < 8; i++) // { if ((b / 2) != 0) { input[i] = b % 2; b = Convert .ToByte(b / 2); } else { input[i] = b % 2; break ; } } sum = 0; mx = weight.Sum() / 8; // for ( int i = 0; i < 8; i++) { if (weight[i] > 0) // sum += weight[i] * input[i]; } if (sum > mx) // return 1; else return 0; } public void Yes() // { double s = weight.Sum(); for ( int i = 0; i < 8; i++) { weight[i] += input[i] * (weight[i] / s) * k; } this .Normalize(); } public void No() // { double s = weight.Sum(); for ( int i = 0; i < 8; i++) { weight[i] -= input[i] * (weight[i] / s) * k; } this .Normalize(); } private void Normalize() // { // double min = weight.Min(); double max = weight.Max(); int pow = 0; double b = max / 10; while (b > 1) { b = b / 10; pow++; } for ( int i = 0; i < 8; i++) { weight[i] = weight[i] / Math .Pow(10, pow - 1); } } public void Reset() // { for ( int i = 0; i < 8; i++) { weight[i] = 1; } } // public string Bytes { get { string str = "" ; for ( int i = 0; i < 8; i++) { str += input[i].ToString(); } return str; } } public string Weights { get { string str = "" ; for ( int i = 0; i < 8; i++) { str += weight[i].ToString(); str += " " ; } return str; } } public string Mx { get { return mx.ToString(); } } public string Sum { get { return sum.ToString(); } } } * This source code was highlighted with Source Code Highlighter .
public class Neuron { int [] input = new int [8]; // double [] weight = new double [8]; // double mx = 0; // double sum = 0; // int k = 1; // public Neuron() { for ( int i = 0; i < 8; i++) { weight[i] = 1; // // } } public byte Analyze( byte b) { for ( int i = 0; i < 8; i++) { input[i] = 0; } for ( int i = 0; i < 8; i++) // { if ((b / 2) != 0) { input[i] = b % 2; b = Convert .ToByte(b / 2); } else { input[i] = b % 2; break ; } } sum = 0; mx = weight.Sum() / 8; // for ( int i = 0; i < 8; i++) { if (weight[i] > 0) // sum += weight[i] * input[i]; } if (sum > mx) // return 1; else return 0; } public void Yes() // { double s = weight.Sum(); for ( int i = 0; i < 8; i++) { weight[i] += input[i] * (weight[i] / s) * k; } this .Normalize(); } public void No() // { double s = weight.Sum(); for ( int i = 0; i < 8; i++) { weight[i] -= input[i] * (weight[i] / s) * k; } this .Normalize(); } private void Normalize() // { // double min = weight.Min(); double max = weight.Max(); int pow = 0; double b = max / 10; while (b > 1) { b = b / 10; pow++; } for ( int i = 0; i < 8; i++) { weight[i] = weight[i] / Math .Pow(10, pow - 1); } } public void Reset() // { for ( int i = 0; i < 8; i++) { weight[i] = 1; } } // public string Bytes { get { string str = "" ; for ( int i = 0; i < 8; i++) { str += input[i].ToString(); } return str; } } public string Weights { get { string str = "" ; for ( int i = 0; i < 8; i++) { str += weight[i].ToString(); str += " " ; } return str; } } public string Mx { get { return mx.ToString(); } } public string Sum { get { return sum.ToString(); } } } * This source code was highlighted with Source Code Highlighter .
public class Neuron { int [] input = new int [8]; // double [] weight = new double [8]; // double mx = 0; // double sum = 0; // int k = 1; // public Neuron() { for ( int i = 0; i < 8; i++) { weight[i] = 1; // // } } public byte Analyze( byte b) { for ( int i = 0; i < 8; i++) { input[i] = 0; } for ( int i = 0; i < 8; i++) // { if ((b / 2) != 0) { input[i] = b % 2; b = Convert .ToByte(b / 2); } else { input[i] = b % 2; break ; } } sum = 0; mx = weight.Sum() / 8; // for ( int i = 0; i < 8; i++) { if (weight[i] > 0) // sum += weight[i] * input[i]; } if (sum > mx) // return 1; else return 0; } public void Yes() // { double s = weight.Sum(); for ( int i = 0; i < 8; i++) { weight[i] += input[i] * (weight[i] / s) * k; } this .Normalize(); } public void No() // { double s = weight.Sum(); for ( int i = 0; i < 8; i++) { weight[i] -= input[i] * (weight[i] / s) * k; } this .Normalize(); } private void Normalize() // { // double min = weight.Min(); double max = weight.Max(); int pow = 0; double b = max / 10; while (b > 1) { b = b / 10; pow++; } for ( int i = 0; i < 8; i++) { weight[i] = weight[i] / Math .Pow(10, pow - 1); } } public void Reset() // { for ( int i = 0; i < 8; i++) { weight[i] = 1; } } // public string Bytes { get { string str = "" ; for ( int i = 0; i < 8; i++) { str += input[i].ToString(); } return str; } } public string Weights { get { string str = "" ; for ( int i = 0; i < 8; i++) { str += weight[i].ToString(); str += " " ; } return str; } } public string Mx { get { return mx.ToString(); } } public string Sum { get { return sum.ToString(); } } } * This source code was highlighted with Source Code Highlighter .
public class Neuron { int [] input = new int [8]; // double [] weight = new double [8]; // double mx = 0; // double sum = 0; // int k = 1; // public Neuron() { for ( int i = 0; i < 8; i++) { weight[i] = 1; // // } } public byte Analyze( byte b) { for ( int i = 0; i < 8; i++) { input[i] = 0; } for ( int i = 0; i < 8; i++) // { if ((b / 2) != 0) { input[i] = b % 2; b = Convert .ToByte(b / 2); } else { input[i] = b % 2; break ; } } sum = 0; mx = weight.Sum() / 8; // for ( int i = 0; i < 8; i++) { if (weight[i] > 0) // sum += weight[i] * input[i]; } if (sum > mx) // return 1; else return 0; } public void Yes() // { double s = weight.Sum(); for ( int i = 0; i < 8; i++) { weight[i] += input[i] * (weight[i] / s) * k; } this .Normalize(); } public void No() // { double s = weight.Sum(); for ( int i = 0; i < 8; i++) { weight[i] -= input[i] * (weight[i] / s) * k; } this .Normalize(); } private void Normalize() // { // double min = weight.Min(); double max = weight.Max(); int pow = 0; double b = max / 10; while (b > 1) { b = b / 10; pow++; } for ( int i = 0; i < 8; i++) { weight[i] = weight[i] / Math .Pow(10, pow - 1); } } public void Reset() // { for ( int i = 0; i < 8; i++) { weight[i] = 1; } } // public string Bytes { get { string str = "" ; for ( int i = 0; i < 8; i++) { str += input[i].ToString(); } return str; } } public string Weights { get { string str = "" ; for ( int i = 0; i < 8; i++) { str += weight[i].ToString(); str += " " ; } return str; } } public string Mx { get { return mx.ToString(); } } public string Sum { get { return sum.ToString(); } } } * This source code was highlighted with Source Code Highlighter .
public class Neuron { int [] input = new int [8]; // double [] weight = new double [8]; // double mx = 0; // double sum = 0; // int k = 1; // public Neuron() { for ( int i = 0; i < 8; i++) { weight[i] = 1; // // } } public byte Analyze( byte b) { for ( int i = 0; i < 8; i++) { input[i] = 0; } for ( int i = 0; i < 8; i++) // { if ((b / 2) != 0) { input[i] = b % 2; b = Convert .ToByte(b / 2); } else { input[i] = b % 2; break ; } } sum = 0; mx = weight.Sum() / 8; // for ( int i = 0; i < 8; i++) { if (weight[i] > 0) // sum += weight[i] * input[i]; } if (sum > mx) // return 1; else return 0; } public void Yes() // { double s = weight.Sum(); for ( int i = 0; i < 8; i++) { weight[i] += input[i] * (weight[i] / s) * k; } this .Normalize(); } public void No() // { double s = weight.Sum(); for ( int i = 0; i < 8; i++) { weight[i] -= input[i] * (weight[i] / s) * k; } this .Normalize(); } private void Normalize() // { // double min = weight.Min(); double max = weight.Max(); int pow = 0; double b = max / 10; while (b > 1) { b = b / 10; pow++; } for ( int i = 0; i < 8; i++) { weight[i] = weight[i] / Math .Pow(10, pow - 1); } } public void Reset() // { for ( int i = 0; i < 8; i++) { weight[i] = 1; } } // public string Bytes { get { string str = "" ; for ( int i = 0; i < 8; i++) { str += input[i].ToString(); } return str; } } public string Weights { get { string str = "" ; for ( int i = 0; i < 8; i++) { str += weight[i].ToString(); str += " " ; } return str; } } public string Mx { get { return mx.ToString(); } } public string Sum { get { return sum.ToString(); } } } * This source code was highlighted with Source Code Highlighter .
public class Neuron { int [] input = new int [8]; // double [] weight = new double [8]; // double mx = 0; // double sum = 0; // int k = 1; // public Neuron() { for ( int i = 0; i < 8; i++) { weight[i] = 1; // // } } public byte Analyze( byte b) { for ( int i = 0; i < 8; i++) { input[i] = 0; } for ( int i = 0; i < 8; i++) // { if ((b / 2) != 0) { input[i] = b % 2; b = Convert .ToByte(b / 2); } else { input[i] = b % 2; break ; } } sum = 0; mx = weight.Sum() / 8; // for ( int i = 0; i < 8; i++) { if (weight[i] > 0) // sum += weight[i] * input[i]; } if (sum > mx) // return 1; else return 0; } public void Yes() // { double s = weight.Sum(); for ( int i = 0; i < 8; i++) { weight[i] += input[i] * (weight[i] / s) * k; } this .Normalize(); } public void No() // { double s = weight.Sum(); for ( int i = 0; i < 8; i++) { weight[i] -= input[i] * (weight[i] / s) * k; } this .Normalize(); } private void Normalize() // { // double min = weight.Min(); double max = weight.Max(); int pow = 0; double b = max / 10; while (b > 1) { b = b / 10; pow++; } for ( int i = 0; i < 8; i++) { weight[i] = weight[i] / Math .Pow(10, pow - 1); } } public void Reset() // { for ( int i = 0; i < 8; i++) { weight[i] = 1; } } // public string Bytes { get { string str = "" ; for ( int i = 0; i < 8; i++) { str += input[i].ToString(); } return str; } } public string Weights { get { string str = "" ; for ( int i = 0; i < 8; i++) { str += weight[i].ToString(); str += " " ; } return str; } } public string Mx { get { return mx.ToString(); } } public string Sum { get { return sum.ToString(); } } } * This source code was highlighted with Source Code Highlighter .
public class Neuron { int [] input = new int [8]; // double [] weight = new double [8]; // double mx = 0; // double sum = 0; // int k = 1; // public Neuron() { for ( int i = 0; i < 8; i++) { weight[i] = 1; // // } } public byte Analyze( byte b) { for ( int i = 0; i < 8; i++) { input[i] = 0; } for ( int i = 0; i < 8; i++) // { if ((b / 2) != 0) { input[i] = b % 2; b = Convert .ToByte(b / 2); } else { input[i] = b % 2; break ; } } sum = 0; mx = weight.Sum() / 8; // for ( int i = 0; i < 8; i++) { if (weight[i] > 0) // sum += weight[i] * input[i]; } if (sum > mx) // return 1; else return 0; } public void Yes() // { double s = weight.Sum(); for ( int i = 0; i < 8; i++) { weight[i] += input[i] * (weight[i] / s) * k; } this .Normalize(); } public void No() // { double s = weight.Sum(); for ( int i = 0; i < 8; i++) { weight[i] -= input[i] * (weight[i] / s) * k; } this .Normalize(); } private void Normalize() // { // double min = weight.Min(); double max = weight.Max(); int pow = 0; double b = max / 10; while (b > 1) { b = b / 10; pow++; } for ( int i = 0; i < 8; i++) { weight[i] = weight[i] / Math .Pow(10, pow - 1); } } public void Reset() // { for ( int i = 0; i < 8; i++) { weight[i] = 1; } } // public string Bytes { get { string str = "" ; for ( int i = 0; i < 8; i++) { str += input[i].ToString(); } return str; } } public string Weights { get { string str = "" ; for ( int i = 0; i < 8; i++) { str += weight[i].ToString(); str += " " ; } return str; } } public string Mx { get { return mx.ToString(); } } public string Sum { get { return sum.ToString(); } } } * This source code was highlighted with Source Code Highlighter .
public class Neuron { int [] input = new int [8]; // double [] weight = new double [8]; // double mx = 0; // double sum = 0; // int k = 1; // public Neuron() { for ( int i = 0; i < 8; i++) { weight[i] = 1; // // } } public byte Analyze( byte b) { for ( int i = 0; i < 8; i++) { input[i] = 0; } for ( int i = 0; i < 8; i++) // { if ((b / 2) != 0) { input[i] = b % 2; b = Convert .ToByte(b / 2); } else { input[i] = b % 2; break ; } } sum = 0; mx = weight.Sum() / 8; // for ( int i = 0; i < 8; i++) { if (weight[i] > 0) // sum += weight[i] * input[i]; } if (sum > mx) // return 1; else return 0; } public void Yes() // { double s = weight.Sum(); for ( int i = 0; i < 8; i++) { weight[i] += input[i] * (weight[i] / s) * k; } this .Normalize(); } public void No() // { double s = weight.Sum(); for ( int i = 0; i < 8; i++) { weight[i] -= input[i] * (weight[i] / s) * k; } this .Normalize(); } private void Normalize() // { // double min = weight.Min(); double max = weight.Max(); int pow = 0; double b = max / 10; while (b > 1) { b = b / 10; pow++; } for ( int i = 0; i < 8; i++) { weight[i] = weight[i] / Math .Pow(10, pow - 1); } } public void Reset() // { for ( int i = 0; i < 8; i++) { weight[i] = 1; } } // public string Bytes { get { string str = "" ; for ( int i = 0; i < 8; i++) { str += input[i].ToString(); } return str; } } public string Weights { get { string str = "" ; for ( int i = 0; i < 8; i++) { str += weight[i].ToString(); str += " " ; } return str; } } public string Mx { get { return mx.ToString(); } } public string Sum { get { return sum.ToString(); } } } * This source code was highlighted with Source Code Highlighter .
public class Neuron { int [] input = new int [8]; // double [] weight = new double [8]; // double mx = 0; // double sum = 0; // int k = 1; // public Neuron() { for ( int i = 0; i < 8; i++) { weight[i] = 1; // // } } public byte Analyze( byte b) { for ( int i = 0; i < 8; i++) { input[i] = 0; } for ( int i = 0; i < 8; i++) // { if ((b / 2) != 0) { input[i] = b % 2; b = Convert .ToByte(b / 2); } else { input[i] = b % 2; break ; } } sum = 0; mx = weight.Sum() / 8; // for ( int i = 0; i < 8; i++) { if (weight[i] > 0) // sum += weight[i] * input[i]; } if (sum > mx) // return 1; else return 0; } public void Yes() // { double s = weight.Sum(); for ( int i = 0; i < 8; i++) { weight[i] += input[i] * (weight[i] / s) * k; } this .Normalize(); } public void No() // { double s = weight.Sum(); for ( int i = 0; i < 8; i++) { weight[i] -= input[i] * (weight[i] / s) * k; } this .Normalize(); } private void Normalize() // { // double min = weight.Min(); double max = weight.Max(); int pow = 0; double b = max / 10; while (b > 1) { b = b / 10; pow++; } for ( int i = 0; i < 8; i++) { weight[i] = weight[i] / Math .Pow(10, pow - 1); } } public void Reset() // { for ( int i = 0; i < 8; i++) { weight[i] = 1; } } // public string Bytes { get { string str = "" ; for ( int i = 0; i < 8; i++) { str += input[i].ToString(); } return str; } } public string Weights { get { string str = "" ; for ( int i = 0; i < 8; i++) { str += weight[i].ToString(); str += " " ; } return str; } } public string Mx { get { return mx.ToString(); } } public string Sum { get { return sum.ToString(); } } } * This source code was highlighted with Source Code Highlighter .
public class Neuron { int [] input = new int [8]; // double [] weight = new double [8]; // double mx = 0; // double sum = 0; // int k = 1; // public Neuron() { for ( int i = 0; i < 8; i++) { weight[i] = 1; // // } } public byte Analyze( byte b) { for ( int i = 0; i < 8; i++) { input[i] = 0; } for ( int i = 0; i < 8; i++) // { if ((b / 2) != 0) { input[i] = b % 2; b = Convert .ToByte(b / 2); } else { input[i] = b % 2; break ; } } sum = 0; mx = weight.Sum() / 8; // for ( int i = 0; i < 8; i++) { if (weight[i] > 0) // sum += weight[i] * input[i]; } if (sum > mx) // return 1; else return 0; } public void Yes() // { double s = weight.Sum(); for ( int i = 0; i < 8; i++) { weight[i] += input[i] * (weight[i] / s) * k; } this .Normalize(); } public void No() // { double s = weight.Sum(); for ( int i = 0; i < 8; i++) { weight[i] -= input[i] * (weight[i] / s) * k; } this .Normalize(); } private void Normalize() // { // double min = weight.Min(); double max = weight.Max(); int pow = 0; double b = max / 10; while (b > 1) { b = b / 10; pow++; } for ( int i = 0; i < 8; i++) { weight[i] = weight[i] / Math .Pow(10, pow - 1); } } public void Reset() // { for ( int i = 0; i < 8; i++) { weight[i] = 1; } } // public string Bytes { get { string str = "" ; for ( int i = 0; i < 8; i++) { str += input[i].ToString(); } return str; } } public string Weights { get { string str = "" ; for ( int i = 0; i < 8; i++) { str += weight[i].ToString(); str += " " ; } return str; } } public string Mx { get { return mx.ToString(); } } public string Sum { get { return sum.ToString(); } } } * This source code was highlighted with Source Code Highlighter .
public class Neuron { int [] input = new int [8]; // double [] weight = new double [8]; // double mx = 0; // double sum = 0; // int k = 1; // public Neuron() { for ( int i = 0; i < 8; i++) { weight[i] = 1; // // } } public byte Analyze( byte b) { for ( int i = 0; i < 8; i++) { input[i] = 0; } for ( int i = 0; i < 8; i++) // { if ((b / 2) != 0) { input[i] = b % 2; b = Convert .ToByte(b / 2); } else { input[i] = b % 2; break ; } } sum = 0; mx = weight.Sum() / 8; // for ( int i = 0; i < 8; i++) { if (weight[i] > 0) // sum += weight[i] * input[i]; } if (sum > mx) // return 1; else return 0; } public void Yes() // { double s = weight.Sum(); for ( int i = 0; i < 8; i++) { weight[i] += input[i] * (weight[i] / s) * k; } this .Normalize(); } public void No() // { double s = weight.Sum(); for ( int i = 0; i < 8; i++) { weight[i] -= input[i] * (weight[i] / s) * k; } this .Normalize(); } private void Normalize() // { // double min = weight.Min(); double max = weight.Max(); int pow = 0; double b = max / 10; while (b > 1) { b = b / 10; pow++; } for ( int i = 0; i < 8; i++) { weight[i] = weight[i] / Math .Pow(10, pow - 1); } } public void Reset() // { for ( int i = 0; i < 8; i++) { weight[i] = 1; } } // public string Bytes { get { string str = "" ; for ( int i = 0; i < 8; i++) { str += input[i].ToString(); } return str; } } public string Weights { get { string str = "" ; for ( int i = 0; i < 8; i++) { str += weight[i].ToString(); str += " " ; } return str; } } public string Mx { get { return mx.ToString(); } } public string Sum { get { return sum.ToString(); } } } * This source code was highlighted with Source Code Highlighter .
public class Neuron { int [] input = new int [8]; // double [] weight = new double [8]; // double mx = 0; // double sum = 0; // int k = 1; // public Neuron() { for ( int i = 0; i < 8; i++) { weight[i] = 1; // // } } public byte Analyze( byte b) { for ( int i = 0; i < 8; i++) { input[i] = 0; } for ( int i = 0; i < 8; i++) // { if ((b / 2) != 0) { input[i] = b % 2; b = Convert .ToByte(b / 2); } else { input[i] = b % 2; break ; } } sum = 0; mx = weight.Sum() / 8; // for ( int i = 0; i < 8; i++) { if (weight[i] > 0) // sum += weight[i] * input[i]; } if (sum > mx) // return 1; else return 0; } public void Yes() // { double s = weight.Sum(); for ( int i = 0; i < 8; i++) { weight[i] += input[i] * (weight[i] / s) * k; } this .Normalize(); } public void No() // { double s = weight.Sum(); for ( int i = 0; i < 8; i++) { weight[i] -= input[i] * (weight[i] / s) * k; } this .Normalize(); } private void Normalize() // { // double min = weight.Min(); double max = weight.Max(); int pow = 0; double b = max / 10; while (b > 1) { b = b / 10; pow++; } for ( int i = 0; i < 8; i++) { weight[i] = weight[i] / Math .Pow(10, pow - 1); } } public void Reset() // { for ( int i = 0; i < 8; i++) { weight[i] = 1; } } // public string Bytes { get { string str = "" ; for ( int i = 0; i < 8; i++) { str += input[i].ToString(); } return str; } } public string Weights { get { string str = "" ; for ( int i = 0; i < 8; i++) { str += weight[i].ToString(); str += " " ; } return str; } } public string Mx { get { return mx.ToString(); } } public string Sum { get { return sum.ToString(); } } } * This source code was highlighted with Source Code Highlighter .
public class Neuron { int [] input = new int [8]; // double [] weight = new double [8]; // double mx = 0; // double sum = 0; // int k = 1; // public Neuron() { for ( int i = 0; i < 8; i++) { weight[i] = 1; // // } } public byte Analyze( byte b) { for ( int i = 0; i < 8; i++) { input[i] = 0; } for ( int i = 0; i < 8; i++) // { if ((b / 2) != 0) { input[i] = b % 2; b = Convert .ToByte(b / 2); } else { input[i] = b % 2; break ; } } sum = 0; mx = weight.Sum() / 8; // for ( int i = 0; i < 8; i++) { if (weight[i] > 0) // sum += weight[i] * input[i]; } if (sum > mx) // return 1; else return 0; } public void Yes() // { double s = weight.Sum(); for ( int i = 0; i < 8; i++) { weight[i] += input[i] * (weight[i] / s) * k; } this .Normalize(); } public void No() // { double s = weight.Sum(); for ( int i = 0; i < 8; i++) { weight[i] -= input[i] * (weight[i] / s) * k; } this .Normalize(); } private void Normalize() // { // double min = weight.Min(); double max = weight.Max(); int pow = 0; double b = max / 10; while (b > 1) { b = b / 10; pow++; } for ( int i = 0; i < 8; i++) { weight[i] = weight[i] / Math .Pow(10, pow - 1); } } public void Reset() // { for ( int i = 0; i < 8; i++) { weight[i] = 1; } } // public string Bytes { get { string str = "" ; for ( int i = 0; i < 8; i++) { str += input[i].ToString(); } return str; } } public string Weights { get { string str = "" ; for ( int i = 0; i < 8; i++) { str += weight[i].ToString(); str += " " ; } return str; } } public string Mx { get { return mx.ToString(); } } public string Sum { get { return sum.ToString(); } } } * This source code was highlighted with Source Code Highlighter .
public class Neuron { int [] input = new int [8]; // double [] weight = new double [8]; // double mx = 0; // double sum = 0; // int k = 1; // public Neuron() { for ( int i = 0; i < 8; i++) { weight[i] = 1; // // } } public byte Analyze( byte b) { for ( int i = 0; i < 8; i++) { input[i] = 0; } for ( int i = 0; i < 8; i++) // { if ((b / 2) != 0) { input[i] = b % 2; b = Convert .ToByte(b / 2); } else { input[i] = b % 2; break ; } } sum = 0; mx = weight.Sum() / 8; // for ( int i = 0; i < 8; i++) { if (weight[i] > 0) // sum += weight[i] * input[i]; } if (sum > mx) // return 1; else return 0; } public void Yes() // { double s = weight.Sum(); for ( int i = 0; i < 8; i++) { weight[i] += input[i] * (weight[i] / s) * k; } this .Normalize(); } public void No() // { double s = weight.Sum(); for ( int i = 0; i < 8; i++) { weight[i] -= input[i] * (weight[i] / s) * k; } this .Normalize(); } private void Normalize() // { // double min = weight.Min(); double max = weight.Max(); int pow = 0; double b = max / 10; while (b > 1) { b = b / 10; pow++; } for ( int i = 0; i < 8; i++) { weight[i] = weight[i] / Math .Pow(10, pow - 1); } } public void Reset() // { for ( int i = 0; i < 8; i++) { weight[i] = 1; } } // public string Bytes { get { string str = "" ; for ( int i = 0; i < 8; i++) { str += input[i].ToString(); } return str; } } public string Weights { get { string str = "" ; for ( int i = 0; i < 8; i++) { str += weight[i].ToString(); str += " " ; } return str; } } public string Mx { get { return mx.ToString(); } } public string Sum { get { return sum.ToString(); } } } * This source code was highlighted with Source Code Highlighter .
public class Neuron { int [] input = new int [8]; // double [] weight = new double [8]; // double mx = 0; // double sum = 0; // int k = 1; // public Neuron() { for ( int i = 0; i < 8; i++) { weight[i] = 1; // // } } public byte Analyze( byte b) { for ( int i = 0; i < 8; i++) { input[i] = 0; } for ( int i = 0; i < 8; i++) // { if ((b / 2) != 0) { input[i] = b % 2; b = Convert .ToByte(b / 2); } else { input[i] = b % 2; break ; } } sum = 0; mx = weight.Sum() / 8; // for ( int i = 0; i < 8; i++) { if (weight[i] > 0) // sum += weight[i] * input[i]; } if (sum > mx) // return 1; else return 0; } public void Yes() // { double s = weight.Sum(); for ( int i = 0; i < 8; i++) { weight[i] += input[i] * (weight[i] / s) * k; } this .Normalize(); } public void No() // { double s = weight.Sum(); for ( int i = 0; i < 8; i++) { weight[i] -= input[i] * (weight[i] / s) * k; } this .Normalize(); } private void Normalize() // { // double min = weight.Min(); double max = weight.Max(); int pow = 0; double b = max / 10; while (b > 1) { b = b / 10; pow++; } for ( int i = 0; i < 8; i++) { weight[i] = weight[i] / Math .Pow(10, pow - 1); } } public void Reset() // { for ( int i = 0; i < 8; i++) { weight[i] = 1; } } // public string Bytes { get { string str = "" ; for ( int i = 0; i < 8; i++) { str += input[i].ToString(); } return str; } } public string Weights { get { string str = "" ; for ( int i = 0; i < 8; i++) { str += weight[i].ToString(); str += " " ; } return str; } } public string Mx { get { return mx.ToString(); } } public string Sum { get { return sum.ToString(); } } } * This source code was highlighted with Source Code Highlighter .
public class Neuron { int [] input = new int [8]; // double [] weight = new double [8]; // double mx = 0; // double sum = 0; // int k = 1; // public Neuron() { for ( int i = 0; i < 8; i++) { weight[i] = 1; // // } } public byte Analyze( byte b) { for ( int i = 0; i < 8; i++) { input[i] = 0; } for ( int i = 0; i < 8; i++) // { if ((b / 2) != 0) { input[i] = b % 2; b = Convert .ToByte(b / 2); } else { input[i] = b % 2; break ; } } sum = 0; mx = weight.Sum() / 8; // for ( int i = 0; i < 8; i++) { if (weight[i] > 0) // sum += weight[i] * input[i]; } if (sum > mx) // return 1; else return 0; } public void Yes() // { double s = weight.Sum(); for ( int i = 0; i < 8; i++) { weight[i] += input[i] * (weight[i] / s) * k; } this .Normalize(); } public void No() // { double s = weight.Sum(); for ( int i = 0; i < 8; i++) { weight[i] -= input[i] * (weight[i] / s) * k; } this .Normalize(); } private void Normalize() // { // double min = weight.Min(); double max = weight.Max(); int pow = 0; double b = max / 10; while (b > 1) { b = b / 10; pow++; } for ( int i = 0; i < 8; i++) { weight[i] = weight[i] / Math .Pow(10, pow - 1); } } public void Reset() // { for ( int i = 0; i < 8; i++) { weight[i] = 1; } } // public string Bytes { get { string str = "" ; for ( int i = 0; i < 8; i++) { str += input[i].ToString(); } return str; } } public string Weights { get { string str = "" ; for ( int i = 0; i < 8; i++) { str += weight[i].ToString(); str += " " ; } return str; } } public string Mx { get { return mx.ToString(); } } public string Sum { get { return sum.ToString(); } } } * This source code was highlighted with Source Code Highlighter .
public class Neuron { int [] input = new int [8]; // double [] weight = new double [8]; // double mx = 0; // double sum = 0; // int k = 1; // public Neuron() { for ( int i = 0; i < 8; i++) { weight[i] = 1; // // } } public byte Analyze( byte b) { for ( int i = 0; i < 8; i++) { input[i] = 0; } for ( int i = 0; i < 8; i++) // { if ((b / 2) != 0) { input[i] = b % 2; b = Convert .ToByte(b / 2); } else { input[i] = b % 2; break ; } } sum = 0; mx = weight.Sum() / 8; // for ( int i = 0; i < 8; i++) { if (weight[i] > 0) // sum += weight[i] * input[i]; } if (sum > mx) // return 1; else return 0; } public void Yes() // { double s = weight.Sum(); for ( int i = 0; i < 8; i++) { weight[i] += input[i] * (weight[i] / s) * k; } this .Normalize(); } public void No() // { double s = weight.Sum(); for ( int i = 0; i < 8; i++) { weight[i] -= input[i] * (weight[i] / s) * k; } this .Normalize(); } private void Normalize() // { // double min = weight.Min(); double max = weight.Max(); int pow = 0; double b = max / 10; while (b > 1) { b = b / 10; pow++; } for ( int i = 0; i < 8; i++) { weight[i] = weight[i] / Math .Pow(10, pow - 1); } } public void Reset() // { for ( int i = 0; i < 8; i++) { weight[i] = 1; } } // public string Bytes { get { string str = "" ; for ( int i = 0; i < 8; i++) { str += input[i].ToString(); } return str; } } public string Weights { get { string str = "" ; for ( int i = 0; i < 8; i++) { str += weight[i].ToString(); str += " " ; } return str; } } public string Mx { get { return mx.ToString(); } } public string Sum { get { return sum.ToString(); } } } * This source code was highlighted with Source Code Highlighter .
public class Neuron { int [] input = new int [8]; // double [] weight = new double [8]; // double mx = 0; // double sum = 0; // int k = 1; // public Neuron() { for ( int i = 0; i < 8; i++) { weight[i] = 1; // // } } public byte Analyze( byte b) { for ( int i = 0; i < 8; i++) { input[i] = 0; } for ( int i = 0; i < 8; i++) // { if ((b / 2) != 0) { input[i] = b % 2; b = Convert .ToByte(b / 2); } else { input[i] = b % 2; break ; } } sum = 0; mx = weight.Sum() / 8; // for ( int i = 0; i < 8; i++) { if (weight[i] > 0) // sum += weight[i] * input[i]; } if (sum > mx) // return 1; else return 0; } public void Yes() // { double s = weight.Sum(); for ( int i = 0; i < 8; i++) { weight[i] += input[i] * (weight[i] / s) * k; } this .Normalize(); } public void No() // { double s = weight.Sum(); for ( int i = 0; i < 8; i++) { weight[i] -= input[i] * (weight[i] / s) * k; } this .Normalize(); } private void Normalize() // { // double min = weight.Min(); double max = weight.Max(); int pow = 0; double b = max / 10; while (b > 1) { b = b / 10; pow++; } for ( int i = 0; i < 8; i++) { weight[i] = weight[i] / Math .Pow(10, pow - 1); } } public void Reset() // { for ( int i = 0; i < 8; i++) { weight[i] = 1; } } // public string Bytes { get { string str = "" ; for ( int i = 0; i < 8; i++) { str += input[i].ToString(); } return str; } } public string Weights { get { string str = "" ; for ( int i = 0; i < 8; i++) { str += weight[i].ToString(); str += " " ; } return str; } } public string Mx { get { return mx.ToString(); } } public string Sum { get { return sum.ToString(); } } } * This source code was highlighted with Source Code Highlighter .
public class Neuron { int [] input = new int [8]; // double [] weight = new double [8]; // double mx = 0; // double sum = 0; // int k = 1; // public Neuron() { for ( int i = 0; i < 8; i++) { weight[i] = 1; // // } } public byte Analyze( byte b) { for ( int i = 0; i < 8; i++) { input[i] = 0; } for ( int i = 0; i < 8; i++) // { if ((b / 2) != 0) { input[i] = b % 2; b = Convert .ToByte(b / 2); } else { input[i] = b % 2; break ; } } sum = 0; mx = weight.Sum() / 8; // for ( int i = 0; i < 8; i++) { if (weight[i] > 0) // sum += weight[i] * input[i]; } if (sum > mx) // return 1; else return 0; } public void Yes() // { double s = weight.Sum(); for ( int i = 0; i < 8; i++) { weight[i] += input[i] * (weight[i] / s) * k; } this .Normalize(); } public void No() // { double s = weight.Sum(); for ( int i = 0; i < 8; i++) { weight[i] -= input[i] * (weight[i] / s) * k; } this .Normalize(); } private void Normalize() // { // double min = weight.Min(); double max = weight.Max(); int pow = 0; double b = max / 10; while (b > 1) { b = b / 10; pow++; } for ( int i = 0; i < 8; i++) { weight[i] = weight[i] / Math .Pow(10, pow - 1); } } public void Reset() // { for ( int i = 0; i < 8; i++) { weight[i] = 1; } } // public string Bytes { get { string str = "" ; for ( int i = 0; i < 8; i++) { str += input[i].ToString(); } return str; } } public string Weights { get { string str = "" ; for ( int i = 0; i < 8; i++) { str += weight[i].ToString(); str += " " ; } return str; } } public string Mx { get { return mx.ToString(); } } public string Sum { get { return sum.ToString(); } } } * This source code was highlighted with Source Code Highlighter .
public class Neuron { int [] input = new int [8]; // double [] weight = new double [8]; // double mx = 0; // double sum = 0; // int k = 1; // public Neuron() { for ( int i = 0; i < 8; i++) { weight[i] = 1; // // } } public byte Analyze( byte b) { for ( int i = 0; i < 8; i++) { input[i] = 0; } for ( int i = 0; i < 8; i++) // { if ((b / 2) != 0) { input[i] = b % 2; b = Convert .ToByte(b / 2); } else { input[i] = b % 2; break ; } } sum = 0; mx = weight.Sum() / 8; // for ( int i = 0; i < 8; i++) { if (weight[i] > 0) // sum += weight[i] * input[i]; } if (sum > mx) // return 1; else return 0; } public void Yes() // { double s = weight.Sum(); for ( int i = 0; i < 8; i++) { weight[i] += input[i] * (weight[i] / s) * k; } this .Normalize(); } public void No() // { double s = weight.Sum(); for ( int i = 0; i < 8; i++) { weight[i] -= input[i] * (weight[i] / s) * k; } this .Normalize(); } private void Normalize() // { // double min = weight.Min(); double max = weight.Max(); int pow = 0; double b = max / 10; while (b > 1) { b = b / 10; pow++; } for ( int i = 0; i < 8; i++) { weight[i] = weight[i] / Math .Pow(10, pow - 1); } } public void Reset() // { for ( int i = 0; i < 8; i++) { weight[i] = 1; } } // public string Bytes { get { string str = "" ; for ( int i = 0; i < 8; i++) { str += input[i].ToString(); } return str; } } public string Weights { get { string str = "" ; for ( int i = 0; i < 8; i++) { str += weight[i].ToString(); str += " " ; } return str; } } public string Mx { get { return mx.ToString(); } } public string Sum { get { return sum.ToString(); } } } * This source code was highlighted with Source Code Highlighter .
public class Neuron { int [] input = new int [8]; // double [] weight = new double [8]; // double mx = 0; // double sum = 0; // int k = 1; // public Neuron() { for ( int i = 0; i < 8; i++) { weight[i] = 1; // // } } public byte Analyze( byte b) { for ( int i = 0; i < 8; i++) { input[i] = 0; } for ( int i = 0; i < 8; i++) // { if ((b / 2) != 0) { input[i] = b % 2; b = Convert .ToByte(b / 2); } else { input[i] = b % 2; break ; } } sum = 0; mx = weight.Sum() / 8; // for ( int i = 0; i < 8; i++) { if (weight[i] > 0) // sum += weight[i] * input[i]; } if (sum > mx) // return 1; else return 0; } public void Yes() // { double s = weight.Sum(); for ( int i = 0; i < 8; i++) { weight[i] += input[i] * (weight[i] / s) * k; } this .Normalize(); } public void No() // { double s = weight.Sum(); for ( int i = 0; i < 8; i++) { weight[i] -= input[i] * (weight[i] / s) * k; } this .Normalize(); } private void Normalize() // { // double min = weight.Min(); double max = weight.Max(); int pow = 0; double b = max / 10; while (b > 1) { b = b / 10; pow++; } for ( int i = 0; i < 8; i++) { weight[i] = weight[i] / Math .Pow(10, pow - 1); } } public void Reset() // { for ( int i = 0; i < 8; i++) { weight[i] = 1; } } // public string Bytes { get { string str = "" ; for ( int i = 0; i < 8; i++) { str += input[i].ToString(); } return str; } } public string Weights { get { string str = "" ; for ( int i = 0; i < 8; i++) { str += weight[i].ToString(); str += " " ; } return str; } } public string Mx { get { return mx.ToString(); } } public string Sum { get { return sum.ToString(); } } } * This source code was highlighted with Source Code Highlighter .
public class Neuron { int [] input = new int [8]; // double [] weight = new double [8]; // double mx = 0; // double sum = 0; // int k = 1; // public Neuron() { for ( int i = 0; i < 8; i++) { weight[i] = 1; // // } } public byte Analyze( byte b) { for ( int i = 0; i < 8; i++) { input[i] = 0; } for ( int i = 0; i < 8; i++) // { if ((b / 2) != 0) { input[i] = b % 2; b = Convert .ToByte(b / 2); } else { input[i] = b % 2; break ; } } sum = 0; mx = weight.Sum() / 8; // for ( int i = 0; i < 8; i++) { if (weight[i] > 0) // sum += weight[i] * input[i]; } if (sum > mx) // return 1; else return 0; } public void Yes() // { double s = weight.Sum(); for ( int i = 0; i < 8; i++) { weight[i] += input[i] * (weight[i] / s) * k; } this .Normalize(); } public void No() // { double s = weight.Sum(); for ( int i = 0; i < 8; i++) { weight[i] -= input[i] * (weight[i] / s) * k; } this .Normalize(); } private void Normalize() // { // double min = weight.Min(); double max = weight.Max(); int pow = 0; double b = max / 10; while (b > 1) { b = b / 10; pow++; } for ( int i = 0; i < 8; i++) { weight[i] = weight[i] / Math .Pow(10, pow - 1); } } public void Reset() // { for ( int i = 0; i < 8; i++) { weight[i] = 1; } } // public string Bytes { get { string str = "" ; for ( int i = 0; i < 8; i++) { str += input[i].ToString(); } return str; } } public string Weights { get { string str = "" ; for ( int i = 0; i < 8; i++) { str += weight[i].ToString(); str += " " ; } return str; } } public string Mx { get { return mx.ToString(); } } public string Sum { get { return sum.ToString(); } } } * This source code was highlighted with Source Code Highlighter .
public class Neuron { int [] input = new int [8]; // double [] weight = new double [8]; // double mx = 0; // double sum = 0; // int k = 1; // public Neuron() { for ( int i = 0; i < 8; i++) { weight[i] = 1; // // } } public byte Analyze( byte b) { for ( int i = 0; i < 8; i++) { input[i] = 0; } for ( int i = 0; i < 8; i++) // { if ((b / 2) != 0) { input[i] = b % 2; b = Convert .ToByte(b / 2); } else { input[i] = b % 2; break ; } } sum = 0; mx = weight.Sum() / 8; // for ( int i = 0; i < 8; i++) { if (weight[i] > 0) // sum += weight[i] * input[i]; } if (sum > mx) // return 1; else return 0; } public void Yes() // { double s = weight.Sum(); for ( int i = 0; i < 8; i++) { weight[i] += input[i] * (weight[i] / s) * k; } this .Normalize(); } public void No() // { double s = weight.Sum(); for ( int i = 0; i < 8; i++) { weight[i] -= input[i] * (weight[i] / s) * k; } this .Normalize(); } private void Normalize() // { // double min = weight.Min(); double max = weight.Max(); int pow = 0; double b = max / 10; while (b > 1) { b = b / 10; pow++; } for ( int i = 0; i < 8; i++) { weight[i] = weight[i] / Math .Pow(10, pow - 1); } } public void Reset() // { for ( int i = 0; i < 8; i++) { weight[i] = 1; } } // public string Bytes { get { string str = "" ; for ( int i = 0; i < 8; i++) { str += input[i].ToString(); } return str; } } public string Weights { get { string str = "" ; for ( int i = 0; i < 8; i++) { str += weight[i].ToString(); str += " " ; } return str; } } public string Mx { get { return mx.ToString(); } } public string Sum { get { return sum.ToString(); } } } * This source code was highlighted with Source Code Highlighter .
public class Neuron { int [] input = new int [8]; // double [] weight = new double [8]; // double mx = 0; // double sum = 0; // int k = 1; // public Neuron() { for ( int i = 0; i < 8; i++) { weight[i] = 1; // // } } public byte Analyze( byte b) { for ( int i = 0; i < 8; i++) { input[i] = 0; } for ( int i = 0; i < 8; i++) // { if ((b / 2) != 0) { input[i] = b % 2; b = Convert .ToByte(b / 2); } else { input[i] = b % 2; break ; } } sum = 0; mx = weight.Sum() / 8; // for ( int i = 0; i < 8; i++) { if (weight[i] > 0) // sum += weight[i] * input[i]; } if (sum > mx) // return 1; else return 0; } public void Yes() // { double s = weight.Sum(); for ( int i = 0; i < 8; i++) { weight[i] += input[i] * (weight[i] / s) * k; } this .Normalize(); } public void No() // { double s = weight.Sum(); for ( int i = 0; i < 8; i++) { weight[i] -= input[i] * (weight[i] / s) * k; } this .Normalize(); } private void Normalize() // { // double min = weight.Min(); double max = weight.Max(); int pow = 0; double b = max / 10; while (b > 1) { b = b / 10; pow++; } for ( int i = 0; i < 8; i++) { weight[i] = weight[i] / Math .Pow(10, pow - 1); } } public void Reset() // { for ( int i = 0; i < 8; i++) { weight[i] = 1; } } // public string Bytes { get { string str = "" ; for ( int i = 0; i < 8; i++) { str += input[i].ToString(); } return str; } } public string Weights { get { string str = "" ; for ( int i = 0; i < 8; i++) { str += weight[i].ToString(); str += " " ; } return str; } } public string Mx { get { return mx.ToString(); } } public string Sum { get { return sum.ToString(); } } } * This source code was highlighted with Source Code Highlighter .
public class Neuron { int [] input = new int [8]; // double [] weight = new double [8]; // double mx = 0; // double sum = 0; // int k = 1; // public Neuron() { for ( int i = 0; i < 8; i++) { weight[i] = 1; // // } } public byte Analyze( byte b) { for ( int i = 0; i < 8; i++) { input[i] = 0; } for ( int i = 0; i < 8; i++) // { if ((b / 2) != 0) { input[i] = b % 2; b = Convert .ToByte(b / 2); } else { input[i] = b % 2; break ; } } sum = 0; mx = weight.Sum() / 8; // for ( int i = 0; i < 8; i++) { if (weight[i] > 0) // sum += weight[i] * input[i]; } if (sum > mx) // return 1; else return 0; } public void Yes() // { double s = weight.Sum(); for ( int i = 0; i < 8; i++) { weight[i] += input[i] * (weight[i] / s) * k; } this .Normalize(); } public void No() // { double s = weight.Sum(); for ( int i = 0; i < 8; i++) { weight[i] -= input[i] * (weight[i] / s) * k; } this .Normalize(); } private void Normalize() // { // double min = weight.Min(); double max = weight.Max(); int pow = 0; double b = max / 10; while (b > 1) { b = b / 10; pow++; } for ( int i = 0; i < 8; i++) { weight[i] = weight[i] / Math .Pow(10, pow - 1); } } public void Reset() // { for ( int i = 0; i < 8; i++) { weight[i] = 1; } } // public string Bytes { get { string str = "" ; for ( int i = 0; i < 8; i++) { str += input[i].ToString(); } return str; } } public string Weights { get { string str = "" ; for ( int i = 0; i < 8; i++) { str += weight[i].ToString(); str += " " ; } return str; } } public string Mx { get { return mx.ToString(); } } public string Sum { get { return sum.ToString(); } } } * This source code was highlighted with Source Code Highlighter .
public class Neuron { int [] input = new int [8]; // double [] weight = new double [8]; // double mx = 0; // double sum = 0; // int k = 1; // public Neuron() { for ( int i = 0; i < 8; i++) { weight[i] = 1; // // } } public byte Analyze( byte b) { for ( int i = 0; i < 8; i++) { input[i] = 0; } for ( int i = 0; i < 8; i++) // { if ((b / 2) != 0) { input[i] = b % 2; b = Convert .ToByte(b / 2); } else { input[i] = b % 2; break ; } } sum = 0; mx = weight.Sum() / 8; // for ( int i = 0; i < 8; i++) { if (weight[i] > 0) // sum += weight[i] * input[i]; } if (sum > mx) // return 1; else return 0; } public void Yes() // { double s = weight.Sum(); for ( int i = 0; i < 8; i++) { weight[i] += input[i] * (weight[i] / s) * k; } this .Normalize(); } public void No() // { double s = weight.Sum(); for ( int i = 0; i < 8; i++) { weight[i] -= input[i] * (weight[i] / s) * k; } this .Normalize(); } private void Normalize() // { // double min = weight.Min(); double max = weight.Max(); int pow = 0; double b = max / 10; while (b > 1) { b = b / 10; pow++; } for ( int i = 0; i < 8; i++) { weight[i] = weight[i] / Math .Pow(10, pow - 1); } } public void Reset() // { for ( int i = 0; i < 8; i++) { weight[i] = 1; } } // public string Bytes { get { string str = "" ; for ( int i = 0; i < 8; i++) { str += input[i].ToString(); } return str; } } public string Weights { get { string str = "" ; for ( int i = 0; i < 8; i++) { str += weight[i].ToString(); str += " " ; } return str; } } public string Mx { get { return mx.ToString(); } } public string Sum { get { return sum.ToString(); } } } * This source code was highlighted with Source Code Highlighter .
public class Neuron { int [] input = new int [8]; // double [] weight = new double [8]; // double mx = 0; // double sum = 0; // int k = 1; // public Neuron() { for ( int i = 0; i < 8; i++) { weight[i] = 1; // // } } public byte Analyze( byte b) { for ( int i = 0; i < 8; i++) { input[i] = 0; } for ( int i = 0; i < 8; i++) // { if ((b / 2) != 0) { input[i] = b % 2; b = Convert .ToByte(b / 2); } else { input[i] = b % 2; break ; } } sum = 0; mx = weight.Sum() / 8; // for ( int i = 0; i < 8; i++) { if (weight[i] > 0) // sum += weight[i] * input[i]; } if (sum > mx) // return 1; else return 0; } public void Yes() // { double s = weight.Sum(); for ( int i = 0; i < 8; i++) { weight[i] += input[i] * (weight[i] / s) * k; } this .Normalize(); } public void No() // { double s = weight.Sum(); for ( int i = 0; i < 8; i++) { weight[i] -= input[i] * (weight[i] / s) * k; } this .Normalize(); } private void Normalize() // { // double min = weight.Min(); double max = weight.Max(); int pow = 0; double b = max / 10; while (b > 1) { b = b / 10; pow++; } for ( int i = 0; i < 8; i++) { weight[i] = weight[i] / Math .Pow(10, pow - 1); } } public void Reset() // { for ( int i = 0; i < 8; i++) { weight[i] = 1; } } // public string Bytes { get { string str = "" ; for ( int i = 0; i < 8; i++) { str += input[i].ToString(); } return str; } } public string Weights { get { string str = "" ; for ( int i = 0; i < 8; i++) { str += weight[i].ToString(); str += " " ; } return str; } } public string Mx { get { return mx.ToString(); } } public string Sum { get { return sum.ToString(); } } } * This source code was highlighted with Source Code Highlighter .
public class Neuron { int [] input = new int [8]; // double [] weight = new double [8]; // double mx = 0; // double sum = 0; // int k = 1; // public Neuron() { for ( int i = 0; i < 8; i++) { weight[i] = 1; // // } } public byte Analyze( byte b) { for ( int i = 0; i < 8; i++) { input[i] = 0; } for ( int i = 0; i < 8; i++) // { if ((b / 2) != 0) { input[i] = b % 2; b = Convert .ToByte(b / 2); } else { input[i] = b % 2; break ; } } sum = 0; mx = weight.Sum() / 8; // for ( int i = 0; i < 8; i++) { if (weight[i] > 0) // sum += weight[i] * input[i]; } if (sum > mx) // return 1; else return 0; } public void Yes() // { double s = weight.Sum(); for ( int i = 0; i < 8; i++) { weight[i] += input[i] * (weight[i] / s) * k; } this .Normalize(); } public void No() // { double s = weight.Sum(); for ( int i = 0; i < 8; i++) { weight[i] -= input[i] * (weight[i] / s) * k; } this .Normalize(); } private void Normalize() // { // double min = weight.Min(); double max = weight.Max(); int pow = 0; double b = max / 10; while (b > 1) { b = b / 10; pow++; } for ( int i = 0; i < 8; i++) { weight[i] = weight[i] / Math .Pow(10, pow - 1); } } public void Reset() // { for ( int i = 0; i < 8; i++) { weight[i] = 1; } } // public string Bytes { get { string str = "" ; for ( int i = 0; i < 8; i++) { str += input[i].ToString(); } return str; } } public string Weights { get { string str = "" ; for ( int i = 0; i < 8; i++) { str += weight[i].ToString(); str += " " ; } return str; } } public string Mx { get { return mx.ToString(); } } public string Sum { get { return sum.ToString(); } } } * This source code was highlighted with Source Code Highlighter .
public class Neuron { int [] input = new int [8]; // double [] weight = new double [8]; // double mx = 0; // double sum = 0; // int k = 1; // public Neuron() { for ( int i = 0; i < 8; i++) { weight[i] = 1; // // } } public byte Analyze( byte b) { for ( int i = 0; i < 8; i++) { input[i] = 0; } for ( int i = 0; i < 8; i++) // { if ((b / 2) != 0) { input[i] = b % 2; b = Convert .ToByte(b / 2); } else { input[i] = b % 2; break ; } } sum = 0; mx = weight.Sum() / 8; // for ( int i = 0; i < 8; i++) { if (weight[i] > 0) // sum += weight[i] * input[i]; } if (sum > mx) // return 1; else return 0; } public void Yes() // { double s = weight.Sum(); for ( int i = 0; i < 8; i++) { weight[i] += input[i] * (weight[i] / s) * k; } this .Normalize(); } public void No() // { double s = weight.Sum(); for ( int i = 0; i < 8; i++) { weight[i] -= input[i] * (weight[i] / s) * k; } this .Normalize(); } private void Normalize() // { // double min = weight.Min(); double max = weight.Max(); int pow = 0; double b = max / 10; while (b > 1) { b = b / 10; pow++; } for ( int i = 0; i < 8; i++) { weight[i] = weight[i] / Math .Pow(10, pow - 1); } } public void Reset() // { for ( int i = 0; i < 8; i++) { weight[i] = 1; } } // public string Bytes { get { string str = "" ; for ( int i = 0; i < 8; i++) { str += input[i].ToString(); } return str; } } public string Weights { get { string str = "" ; for ( int i = 0; i < 8; i++) { str += weight[i].ToString(); str += " " ; } return str; } } public string Mx { get { return mx.ToString(); } } public string Sum { get { return sum.ToString(); } } } * This source code was highlighted with Source Code Highlighter .
public class Neuron { int [] input = new int [8]; // double [] weight = new double [8]; // double mx = 0; // double sum = 0; // int k = 1; // public Neuron() { for ( int i = 0; i < 8; i++) { weight[i] = 1; // // } } public byte Analyze( byte b) { for ( int i = 0; i < 8; i++) { input[i] = 0; } for ( int i = 0; i < 8; i++) // { if ((b / 2) != 0) { input[i] = b % 2; b = Convert .ToByte(b / 2); } else { input[i] = b % 2; break ; } } sum = 0; mx = weight.Sum() / 8; // for ( int i = 0; i < 8; i++) { if (weight[i] > 0) // sum += weight[i] * input[i]; } if (sum > mx) // return 1; else return 0; } public void Yes() // { double s = weight.Sum(); for ( int i = 0; i < 8; i++) { weight[i] += input[i] * (weight[i] / s) * k; } this .Normalize(); } public void No() // { double s = weight.Sum(); for ( int i = 0; i < 8; i++) { weight[i] -= input[i] * (weight[i] / s) * k; } this .Normalize(); } private void Normalize() // { // double min = weight.Min(); double max = weight.Max(); int pow = 0; double b = max / 10; while (b > 1) { b = b / 10; pow++; } for ( int i = 0; i < 8; i++) { weight[i] = weight[i] / Math .Pow(10, pow - 1); } } public void Reset() // { for ( int i = 0; i < 8; i++) { weight[i] = 1; } } // public string Bytes { get { string str = "" ; for ( int i = 0; i < 8; i++) { str += input[i].ToString(); } return str; } } public string Weights { get { string str = "" ; for ( int i = 0; i < 8; i++) { str += weight[i].ToString(); str += " " ; } return str; } } public string Mx { get { return mx.ToString(); } } public string Sum { get { return sum.ToString(); } } } * This source code was highlighted with Source Code Highlighter .
public class Neuron { int [] input = new int [8]; // double [] weight = new double [8]; // double mx = 0; // double sum = 0; // int k = 1; // public Neuron() { for ( int i = 0; i < 8; i++) { weight[i] = 1; // // } } public byte Analyze( byte b) { for ( int i = 0; i < 8; i++) { input[i] = 0; } for ( int i = 0; i < 8; i++) // { if ((b / 2) != 0) { input[i] = b % 2; b = Convert .ToByte(b / 2); } else { input[i] = b % 2; break ; } } sum = 0; mx = weight.Sum() / 8; // for ( int i = 0; i < 8; i++) { if (weight[i] > 0) // sum += weight[i] * input[i]; } if (sum > mx) // return 1; else return 0; } public void Yes() // { double s = weight.Sum(); for ( int i = 0; i < 8; i++) { weight[i] += input[i] * (weight[i] / s) * k; } this .Normalize(); } public void No() // { double s = weight.Sum(); for ( int i = 0; i < 8; i++) { weight[i] -= input[i] * (weight[i] / s) * k; } this .Normalize(); } private void Normalize() // { // double min = weight.Min(); double max = weight.Max(); int pow = 0; double b = max / 10; while (b > 1) { b = b / 10; pow++; } for ( int i = 0; i < 8; i++) { weight[i] = weight[i] / Math .Pow(10, pow - 1); } } public void Reset() // { for ( int i = 0; i < 8; i++) { weight[i] = 1; } } // public string Bytes { get { string str = "" ; for ( int i = 0; i < 8; i++) { str += input[i].ToString(); } return str; } } public string Weights { get { string str = "" ; for ( int i = 0; i < 8; i++) { str += weight[i].ToString(); str += " " ; } return str; } } public string Mx { get { return mx.ToString(); } } public string Sum { get { return sum.ToString(); } } } * This source code was highlighted with Source Code Highlighter .
public class Neuron { int [] input = new int [8]; // double [] weight = new double [8]; // double mx = 0; // double sum = 0; // int k = 1; // public Neuron() { for ( int i = 0; i < 8; i++) { weight[i] = 1; // // } } public byte Analyze( byte b) { for ( int i = 0; i < 8; i++) { input[i] = 0; } for ( int i = 0; i < 8; i++) // { if ((b / 2) != 0) { input[i] = b % 2; b = Convert .ToByte(b / 2); } else { input[i] = b % 2; break ; } } sum = 0; mx = weight.Sum() / 8; // for ( int i = 0; i < 8; i++) { if (weight[i] > 0) // sum += weight[i] * input[i]; } if (sum > mx) // return 1; else return 0; } public void Yes() // { double s = weight.Sum(); for ( int i = 0; i < 8; i++) { weight[i] += input[i] * (weight[i] / s) * k; } this .Normalize(); } public void No() // { double s = weight.Sum(); for ( int i = 0; i < 8; i++) { weight[i] -= input[i] * (weight[i] / s) * k; } this .Normalize(); } private void Normalize() // { // double min = weight.Min(); double max = weight.Max(); int pow = 0; double b = max / 10; while (b > 1) { b = b / 10; pow++; } for ( int i = 0; i < 8; i++) { weight[i] = weight[i] / Math .Pow(10, pow - 1); } } public void Reset() // { for ( int i = 0; i < 8; i++) { weight[i] = 1; } } // public string Bytes { get { string str = "" ; for ( int i = 0; i < 8; i++) { str += input[i].ToString(); } return str; } } public string Weights { get { string str = "" ; for ( int i = 0; i < 8; i++) { str += weight[i].ToString(); str += " " ; } return str; } } public string Mx { get { return mx.ToString(); } } public string Sum { get { return sum.ToString(); } } } * This source code was highlighted with Source Code Highlighter .
public class Neuron { int [] input = new int [8]; // double [] weight = new double [8]; // double mx = 0; // double sum = 0; // int k = 1; // public Neuron() { for ( int i = 0; i < 8; i++) { weight[i] = 1; // // } } public byte Analyze( byte b) { for ( int i = 0; i < 8; i++) { input[i] = 0; } for ( int i = 0; i < 8; i++) // { if ((b / 2) != 0) { input[i] = b % 2; b = Convert .ToByte(b / 2); } else { input[i] = b % 2; break ; } } sum = 0; mx = weight.Sum() / 8; // for ( int i = 0; i < 8; i++) { if (weight[i] > 0) // sum += weight[i] * input[i]; } if (sum > mx) // return 1; else return 0; } public void Yes() // { double s = weight.Sum(); for ( int i = 0; i < 8; i++) { weight[i] += input[i] * (weight[i] / s) * k; } this .Normalize(); } public void No() // { double s = weight.Sum(); for ( int i = 0; i < 8; i++) { weight[i] -= input[i] * (weight[i] / s) * k; } this .Normalize(); } private void Normalize() // { // double min = weight.Min(); double max = weight.Max(); int pow = 0; double b = max / 10; while (b > 1) { b = b / 10; pow++; } for ( int i = 0; i < 8; i++) { weight[i] = weight[i] / Math .Pow(10, pow - 1); } } public void Reset() // { for ( int i = 0; i < 8; i++) { weight[i] = 1; } } // public string Bytes { get { string str = "" ; for ( int i = 0; i < 8; i++) { str += input[i].ToString(); } return str; } } public string Weights { get { string str = "" ; for ( int i = 0; i < 8; i++) { str += weight[i].ToString(); str += " " ; } return str; } } public string Mx { get { return mx.ToString(); } } public string Sum { get { return sum.ToString(); } } } * This source code was highlighted with Source Code Highlighter .
public class Neuron { int [] input = new int [8]; // double [] weight = new double [8]; // double mx = 0; // double sum = 0; // int k = 1; // public Neuron() { for ( int i = 0; i < 8; i++) { weight[i] = 1; // // } } public byte Analyze( byte b) { for ( int i = 0; i < 8; i++) { input[i] = 0; } for ( int i = 0; i < 8; i++) // { if ((b / 2) != 0) { input[i] = b % 2; b = Convert .ToByte(b / 2); } else { input[i] = b % 2; break ; } } sum = 0; mx = weight.Sum() / 8; // for ( int i = 0; i < 8; i++) { if (weight[i] > 0) // sum += weight[i] * input[i]; } if (sum > mx) // return 1; else return 0; } public void Yes() // { double s = weight.Sum(); for ( int i = 0; i < 8; i++) { weight[i] += input[i] * (weight[i] / s) * k; } this .Normalize(); } public void No() // { double s = weight.Sum(); for ( int i = 0; i < 8; i++) { weight[i] -= input[i] * (weight[i] / s) * k; } this .Normalize(); } private void Normalize() // { // double min = weight.Min(); double max = weight.Max(); int pow = 0; double b = max / 10; while (b > 1) { b = b / 10; pow++; } for ( int i = 0; i < 8; i++) { weight[i] = weight[i] / Math .Pow(10, pow - 1); } } public void Reset() // { for ( int i = 0; i < 8; i++) { weight[i] = 1; } } // public string Bytes { get { string str = "" ; for ( int i = 0; i < 8; i++) { str += input[i].ToString(); } return str; } } public string Weights { get { string str = "" ; for ( int i = 0; i < 8; i++) { str += weight[i].ToString(); str += " " ; } return str; } } public string Mx { get { return mx.ToString(); } } public string Sum { get { return sum.ToString(); } } } * This source code was highlighted with Source Code Highlighter .
public class Neuron { int [] input = new int [8]; // double [] weight = new double [8]; // double mx = 0; // double sum = 0; // int k = 1; // public Neuron() { for ( int i = 0; i < 8; i++) { weight[i] = 1; // // } } public byte Analyze( byte b) { for ( int i = 0; i < 8; i++) { input[i] = 0; } for ( int i = 0; i < 8; i++) // { if ((b / 2) != 0) { input[i] = b % 2; b = Convert .ToByte(b / 2); } else { input[i] = b % 2; break ; } } sum = 0; mx = weight.Sum() / 8; // for ( int i = 0; i < 8; i++) { if (weight[i] > 0) // sum += weight[i] * input[i]; } if (sum > mx) // return 1; else return 0; } public void Yes() // { double s = weight.Sum(); for ( int i = 0; i < 8; i++) { weight[i] += input[i] * (weight[i] / s) * k; } this .Normalize(); } public void No() // { double s = weight.Sum(); for ( int i = 0; i < 8; i++) { weight[i] -= input[i] * (weight[i] / s) * k; } this .Normalize(); } private void Normalize() // { // double min = weight.Min(); double max = weight.Max(); int pow = 0; double b = max / 10; while (b > 1) { b = b / 10; pow++; } for ( int i = 0; i < 8; i++) { weight[i] = weight[i] / Math .Pow(10, pow - 1); } } public void Reset() // { for ( int i = 0; i < 8; i++) { weight[i] = 1; } } // public string Bytes { get { string str = "" ; for ( int i = 0; i < 8; i++) { str += input[i].ToString(); } return str; } } public string Weights { get { string str = "" ; for ( int i = 0; i < 8; i++) { str += weight[i].ToString(); str += " " ; } return str; } } public string Mx { get { return mx.ToString(); } } public string Sum { get { return sum.ToString(); } } } * This source code was highlighted with Source Code Highlighter .
public class Neuron { int [] input = new int [8]; // double [] weight = new double [8]; // double mx = 0; // double sum = 0; // int k = 1; // public Neuron() { for ( int i = 0; i < 8; i++) { weight[i] = 1; // // } } public byte Analyze( byte b) { for ( int i = 0; i < 8; i++) { input[i] = 0; } for ( int i = 0; i < 8; i++) // { if ((b / 2) != 0) { input[i] = b % 2; b = Convert .ToByte(b / 2); } else { input[i] = b % 2; break ; } } sum = 0; mx = weight.Sum() / 8; // for ( int i = 0; i < 8; i++) { if (weight[i] > 0) // sum += weight[i] * input[i]; } if (sum > mx) // return 1; else return 0; } public void Yes() // { double s = weight.Sum(); for ( int i = 0; i < 8; i++) { weight[i] += input[i] * (weight[i] / s) * k; } this .Normalize(); } public void No() // { double s = weight.Sum(); for ( int i = 0; i < 8; i++) { weight[i] -= input[i] * (weight[i] / s) * k; } this .Normalize(); } private void Normalize() // { // double min = weight.Min(); double max = weight.Max(); int pow = 0; double b = max / 10; while (b > 1) { b = b / 10; pow++; } for ( int i = 0; i < 8; i++) { weight[i] = weight[i] / Math .Pow(10, pow - 1); } } public void Reset() // { for ( int i = 0; i < 8; i++) { weight[i] = 1; } } // public string Bytes { get { string str = "" ; for ( int i = 0; i < 8; i++) { str += input[i].ToString(); } return str; } } public string Weights { get { string str = "" ; for ( int i = 0; i < 8; i++) { str += weight[i].ToString(); str += " " ; } return str; } } public string Mx { get { return mx.ToString(); } } public string Sum { get { return sum.ToString(); } } } * This source code was highlighted with Source Code Highlighter .
public class Neuron { int [] input = new int [8]; // double [] weight = new double [8]; // double mx = 0; // double sum = 0; // int k = 1; // public Neuron() { for ( int i = 0; i < 8; i++) { weight[i] = 1; // // } } public byte Analyze( byte b) { for ( int i = 0; i < 8; i++) { input[i] = 0; } for ( int i = 0; i < 8; i++) // { if ((b / 2) != 0) { input[i] = b % 2; b = Convert .ToByte(b / 2); } else { input[i] = b % 2; break ; } } sum = 0; mx = weight.Sum() / 8; // for ( int i = 0; i < 8; i++) { if (weight[i] > 0) // sum += weight[i] * input[i]; } if (sum > mx) // return 1; else return 0; } public void Yes() // { double s = weight.Sum(); for ( int i = 0; i < 8; i++) { weight[i] += input[i] * (weight[i] / s) * k; } this .Normalize(); } public void No() // { double s = weight.Sum(); for ( int i = 0; i < 8; i++) { weight[i] -= input[i] * (weight[i] / s) * k; } this .Normalize(); } private void Normalize() // { // double min = weight.Min(); double max = weight.Max(); int pow = 0; double b = max / 10; while (b > 1) { b = b / 10; pow++; } for ( int i = 0; i < 8; i++) { weight[i] = weight[i] / Math .Pow(10, pow - 1); } } public void Reset() // { for ( int i = 0; i < 8; i++) { weight[i] = 1; } } // public string Bytes { get { string str = "" ; for ( int i = 0; i < 8; i++) { str += input[i].ToString(); } return str; } } public string Weights { get { string str = "" ; for ( int i = 0; i < 8; i++) { str += weight[i].ToString(); str += " " ; } return str; } } public string Mx { get { return mx.ToString(); } } public string Sum { get { return sum.ToString(); } } } * This source code was highlighted with Source Code Highlighter .
public class Neuron { int [] input = new int [8]; // double [] weight = new double [8]; // double mx = 0; // double sum = 0; // int k = 1; // public Neuron() { for ( int i = 0; i < 8; i++) { weight[i] = 1; // // } } public byte Analyze( byte b) { for ( int i = 0; i < 8; i++) { input[i] = 0; } for ( int i = 0; i < 8; i++) // { if ((b / 2) != 0) { input[i] = b % 2; b = Convert .ToByte(b / 2); } else { input[i] = b % 2; break ; } } sum = 0; mx = weight.Sum() / 8; // for ( int i = 0; i < 8; i++) { if (weight[i] > 0) // sum += weight[i] * input[i]; } if (sum > mx) // return 1; else return 0; } public void Yes() // { double s = weight.Sum(); for ( int i = 0; i < 8; i++) { weight[i] += input[i] * (weight[i] / s) * k; } this .Normalize(); } public void No() // { double s = weight.Sum(); for ( int i = 0; i < 8; i++) { weight[i] -= input[i] * (weight[i] / s) * k; } this .Normalize(); } private void Normalize() // { // double min = weight.Min(); double max = weight.Max(); int pow = 0; double b = max / 10; while (b > 1) { b = b / 10; pow++; } for ( int i = 0; i < 8; i++) { weight[i] = weight[i] / Math .Pow(10, pow - 1); } } public void Reset() // { for ( int i = 0; i < 8; i++) { weight[i] = 1; } } // public string Bytes { get { string str = "" ; for ( int i = 0; i < 8; i++) { str += input[i].ToString(); } return str; } } public string Weights { get { string str = "" ; for ( int i = 0; i < 8; i++) { str += weight[i].ToString(); str += " " ; } return str; } } public string Mx { get { return mx.ToString(); } } public string Sum { get { return sum.ToString(); } } } * This source code was highlighted with Source Code Highlighter .
public class Neuron { int [] input = new int [8]; // double [] weight = new double [8]; // double mx = 0; // double sum = 0; // int k = 1; // public Neuron() { for ( int i = 0; i < 8; i++) { weight[i] = 1; // // } } public byte Analyze( byte b) { for ( int i = 0; i < 8; i++) { input[i] = 0; } for ( int i = 0; i < 8; i++) // { if ((b / 2) != 0) { input[i] = b % 2; b = Convert .ToByte(b / 2); } else { input[i] = b % 2; break ; } } sum = 0; mx = weight.Sum() / 8; // for ( int i = 0; i < 8; i++) { if (weight[i] > 0) // sum += weight[i] * input[i]; } if (sum > mx) // return 1; else return 0; } public void Yes() // { double s = weight.Sum(); for ( int i = 0; i < 8; i++) { weight[i] += input[i] * (weight[i] / s) * k; } this .Normalize(); } public void No() // { double s = weight.Sum(); for ( int i = 0; i < 8; i++) { weight[i] -= input[i] * (weight[i] / s) * k; } this .Normalize(); } private void Normalize() // { // double min = weight.Min(); double max = weight.Max(); int pow = 0; double b = max / 10; while (b > 1) { b = b / 10; pow++; } for ( int i = 0; i < 8; i++) { weight[i] = weight[i] / Math .Pow(10, pow - 1); } } public void Reset() // { for ( int i = 0; i < 8; i++) { weight[i] = 1; } } // public string Bytes { get { string str = "" ; for ( int i = 0; i < 8; i++) { str += input[i].ToString(); } return str; } } public string Weights { get { string str = "" ; for ( int i = 0; i < 8; i++) { str += weight[i].ToString(); str += " " ; } return str; } } public string Mx { get { return mx.ToString(); } } public string Sum { get { return sum.ToString(); } } } * This source code was highlighted with Source Code Highlighter .
public class Neuron { int [] input = new int [8]; // double [] weight = new double [8]; // double mx = 0; // double sum = 0; // int k = 1; // public Neuron() { for ( int i = 0; i < 8; i++) { weight[i] = 1; // // } } public byte Analyze( byte b) { for ( int i = 0; i < 8; i++) { input[i] = 0; } for ( int i = 0; i < 8; i++) // { if ((b / 2) != 0) { input[i] = b % 2; b = Convert .ToByte(b / 2); } else { input[i] = b % 2; break ; } } sum = 0; mx = weight.Sum() / 8; // for ( int i = 0; i < 8; i++) { if (weight[i] > 0) // sum += weight[i] * input[i]; } if (sum > mx) // return 1; else return 0; } public void Yes() // { double s = weight.Sum(); for ( int i = 0; i < 8; i++) { weight[i] += input[i] * (weight[i] / s) * k; } this .Normalize(); } public void No() // { double s = weight.Sum(); for ( int i = 0; i < 8; i++) { weight[i] -= input[i] * (weight[i] / s) * k; } this .Normalize(); } private void Normalize() // { // double min = weight.Min(); double max = weight.Max(); int pow = 0; double b = max / 10; while (b > 1) { b = b / 10; pow++; } for ( int i = 0; i < 8; i++) { weight[i] = weight[i] / Math .Pow(10, pow - 1); } } public void Reset() // { for ( int i = 0; i < 8; i++) { weight[i] = 1; } } // public string Bytes { get { string str = "" ; for ( int i = 0; i < 8; i++) { str += input[i].ToString(); } return str; } } public string Weights { get { string str = "" ; for ( int i = 0; i < 8; i++) { str += weight[i].ToString(); str += " " ; } return str; } } public string Mx { get { return mx.ToString(); } } public string Sum { get { return sum.ToString(); } } } * This source code was highlighted with Source Code Highlighter .
public class Neuron { int [] input = new int [8]; // double [] weight = new double [8]; // double mx = 0; // double sum = 0; // int k = 1; // public Neuron() { for ( int i = 0; i < 8; i++) { weight[i] = 1; // // } } public byte Analyze( byte b) { for ( int i = 0; i < 8; i++) { input[i] = 0; } for ( int i = 0; i < 8; i++) // { if ((b / 2) != 0) { input[i] = b % 2; b = Convert .ToByte(b / 2); } else { input[i] = b % 2; break ; } } sum = 0; mx = weight.Sum() / 8; // for ( int i = 0; i < 8; i++) { if (weight[i] > 0) // sum += weight[i] * input[i]; } if (sum > mx) // return 1; else return 0; } public void Yes() // { double s = weight.Sum(); for ( int i = 0; i < 8; i++) { weight[i] += input[i] * (weight[i] / s) * k; } this .Normalize(); } public void No() // { double s = weight.Sum(); for ( int i = 0; i < 8; i++) { weight[i] -= input[i] * (weight[i] / s) * k; } this .Normalize(); } private void Normalize() // { // double min = weight.Min(); double max = weight.Max(); int pow = 0; double b = max / 10; while (b > 1) { b = b / 10; pow++; } for ( int i = 0; i < 8; i++) { weight[i] = weight[i] / Math .Pow(10, pow - 1); } } public void Reset() // { for ( int i = 0; i < 8; i++) { weight[i] = 1; } } // public string Bytes { get { string str = "" ; for ( int i = 0; i < 8; i++) { str += input[i].ToString(); } return str; } } public string Weights { get { string str = "" ; for ( int i = 0; i < 8; i++) { str += weight[i].ToString(); str += " " ; } return str; } } public string Mx { get { return mx.ToString(); } } public string Sum { get { return sum.ToString(); } } } * This source code was highlighted with Source Code Highlighter .
public class Neuron { int [] input = new int [8]; // double [] weight = new double [8]; // double mx = 0; // double sum = 0; // int k = 1; // public Neuron() { for ( int i = 0; i < 8; i++) { weight[i] = 1; // // } } public byte Analyze( byte b) { for ( int i = 0; i < 8; i++) { input[i] = 0; } for ( int i = 0; i < 8; i++) // { if ((b / 2) != 0) { input[i] = b % 2; b = Convert .ToByte(b / 2); } else { input[i] = b % 2; break ; } } sum = 0; mx = weight.Sum() / 8; // for ( int i = 0; i < 8; i++) { if (weight[i] > 0) // sum += weight[i] * input[i]; } if (sum > mx) // return 1; else return 0; } public void Yes() // { double s = weight.Sum(); for ( int i = 0; i < 8; i++) { weight[i] += input[i] * (weight[i] / s) * k; } this .Normalize(); } public void No() // { double s = weight.Sum(); for ( int i = 0; i < 8; i++) { weight[i] -= input[i] * (weight[i] / s) * k; } this .Normalize(); } private void Normalize() // { // double min = weight.Min(); double max = weight.Max(); int pow = 0; double b = max / 10; while (b > 1) { b = b / 10; pow++; } for ( int i = 0; i < 8; i++) { weight[i] = weight[i] / Math .Pow(10, pow - 1); } } public void Reset() // { for ( int i = 0; i < 8; i++) { weight[i] = 1; } } // public string Bytes { get { string str = "" ; for ( int i = 0; i < 8; i++) { str += input[i].ToString(); } return str; } } public string Weights { get { string str = "" ; for ( int i = 0; i < 8; i++) { str += weight[i].ToString(); str += " " ; } return str; } } public string Mx { get { return mx.ToString(); } } public string Sum { get { return sum.ToString(); } } } * This source code was highlighted with Source Code Highlighter .
public class Neuron { int [] input = new int [8]; // double [] weight = new double [8]; // double mx = 0; // double sum = 0; // int k = 1; // public Neuron() { for ( int i = 0; i < 8; i++) { weight[i] = 1; // // } } public byte Analyze( byte b) { for ( int i = 0; i < 8; i++) { input[i] = 0; } for ( int i = 0; i < 8; i++) // { if ((b / 2) != 0) { input[i] = b % 2; b = Convert .ToByte(b / 2); } else { input[i] = b % 2; break ; } } sum = 0; mx = weight.Sum() / 8; // for ( int i = 0; i < 8; i++) { if (weight[i] > 0) // sum += weight[i] * input[i]; } if (sum > mx) // return 1; else return 0; } public void Yes() // { double s = weight.Sum(); for ( int i = 0; i < 8; i++) { weight[i] += input[i] * (weight[i] / s) * k; } this .Normalize(); } public void No() // { double s = weight.Sum(); for ( int i = 0; i < 8; i++) { weight[i] -= input[i] * (weight[i] / s) * k; } this .Normalize(); } private void Normalize() // { // double min = weight.Min(); double max = weight.Max(); int pow = 0; double b = max / 10; while (b > 1) { b = b / 10; pow++; } for ( int i = 0; i < 8; i++) { weight[i] = weight[i] / Math .Pow(10, pow - 1); } } public void Reset() // { for ( int i = 0; i < 8; i++) { weight[i] = 1; } } // public string Bytes { get { string str = "" ; for ( int i = 0; i < 8; i++) { str += input[i].ToString(); } return str; } } public string Weights { get { string str = "" ; for ( int i = 0; i < 8; i++) { str += weight[i].ToString(); str += " " ; } return str; } } public string Mx { get { return mx.ToString(); } } public string Sum { get { return sum.ToString(); } } } * This source code was highlighted with Source Code Highlighter .
public class Neuron { int [] input = new int [8]; // double [] weight = new double [8]; // double mx = 0; // double sum = 0; // int k = 1; // public Neuron() { for ( int i = 0; i < 8; i++) { weight[i] = 1; // // } } public byte Analyze( byte b) { for ( int i = 0; i < 8; i++) { input[i] = 0; } for ( int i = 0; i < 8; i++) // { if ((b / 2) != 0) { input[i] = b % 2; b = Convert .ToByte(b / 2); } else { input[i] = b % 2; break ; } } sum = 0; mx = weight.Sum() / 8; // for ( int i = 0; i < 8; i++) { if (weight[i] > 0) // sum += weight[i] * input[i]; } if (sum > mx) // return 1; else return 0; } public void Yes() // { double s = weight.Sum(); for ( int i = 0; i < 8; i++) { weight[i] += input[i] * (weight[i] / s) * k; } this .Normalize(); } public void No() // { double s = weight.Sum(); for ( int i = 0; i < 8; i++) { weight[i] -= input[i] * (weight[i] / s) * k; } this .Normalize(); } private void Normalize() // { // double min = weight.Min(); double max = weight.Max(); int pow = 0; double b = max / 10; while (b > 1) { b = b / 10; pow++; } for ( int i = 0; i < 8; i++) { weight[i] = weight[i] / Math .Pow(10, pow - 1); } } public void Reset() // { for ( int i = 0; i < 8; i++) { weight[i] = 1; } } // public string Bytes { get { string str = "" ; for ( int i = 0; i < 8; i++) { str += input[i].ToString(); } return str; } } public string Weights { get { string str = "" ; for ( int i = 0; i < 8; i++) { str += weight[i].ToString(); str += " " ; } return str; } } public string Mx { get { return mx.ToString(); } } public string Sum { get { return sum.ToString(); } } } * This source code was highlighted with Source Code Highlighter .
public class Neuron { int [] input = new int [8]; // double [] weight = new double [8]; // double mx = 0; // double sum = 0; // int k = 1; // public Neuron() { for ( int i = 0; i < 8; i++) { weight[i] = 1; // // } } public byte Analyze( byte b) { for ( int i = 0; i < 8; i++) { input[i] = 0; } for ( int i = 0; i < 8; i++) // { if ((b / 2) != 0) { input[i] = b % 2; b = Convert .ToByte(b / 2); } else { input[i] = b % 2; break ; } } sum = 0; mx = weight.Sum() / 8; // for ( int i = 0; i < 8; i++) { if (weight[i] > 0) // sum += weight[i] * input[i]; } if (sum > mx) // return 1; else return 0; } public void Yes() // { double s = weight.Sum(); for ( int i = 0; i < 8; i++) { weight[i] += input[i] * (weight[i] / s) * k; } this .Normalize(); } public void No() // { double s = weight.Sum(); for ( int i = 0; i < 8; i++) { weight[i] -= input[i] * (weight[i] / s) * k; } this .Normalize(); } private void Normalize() // { // double min = weight.Min(); double max = weight.Max(); int pow = 0; double b = max / 10; while (b > 1) { b = b / 10; pow++; } for ( int i = 0; i < 8; i++) { weight[i] = weight[i] / Math .Pow(10, pow - 1); } } public void Reset() // { for ( int i = 0; i < 8; i++) { weight[i] = 1; } } // public string Bytes { get { string str = "" ; for ( int i = 0; i < 8; i++) { str += input[i].ToString(); } return str; } } public string Weights { get { string str = "" ; for ( int i = 0; i < 8; i++) { str += weight[i].ToString(); str += " " ; } return str; } } public string Mx { get { return mx.ToString(); } } public string Sum { get { return sum.ToString(); } } } * This source code was highlighted with Source Code Highlighter .
public class Neuron { int [] input = new int [8]; // double [] weight = new double [8]; // double mx = 0; // double sum = 0; // int k = 1; // public Neuron() { for ( int i = 0; i < 8; i++) { weight[i] = 1; // // } } public byte Analyze( byte b) { for ( int i = 0; i < 8; i++) { input[i] = 0; } for ( int i = 0; i < 8; i++) // { if ((b / 2) != 0) { input[i] = b % 2; b = Convert .ToByte(b / 2); } else { input[i] = b % 2; break ; } } sum = 0; mx = weight.Sum() / 8; // for ( int i = 0; i < 8; i++) { if (weight[i] > 0) // sum += weight[i] * input[i]; } if (sum > mx) // return 1; else return 0; } public void Yes() // { double s = weight.Sum(); for ( int i = 0; i < 8; i++) { weight[i] += input[i] * (weight[i] / s) * k; } this .Normalize(); } public void No() // { double s = weight.Sum(); for ( int i = 0; i < 8; i++) { weight[i] -= input[i] * (weight[i] / s) * k; } this .Normalize(); } private void Normalize() // { // double min = weight.Min(); double max = weight.Max(); int pow = 0; double b = max / 10; while (b > 1) { b = b / 10; pow++; } for ( int i = 0; i < 8; i++) { weight[i] = weight[i] / Math .Pow(10, pow - 1); } } public void Reset() // { for ( int i = 0; i < 8; i++) { weight[i] = 1; } } // public string Bytes { get { string str = "" ; for ( int i = 0; i < 8; i++) { str += input[i].ToString(); } return str; } } public string Weights { get { string str = "" ; for ( int i = 0; i < 8; i++) { str += weight[i].ToString(); str += " " ; } return str; } } public string Mx { get { return mx.ToString(); } } public string Sum { get { return sum.ToString(); } } } * This source code was highlighted with Source Code Highlighter .
public class Neuron { int [] input = new int [8]; // double [] weight = new double [8]; // double mx = 0; // double sum = 0; // int k = 1; // public Neuron() { for ( int i = 0; i < 8; i++) { weight[i] = 1; // // } } public byte Analyze( byte b) { for ( int i = 0; i < 8; i++) { input[i] = 0; } for ( int i = 0; i < 8; i++) // { if ((b / 2) != 0) { input[i] = b % 2; b = Convert .ToByte(b / 2); } else { input[i] = b % 2; break ; } } sum = 0; mx = weight.Sum() / 8; // for ( int i = 0; i < 8; i++) { if (weight[i] > 0) // sum += weight[i] * input[i]; } if (sum > mx) // return 1; else return 0; } public void Yes() // { double s = weight.Sum(); for ( int i = 0; i < 8; i++) { weight[i] += input[i] * (weight[i] / s) * k; } this .Normalize(); } public void No() // { double s = weight.Sum(); for ( int i = 0; i < 8; i++) { weight[i] -= input[i] * (weight[i] / s) * k; } this .Normalize(); } private void Normalize() // { // double min = weight.Min(); double max = weight.Max(); int pow = 0; double b = max / 10; while (b > 1) { b = b / 10; pow++; } for ( int i = 0; i < 8; i++) { weight[i] = weight[i] / Math .Pow(10, pow - 1); } } public void Reset() // { for ( int i = 0; i < 8; i++) { weight[i] = 1; } } // public string Bytes { get { string str = "" ; for ( int i = 0; i < 8; i++) { str += input[i].ToString(); } return str; } } public string Weights { get { string str = "" ; for ( int i = 0; i < 8; i++) { str += weight[i].ToString(); str += " " ; } return str; } } public string Mx { get { return mx.ToString(); } } public string Sum { get { return sum.ToString(); } } } * This source code was highlighted with Source Code Highlighter .
public class Neuron { int [] input = new int [8]; // double [] weight = new double [8]; // double mx = 0; // double sum = 0; // int k = 1; // public Neuron() { for ( int i = 0; i < 8; i++) { weight[i] = 1; // // } } public byte Analyze( byte b) { for ( int i = 0; i < 8; i++) { input[i] = 0; } for ( int i = 0; i < 8; i++) // { if ((b / 2) != 0) { input[i] = b % 2; b = Convert .ToByte(b / 2); } else { input[i] = b % 2; break ; } } sum = 0; mx = weight.Sum() / 8; // for ( int i = 0; i < 8; i++) { if (weight[i] > 0) // sum += weight[i] * input[i]; } if (sum > mx) // return 1; else return 0; } public void Yes() // { double s = weight.Sum(); for ( int i = 0; i < 8; i++) { weight[i] += input[i] * (weight[i] / s) * k; } this .Normalize(); } public void No() // { double s = weight.Sum(); for ( int i = 0; i < 8; i++) { weight[i] -= input[i] * (weight[i] / s) * k; } this .Normalize(); } private void Normalize() // { // double min = weight.Min(); double max = weight.Max(); int pow = 0; double b = max / 10; while (b > 1) { b = b / 10; pow++; } for ( int i = 0; i < 8; i++) { weight[i] = weight[i] / Math .Pow(10, pow - 1); } } public void Reset() // { for ( int i = 0; i < 8; i++) { weight[i] = 1; } } // public string Bytes { get { string str = "" ; for ( int i = 0; i < 8; i++) { str += input[i].ToString(); } return str; } } public string Weights { get { string str = "" ; for ( int i = 0; i < 8; i++) { str += weight[i].ToString(); str += " " ; } return str; } } public string Mx { get { return mx.ToString(); } } public string Sum { get { return sum.ToString(); } } } * This source code was highlighted with Source Code Highlighter .
public class Neuron { int [] input = new int [8]; // double [] weight = new double [8]; // double mx = 0; // double sum = 0; // int k = 1; // public Neuron() { for ( int i = 0; i < 8; i++) { weight[i] = 1; // // } } public byte Analyze( byte b) { for ( int i = 0; i < 8; i++) { input[i] = 0; } for ( int i = 0; i < 8; i++) // { if ((b / 2) != 0) { input[i] = b % 2; b = Convert .ToByte(b / 2); } else { input[i] = b % 2; break ; } } sum = 0; mx = weight.Sum() / 8; // for ( int i = 0; i < 8; i++) { if (weight[i] > 0) // sum += weight[i] * input[i]; } if (sum > mx) // return 1; else return 0; } public void Yes() // { double s = weight.Sum(); for ( int i = 0; i < 8; i++) { weight[i] += input[i] * (weight[i] / s) * k; } this .Normalize(); } public void No() // { double s = weight.Sum(); for ( int i = 0; i < 8; i++) { weight[i] -= input[i] * (weight[i] / s) * k; } this .Normalize(); } private void Normalize() // { // double min = weight.Min(); double max = weight.Max(); int pow = 0; double b = max / 10; while (b > 1) { b = b / 10; pow++; } for ( int i = 0; i < 8; i++) { weight[i] = weight[i] / Math .Pow(10, pow - 1); } } public void Reset() // { for ( int i = 0; i < 8; i++) { weight[i] = 1; } } // public string Bytes { get { string str = "" ; for ( int i = 0; i < 8; i++) { str += input[i].ToString(); } return str; } } public string Weights { get { string str = "" ; for ( int i = 0; i < 8; i++) { str += weight[i].ToString(); str += " " ; } return str; } } public string Mx { get { return mx.ToString(); } } public string Sum { get { return sum.ToString(); } } } * This source code was highlighted with Source Code Highlighter .
public class Neuron { int [] input = new int [8]; // double [] weight = new double [8]; // double mx = 0; // double sum = 0; // int k = 1; // public Neuron() { for ( int i = 0; i < 8; i++) { weight[i] = 1; // // } } public byte Analyze( byte b) { for ( int i = 0; i < 8; i++) { input[i] = 0; } for ( int i = 0; i < 8; i++) // { if ((b / 2) != 0) { input[i] = b % 2; b = Convert .ToByte(b / 2); } else { input[i] = b % 2; break ; } } sum = 0; mx = weight.Sum() / 8; // for ( int i = 0; i < 8; i++) { if (weight[i] > 0) // sum += weight[i] * input[i]; } if (sum > mx) // return 1; else return 0; } public void Yes() // { double s = weight.Sum(); for ( int i = 0; i < 8; i++) { weight[i] += input[i] * (weight[i] / s) * k; } this .Normalize(); } public void No() // { double s = weight.Sum(); for ( int i = 0; i < 8; i++) { weight[i] -= input[i] * (weight[i] / s) * k; } this .Normalize(); } private void Normalize() // { // double min = weight.Min(); double max = weight.Max(); int pow = 0; double b = max / 10; while (b > 1) { b = b / 10; pow++; } for ( int i = 0; i < 8; i++) { weight[i] = weight[i] / Math .Pow(10, pow - 1); } } public void Reset() // { for ( int i = 0; i < 8; i++) { weight[i] = 1; } } // public string Bytes { get { string str = "" ; for ( int i = 0; i < 8; i++) { str += input[i].ToString(); } return str; } } public string Weights { get { string str = "" ; for ( int i = 0; i < 8; i++) { str += weight[i].ToString(); str += " " ; } return str; } } public string Mx { get { return mx.ToString(); } } public string Sum { get { return sum.ToString(); } } } * This source code was highlighted with Source Code Highlighter .
public class Neuron { int [] input = new int [8]; // double [] weight = new double [8]; // double mx = 0; // double sum = 0; // int k = 1; // public Neuron() { for ( int i = 0; i < 8; i++) { weight[i] = 1; // // } } public byte Analyze( byte b) { for ( int i = 0; i < 8; i++) { input[i] = 0; } for ( int i = 0; i < 8; i++) // { if ((b / 2) != 0) { input[i] = b % 2; b = Convert .ToByte(b / 2); } else { input[i] = b % 2; break ; } } sum = 0; mx = weight.Sum() / 8; // for ( int i = 0; i < 8; i++) { if (weight[i] > 0) // sum += weight[i] * input[i]; } if (sum > mx) // return 1; else return 0; } public void Yes() // { double s = weight.Sum(); for ( int i = 0; i < 8; i++) { weight[i] += input[i] * (weight[i] / s) * k; } this .Normalize(); } public void No() // { double s = weight.Sum(); for ( int i = 0; i < 8; i++) { weight[i] -= input[i] * (weight[i] / s) * k; } this .Normalize(); } private void Normalize() // { // double min = weight.Min(); double max = weight.Max(); int pow = 0; double b = max / 10; while (b > 1) { b = b / 10; pow++; } for ( int i = 0; i < 8; i++) { weight[i] = weight[i] / Math .Pow(10, pow - 1); } } public void Reset() // { for ( int i = 0; i < 8; i++) { weight[i] = 1; } } // public string Bytes { get { string str = "" ; for ( int i = 0; i < 8; i++) { str += input[i].ToString(); } return str; } } public string Weights { get { string str = "" ; for ( int i = 0; i < 8; i++) { str += weight[i].ToString(); str += " " ; } return str; } } public string Mx { get { return mx.ToString(); } } public string Sum { get { return sum.ToString(); } } } * This source code was highlighted with Source Code Highlighter .
public class Neuron { int [] input = new int [8]; // double [] weight = new double [8]; // double mx = 0; // double sum = 0; // int k = 1; // public Neuron() { for ( int i = 0; i < 8; i++) { weight[i] = 1; // // } } public byte Analyze( byte b) { for ( int i = 0; i < 8; i++) { input[i] = 0; } for ( int i = 0; i < 8; i++) // { if ((b / 2) != 0) { input[i] = b % 2; b = Convert .ToByte(b / 2); } else { input[i] = b % 2; break ; } } sum = 0; mx = weight.Sum() / 8; // for ( int i = 0; i < 8; i++) { if (weight[i] > 0) // sum += weight[i] * input[i]; } if (sum > mx) // return 1; else return 0; } public void Yes() // { double s = weight.Sum(); for ( int i = 0; i < 8; i++) { weight[i] += input[i] * (weight[i] / s) * k; } this .Normalize(); } public void No() // { double s = weight.Sum(); for ( int i = 0; i < 8; i++) { weight[i] -= input[i] * (weight[i] / s) * k; } this .Normalize(); } private void Normalize() // { // double min = weight.Min(); double max = weight.Max(); int pow = 0; double b = max / 10; while (b > 1) { b = b / 10; pow++; } for ( int i = 0; i < 8; i++) { weight[i] = weight[i] / Math .Pow(10, pow - 1); } } public void Reset() // { for ( int i = 0; i < 8; i++) { weight[i] = 1; } } // public string Bytes { get { string str = "" ; for ( int i = 0; i < 8; i++) { str += input[i].ToString(); } return str; } } public string Weights { get { string str = "" ; for ( int i = 0; i < 8; i++) { str += weight[i].ToString(); str += " " ; } return str; } } public string Mx { get { return mx.ToString(); } } public string Sum { get { return sum.ToString(); } } } * This source code was highlighted with Source Code Highlighter .
public class Neuron { int [] input = new int [8]; // double [] weight = new double [8]; // double mx = 0; // double sum = 0; // int k = 1; // public Neuron() { for ( int i = 0; i < 8; i++) { weight[i] = 1; // // } } public byte Analyze( byte b) { for ( int i = 0; i < 8; i++) { input[i] = 0; } for ( int i = 0; i < 8; i++) // { if ((b / 2) != 0) { input[i] = b % 2; b = Convert .ToByte(b / 2); } else { input[i] = b % 2; break ; } } sum = 0; mx = weight.Sum() / 8; // for ( int i = 0; i < 8; i++) { if (weight[i] > 0) // sum += weight[i] * input[i]; } if (sum > mx) // return 1; else return 0; } public void Yes() // { double s = weight.Sum(); for ( int i = 0; i < 8; i++) { weight[i] += input[i] * (weight[i] / s) * k; } this .Normalize(); } public void No() // { double s = weight.Sum(); for ( int i = 0; i < 8; i++) { weight[i] -= input[i] * (weight[i] / s) * k; } this .Normalize(); } private void Normalize() // { // double min = weight.Min(); double max = weight.Max(); int pow = 0; double b = max / 10; while (b > 1) { b = b / 10; pow++; } for ( int i = 0; i < 8; i++) { weight[i] = weight[i] / Math .Pow(10, pow - 1); } } public void Reset() // { for ( int i = 0; i < 8; i++) { weight[i] = 1; } } // public string Bytes { get { string str = "" ; for ( int i = 0; i < 8; i++) { str += input[i].ToString(); } return str; } } public string Weights { get { string str = "" ; for ( int i = 0; i < 8; i++) { str += weight[i].ToString(); str += " " ; } return str; } } public string Mx { get { return mx.ToString(); } } public string Sum { get { return sum.ToString(); } } } * This source code was highlighted with Source Code Highlighter .
public class Neuron { int [] input = new int [8]; // double [] weight = new double [8]; // double mx = 0; // double sum = 0; // int k = 1; // public Neuron() { for ( int i = 0; i < 8; i++) { weight[i] = 1; // // } } public byte Analyze( byte b) { for ( int i = 0; i < 8; i++) { input[i] = 0; } for ( int i = 0; i < 8; i++) // { if ((b / 2) != 0) { input[i] = b % 2; b = Convert .ToByte(b / 2); } else { input[i] = b % 2; break ; } } sum = 0; mx = weight.Sum() / 8; // for ( int i = 0; i < 8; i++) { if (weight[i] > 0) // sum += weight[i] * input[i]; } if (sum > mx) // return 1; else return 0; } public void Yes() // { double s = weight.Sum(); for ( int i = 0; i < 8; i++) { weight[i] += input[i] * (weight[i] / s) * k; } this .Normalize(); } public void No() // { double s = weight.Sum(); for ( int i = 0; i < 8; i++) { weight[i] -= input[i] * (weight[i] / s) * k; } this .Normalize(); } private void Normalize() // { // double min = weight.Min(); double max = weight.Max(); int pow = 0; double b = max / 10; while (b > 1) { b = b / 10; pow++; } for ( int i = 0; i < 8; i++) { weight[i] = weight[i] / Math .Pow(10, pow - 1); } } public void Reset() // { for ( int i = 0; i < 8; i++) { weight[i] = 1; } } // public string Bytes { get { string str = "" ; for ( int i = 0; i < 8; i++) { str += input[i].ToString(); } return str; } } public string Weights { get { string str = "" ; for ( int i = 0; i < 8; i++) { str += weight[i].ToString(); str += " " ; } return str; } } public string Mx { get { return mx.ToString(); } } public string Sum { get { return sum.ToString(); } } } * This source code was highlighted with Source Code Highlighter .
public class Neuron { int [] input = new int [8]; // double [] weight = new double [8]; // double mx = 0; // double sum = 0; // int k = 1; // public Neuron() { for ( int i = 0; i < 8; i++) { weight[i] = 1; // // } } public byte Analyze( byte b) { for ( int i = 0; i < 8; i++) { input[i] = 0; } for ( int i = 0; i < 8; i++) // { if ((b / 2) != 0) { input[i] = b % 2; b = Convert .ToByte(b / 2); } else { input[i] = b % 2; break ; } } sum = 0; mx = weight.Sum() / 8; // for ( int i = 0; i < 8; i++) { if (weight[i] > 0) // sum += weight[i] * input[i]; } if (sum > mx) // return 1; else return 0; } public void Yes() // { double s = weight.Sum(); for ( int i = 0; i < 8; i++) { weight[i] += input[i] * (weight[i] / s) * k; } this .Normalize(); } public void No() // { double s = weight.Sum(); for ( int i = 0; i < 8; i++) { weight[i] -= input[i] * (weight[i] / s) * k; } this .Normalize(); } private void Normalize() // { // double min = weight.Min(); double max = weight.Max(); int pow = 0; double b = max / 10; while (b > 1) { b = b / 10; pow++; } for ( int i = 0; i < 8; i++) { weight[i] = weight[i] / Math .Pow(10, pow - 1); } } public void Reset() // { for ( int i = 0; i < 8; i++) { weight[i] = 1; } } // public string Bytes { get { string str = "" ; for ( int i = 0; i < 8; i++) { str += input[i].ToString(); } return str; } } public string Weights { get { string str = "" ; for ( int i = 0; i < 8; i++) { str += weight[i].ToString(); str += " " ; } return str; } } public string Mx { get { return mx.ToString(); } } public string Sum { get { return sum.ToString(); } } } * This source code was highlighted with Source Code Highlighter .
public class Neuron { int [] input = new int [8]; // double [] weight = new double [8]; // double mx = 0; // double sum = 0; // int k = 1; // public Neuron() { for ( int i = 0; i < 8; i++) { weight[i] = 1; // // } } public byte Analyze( byte b) { for ( int i = 0; i < 8; i++) { input[i] = 0; } for ( int i = 0; i < 8; i++) // { if ((b / 2) != 0) { input[i] = b % 2; b = Convert .ToByte(b / 2); } else { input[i] = b % 2; break ; } } sum = 0; mx = weight.Sum() / 8; // for ( int i = 0; i < 8; i++) { if (weight[i] > 0) // sum += weight[i] * input[i]; } if (sum > mx) // return 1; else return 0; } public void Yes() // { double s = weight.Sum(); for ( int i = 0; i < 8; i++) { weight[i] += input[i] * (weight[i] / s) * k; } this .Normalize(); } public void No() // { double s = weight.Sum(); for ( int i = 0; i < 8; i++) { weight[i] -= input[i] * (weight[i] / s) * k; } this .Normalize(); } private void Normalize() // { // double min = weight.Min(); double max = weight.Max(); int pow = 0; double b = max / 10; while (b > 1) { b = b / 10; pow++; } for ( int i = 0; i < 8; i++) { weight[i] = weight[i] / Math .Pow(10, pow - 1); } } public void Reset() // { for ( int i = 0; i < 8; i++) { weight[i] = 1; } } // public string Bytes { get { string str = "" ; for ( int i = 0; i < 8; i++) { str += input[i].ToString(); } return str; } } public string Weights { get { string str = "" ; for ( int i = 0; i < 8; i++) { str += weight[i].ToString(); str += " " ; } return str; } } public string Mx { get { return mx.ToString(); } } public string Sum { get { return sum.ToString(); } } } * This source code was highlighted with Source Code Highlighter .
public class Neuron { int [] input = new int [8]; // double [] weight = new double [8]; // double mx = 0; // double sum = 0; // int k = 1; // public Neuron() { for ( int i = 0; i < 8; i++) { weight[i] = 1; // // } } public byte Analyze( byte b) { for ( int i = 0; i < 8; i++) { input[i] = 0; } for ( int i = 0; i < 8; i++) // { if ((b / 2) != 0) { input[i] = b % 2; b = Convert .ToByte(b / 2); } else { input[i] = b % 2; break ; } } sum = 0; mx = weight.Sum() / 8; // for ( int i = 0; i < 8; i++) { if (weight[i] > 0) // sum += weight[i] * input[i]; } if (sum > mx) // return 1; else return 0; } public void Yes() // { double s = weight.Sum(); for ( int i = 0; i < 8; i++) { weight[i] += input[i] * (weight[i] / s) * k; } this .Normalize(); } public void No() // { double s = weight.Sum(); for ( int i = 0; i < 8; i++) { weight[i] -= input[i] * (weight[i] / s) * k; } this .Normalize(); } private void Normalize() // { // double min = weight.Min(); double max = weight.Max(); int pow = 0; double b = max / 10; while (b > 1) { b = b / 10; pow++; } for ( int i = 0; i < 8; i++) { weight[i] = weight[i] / Math .Pow(10, pow - 1); } } public void Reset() // { for ( int i = 0; i < 8; i++) { weight[i] = 1; } } // public string Bytes { get { string str = "" ; for ( int i = 0; i < 8; i++) { str += input[i].ToString(); } return str; } } public string Weights { get { string str = "" ; for ( int i = 0; i < 8; i++) { str += weight[i].ToString(); str += " " ; } return str; } } public string Mx { get { return mx.ToString(); } } public string Sum { get { return sum.ToString(); } } } * This source code was highlighted with Source Code Highlighter .
public class Neuron { int [] input = new int [8]; // double [] weight = new double [8]; // double mx = 0; // double sum = 0; // int k = 1; // public Neuron() { for ( int i = 0; i < 8; i++) { weight[i] = 1; // // } } public byte Analyze( byte b) { for ( int i = 0; i < 8; i++) { input[i] = 0; } for ( int i = 0; i < 8; i++) // { if ((b / 2) != 0) { input[i] = b % 2; b = Convert .ToByte(b / 2); } else { input[i] = b % 2; break ; } } sum = 0; mx = weight.Sum() / 8; // for ( int i = 0; i < 8; i++) { if (weight[i] > 0) // sum += weight[i] * input[i]; } if (sum > mx) // return 1; else return 0; } public void Yes() // { double s = weight.Sum(); for ( int i = 0; i < 8; i++) { weight[i] += input[i] * (weight[i] / s) * k; } this .Normalize(); } public void No() // { double s = weight.Sum(); for ( int i = 0; i < 8; i++) { weight[i] -= input[i] * (weight[i] / s) * k; } this .Normalize(); } private void Normalize() // { // double min = weight.Min(); double max = weight.Max(); int pow = 0; double b = max / 10; while (b > 1) { b = b / 10; pow++; } for ( int i = 0; i < 8; i++) { weight[i] = weight[i] / Math .Pow(10, pow - 1); } } public void Reset() // { for ( int i = 0; i < 8; i++) { weight[i] = 1; } } // public string Bytes { get { string str = "" ; for ( int i = 0; i < 8; i++) { str += input[i].ToString(); } return str; } } public string Weights { get { string str = "" ; for ( int i = 0; i < 8; i++) { str += weight[i].ToString(); str += " " ; } return str; } } public string Mx { get { return mx.ToString(); } } public string Sum { get { return sum.ToString(); } } } * This source code was highlighted with Source Code Highlighter .
public class Neuron { int [] input = new int [8]; // double [] weight = new double [8]; // double mx = 0; // double sum = 0; // int k = 1; // public Neuron() { for ( int i = 0; i < 8; i++) { weight[i] = 1; // // } } public byte Analyze( byte b) { for ( int i = 0; i < 8; i++) { input[i] = 0; } for ( int i = 0; i < 8; i++) // { if ((b / 2) != 0) { input[i] = b % 2; b = Convert .ToByte(b / 2); } else { input[i] = b % 2; break ; } } sum = 0; mx = weight.Sum() / 8; // for ( int i = 0; i < 8; i++) { if (weight[i] > 0) // sum += weight[i] * input[i]; } if (sum > mx) // return 1; else return 0; } public void Yes() // { double s = weight.Sum(); for ( int i = 0; i < 8; i++) { weight[i] += input[i] * (weight[i] / s) * k; } this .Normalize(); } public void No() // { double s = weight.Sum(); for ( int i = 0; i < 8; i++) { weight[i] -= input[i] * (weight[i] / s) * k; } this .Normalize(); } private void Normalize() // { // double min = weight.Min(); double max = weight.Max(); int pow = 0; double b = max / 10; while (b > 1) { b = b / 10; pow++; } for ( int i = 0; i < 8; i++) { weight[i] = weight[i] / Math .Pow(10, pow - 1); } } public void Reset() // { for ( int i = 0; i < 8; i++) { weight[i] = 1; } } // public string Bytes { get { string str = "" ; for ( int i = 0; i < 8; i++) { str += input[i].ToString(); } return str; } } public string Weights { get { string str = "" ; for ( int i = 0; i < 8; i++) { str += weight[i].ToString(); str += " " ; } return str; } } public string Mx { get { return mx.ToString(); } } public string Sum { get { return sum.ToString(); } } } * This source code was highlighted with Source Code Highlighter .
public class Neuron { int [] input = new int [8]; // double [] weight = new double [8]; // double mx = 0; // double sum = 0; // int k = 1; // public Neuron() { for ( int i = 0; i < 8; i++) { weight[i] = 1; // // } } public byte Analyze( byte b) { for ( int i = 0; i < 8; i++) { input[i] = 0; } for ( int i = 0; i < 8; i++) // { if ((b / 2) != 0) { input[i] = b % 2; b = Convert .ToByte(b / 2); } else { input[i] = b % 2; break ; } } sum = 0; mx = weight.Sum() / 8; // for ( int i = 0; i < 8; i++) { if (weight[i] > 0) // sum += weight[i] * input[i]; } if (sum > mx) // return 1; else return 0; } public void Yes() // { double s = weight.Sum(); for ( int i = 0; i < 8; i++) { weight[i] += input[i] * (weight[i] / s) * k; } this .Normalize(); } public void No() // { double s = weight.Sum(); for ( int i = 0; i < 8; i++) { weight[i] -= input[i] * (weight[i] / s) * k; } this .Normalize(); } private void Normalize() // { // double min = weight.Min(); double max = weight.Max(); int pow = 0; double b = max / 10; while (b > 1) { b = b / 10; pow++; } for ( int i = 0; i < 8; i++) { weight[i] = weight[i] / Math .Pow(10, pow - 1); } } public void Reset() // { for ( int i = 0; i < 8; i++) { weight[i] = 1; } } // public string Bytes { get { string str = "" ; for ( int i = 0; i < 8; i++) { str += input[i].ToString(); } return str; } } public string Weights { get { string str = "" ; for ( int i = 0; i < 8; i++) { str += weight[i].ToString(); str += " " ; } return str; } } public string Mx { get { return mx.ToString(); } } public string Sum { get { return sum.ToString(); } } } * This source code was highlighted with Source Code Highlighter .
public class Neuron { int [] input = new int [8]; // double [] weight = new double [8]; // double mx = 0; // double sum = 0; // int k = 1; // public Neuron() { for ( int i = 0; i < 8; i++) { weight[i] = 1; // // } } public byte Analyze( byte b) { for ( int i = 0; i < 8; i++) { input[i] = 0; } for ( int i = 0; i < 8; i++) // { if ((b / 2) != 0) { input[i] = b % 2; b = Convert .ToByte(b / 2); } else { input[i] = b % 2; break ; } } sum = 0; mx = weight.Sum() / 8; // for ( int i = 0; i < 8; i++) { if (weight[i] > 0) // sum += weight[i] * input[i]; } if (sum > mx) // return 1; else return 0; } public void Yes() // { double s = weight.Sum(); for ( int i = 0; i < 8; i++) { weight[i] += input[i] * (weight[i] / s) * k; } this .Normalize(); } public void No() // { double s = weight.Sum(); for ( int i = 0; i < 8; i++) { weight[i] -= input[i] * (weight[i] / s) * k; } this .Normalize(); } private void Normalize() // { // double min = weight.Min(); double max = weight.Max(); int pow = 0; double b = max / 10; while (b > 1) { b = b / 10; pow++; } for ( int i = 0; i < 8; i++) { weight[i] = weight[i] / Math .Pow(10, pow - 1); } } public void Reset() // { for ( int i = 0; i < 8; i++) { weight[i] = 1; } } // public string Bytes { get { string str = "" ; for ( int i = 0; i < 8; i++) { str += input[i].ToString(); } return str; } } public string Weights { get { string str = "" ; for ( int i = 0; i < 8; i++) { str += weight[i].ToString(); str += " " ; } return str; } } public string Mx { get { return mx.ToString(); } } public string Sum { get { return sum.ToString(); } } } * This source code was highlighted with Source Code Highlighter .
public class Neuron { int [] input = new int [8]; // double [] weight = new double [8]; // double mx = 0; // double sum = 0; // int k = 1; // public Neuron() { for ( int i = 0; i < 8; i++) { weight[i] = 1; // // } } public byte Analyze( byte b) { for ( int i = 0; i < 8; i++) { input[i] = 0; } for ( int i = 0; i < 8; i++) // { if ((b / 2) != 0) { input[i] = b % 2; b = Convert .ToByte(b / 2); } else { input[i] = b % 2; break ; } } sum = 0; mx = weight.Sum() / 8; // for ( int i = 0; i < 8; i++) { if (weight[i] > 0) // sum += weight[i] * input[i]; } if (sum > mx) // return 1; else return 0; } public void Yes() // { double s = weight.Sum(); for ( int i = 0; i < 8; i++) { weight[i] += input[i] * (weight[i] / s) * k; } this .Normalize(); } public void No() // { double s = weight.Sum(); for ( int i = 0; i < 8; i++) { weight[i] -= input[i] * (weight[i] / s) * k; } this .Normalize(); } private void Normalize() // { // double min = weight.Min(); double max = weight.Max(); int pow = 0; double b = max / 10; while (b > 1) { b = b / 10; pow++; } for ( int i = 0; i < 8; i++) { weight[i] = weight[i] / Math .Pow(10, pow - 1); } } public void Reset() // { for ( int i = 0; i < 8; i++) { weight[i] = 1; } } // public string Bytes { get { string str = "" ; for ( int i = 0; i < 8; i++) { str += input[i].ToString(); } return str; } } public string Weights { get { string str = "" ; for ( int i = 0; i < 8; i++) { str += weight[i].ToString(); str += " " ; } return str; } } public string Mx { get { return mx.ToString(); } } public string Sum { get { return sum.ToString(); } } } * This source code was highlighted with Source Code Highlighter .
public class Neuron { int [] input = new int [8]; // double [] weight = new double [8]; // double mx = 0; // double sum = 0; // int k = 1; // public Neuron() { for ( int i = 0; i < 8; i++) { weight[i] = 1; // // } } public byte Analyze( byte b) { for ( int i = 0; i < 8; i++) { input[i] = 0; } for ( int i = 0; i < 8; i++) // { if ((b / 2) != 0) { input[i] = b % 2; b = Convert .ToByte(b / 2); } else { input[i] = b % 2; break ; } } sum = 0; mx = weight.Sum() / 8; // for ( int i = 0; i < 8; i++) { if (weight[i] > 0) // sum += weight[i] * input[i]; } if (sum > mx) // return 1; else return 0; } public void Yes() // { double s = weight.Sum(); for ( int i = 0; i < 8; i++) { weight[i] += input[i] * (weight[i] / s) * k; } this .Normalize(); } public void No() // { double s = weight.Sum(); for ( int i = 0; i < 8; i++) { weight[i] -= input[i] * (weight[i] / s) * k; } this .Normalize(); } private void Normalize() // { // double min = weight.Min(); double max = weight.Max(); int pow = 0; double b = max / 10; while (b > 1) { b = b / 10; pow++; } for ( int i = 0; i < 8; i++) { weight[i] = weight[i] / Math .Pow(10, pow - 1); } } public void Reset() // { for ( int i = 0; i < 8; i++) { weight[i] = 1; } } // public string Bytes { get { string str = "" ; for ( int i = 0; i < 8; i++) { str += input[i].ToString(); } return str; } } public string Weights { get { string str = "" ; for ( int i = 0; i < 8; i++) { str += weight[i].ToString(); str += " " ; } return str; } } public string Mx { get { return mx.ToString(); } } public string Sum { get { return sum.ToString(); } } } * This source code was highlighted with Source Code Highlighter .
public class Neuron { int [] input = new int [8]; // double [] weight = new double [8]; // double mx = 0; // double sum = 0; // int k = 1; // public Neuron() { for ( int i = 0; i < 8; i++) { weight[i] = 1; // // } } public byte Analyze( byte b) { for ( int i = 0; i < 8; i++) { input[i] = 0; } for ( int i = 0; i < 8; i++) // { if ((b / 2) != 0) { input[i] = b % 2; b = Convert .ToByte(b / 2); } else { input[i] = b % 2; break ; } } sum = 0; mx = weight.Sum() / 8; // for ( int i = 0; i < 8; i++) { if (weight[i] > 0) // sum += weight[i] * input[i]; } if (sum > mx) // return 1; else return 0; } public void Yes() // { double s = weight.Sum(); for ( int i = 0; i < 8; i++) { weight[i] += input[i] * (weight[i] / s) * k; } this .Normalize(); } public void No() // { double s = weight.Sum(); for ( int i = 0; i < 8; i++) { weight[i] -= input[i] * (weight[i] / s) * k; } this .Normalize(); } private void Normalize() // { // double min = weight.Min(); double max = weight.Max(); int pow = 0; double b = max / 10; while (b > 1) { b = b / 10; pow++; } for ( int i = 0; i < 8; i++) { weight[i] = weight[i] / Math .Pow(10, pow - 1); } } public void Reset() // { for ( int i = 0; i < 8; i++) { weight[i] = 1; } } // public string Bytes { get { string str = "" ; for ( int i = 0; i < 8; i++) { str += input[i].ToString(); } return str; } } public string Weights { get { string str = "" ; for ( int i = 0; i < 8; i++) { str += weight[i].ToString(); str += " " ; } return str; } } public string Mx { get { return mx.ToString(); } } public string Sum { get { return sum.ToString(); } } } * This source code was highlighted with Source Code Highlighter .
public class Neuron { int [] input = new int [8]; // double [] weight = new double [8]; // double mx = 0; // double sum = 0; // int k = 1; // public Neuron() { for ( int i = 0; i < 8; i++) { weight[i] = 1; // // } } public byte Analyze( byte b) { for ( int i = 0; i < 8; i++) { input[i] = 0; } for ( int i = 0; i < 8; i++) // { if ((b / 2) != 0) { input[i] = b % 2; b = Convert .ToByte(b / 2); } else { input[i] = b % 2; break ; } } sum = 0; mx = weight.Sum() / 8; // for ( int i = 0; i < 8; i++) { if (weight[i] > 0) // sum += weight[i] * input[i]; } if (sum > mx) // return 1; else return 0; } public void Yes() // { double s = weight.Sum(); for ( int i = 0; i < 8; i++) { weight[i] += input[i] * (weight[i] / s) * k; } this .Normalize(); } public void No() // { double s = weight.Sum(); for ( int i = 0; i < 8; i++) { weight[i] -= input[i] * (weight[i] / s) * k; } this .Normalize(); } private void Normalize() // { // double min = weight.Min(); double max = weight.Max(); int pow = 0; double b = max / 10; while (b > 1) { b = b / 10; pow++; } for ( int i = 0; i < 8; i++) { weight[i] = weight[i] / Math .Pow(10, pow - 1); } } public void Reset() // { for ( int i = 0; i < 8; i++) { weight[i] = 1; } } // public string Bytes { get { string str = "" ; for ( int i = 0; i < 8; i++) { str += input[i].ToString(); } return str; } } public string Weights { get { string str = "" ; for ( int i = 0; i < 8; i++) { str += weight[i].ToString(); str += " " ; } return str; } } public string Mx { get { return mx.ToString(); } } public string Sum { get { return sum.ToString(); } } } * This source code was highlighted with Source Code Highlighter .
public class Neuron { int [] input = new int [8]; // double [] weight = new double [8]; // double mx = 0; // double sum = 0; // int k = 1; // public Neuron() { for ( int i = 0; i < 8; i++) { weight[i] = 1; // // } } public byte Analyze( byte b) { for ( int i = 0; i < 8; i++) { input[i] = 0; } for ( int i = 0; i < 8; i++) // { if ((b / 2) != 0) { input[i] = b % 2; b = Convert .ToByte(b / 2); } else { input[i] = b % 2; break ; } } sum = 0; mx = weight.Sum() / 8; // for ( int i = 0; i < 8; i++) { if (weight[i] > 0) // sum += weight[i] * input[i]; } if (sum > mx) // return 1; else return 0; } public void Yes() // { double s = weight.Sum(); for ( int i = 0; i < 8; i++) { weight[i] += input[i] * (weight[i] / s) * k; } this .Normalize(); } public void No() // { double s = weight.Sum(); for ( int i = 0; i < 8; i++) { weight[i] -= input[i] * (weight[i] / s) * k; } this .Normalize(); } private void Normalize() // { // double min = weight.Min(); double max = weight.Max(); int pow = 0; double b = max / 10; while (b > 1) { b = b / 10; pow++; } for ( int i = 0; i < 8; i++) { weight[i] = weight[i] / Math .Pow(10, pow - 1); } } public void Reset() // { for ( int i = 0; i < 8; i++) { weight[i] = 1; } } // public string Bytes { get { string str = "" ; for ( int i = 0; i < 8; i++) { str += input[i].ToString(); } return str; } } public string Weights { get { string str = "" ; for ( int i = 0; i < 8; i++) { str += weight[i].ToString(); str += " " ; } return str; } } public string Mx { get { return mx.ToString(); } } public string Sum { get { return sum.ToString(); } } } * This source code was highlighted with Source Code Highlighter .
public class Neuron { int [] input = new int [8]; // double [] weight = new double [8]; // double mx = 0; // double sum = 0; // int k = 1; // public Neuron() { for ( int i = 0; i < 8; i++) { weight[i] = 1; // // } } public byte Analyze( byte b) { for ( int i = 0; i < 8; i++) { input[i] = 0; } for ( int i = 0; i < 8; i++) // { if ((b / 2) != 0) { input[i] = b % 2; b = Convert .ToByte(b / 2); } else { input[i] = b % 2; break ; } } sum = 0; mx = weight.Sum() / 8; // for ( int i = 0; i < 8; i++) { if (weight[i] > 0) // sum += weight[i] * input[i]; } if (sum > mx) // return 1; else return 0; } public void Yes() // { double s = weight.Sum(); for ( int i = 0; i < 8; i++) { weight[i] += input[i] * (weight[i] / s) * k; } this .Normalize(); } public void No() // { double s = weight.Sum(); for ( int i = 0; i < 8; i++) { weight[i] -= input[i] * (weight[i] / s) * k; } this .Normalize(); } private void Normalize() // { // double min = weight.Min(); double max = weight.Max(); int pow = 0; double b = max / 10; while (b > 1) { b = b / 10; pow++; } for ( int i = 0; i < 8; i++) { weight[i] = weight[i] / Math .Pow(10, pow - 1); } } public void Reset() // { for ( int i = 0; i < 8; i++) { weight[i] = 1; } } // public string Bytes { get { string str = "" ; for ( int i = 0; i < 8; i++) { str += input[i].ToString(); } return str; } } public string Weights { get { string str = "" ; for ( int i = 0; i < 8; i++) { str += weight[i].ToString(); str += " " ; } return str; } } public string Mx { get { return mx.ToString(); } } public string Sum { get { return sum.ToString(); } } } * This source code was highlighted with Source Code Highlighter .
public class Neuron { int [] input = new int [8]; // double [] weight = new double [8]; // double mx = 0; // double sum = 0; // int k = 1; // public Neuron() { for ( int i = 0; i < 8; i++) { weight[i] = 1; // // } } public byte Analyze( byte b) { for ( int i = 0; i < 8; i++) { input[i] = 0; } for ( int i = 0; i < 8; i++) // { if ((b / 2) != 0) { input[i] = b % 2; b = Convert .ToByte(b / 2); } else { input[i] = b % 2; break ; } } sum = 0; mx = weight.Sum() / 8; // for ( int i = 0; i < 8; i++) { if (weight[i] > 0) // sum += weight[i] * input[i]; } if (sum > mx) // return 1; else return 0; } public void Yes() // { double s = weight.Sum(); for ( int i = 0; i < 8; i++) { weight[i] += input[i] * (weight[i] / s) * k; } this .Normalize(); } public void No() // { double s = weight.Sum(); for ( int i = 0; i < 8; i++) { weight[i] -= input[i] * (weight[i] / s) * k; } this .Normalize(); } private void Normalize() // { // double min = weight.Min(); double max = weight.Max(); int pow = 0; double b = max / 10; while (b > 1) { b = b / 10; pow++; } for ( int i = 0; i < 8; i++) { weight[i] = weight[i] / Math .Pow(10, pow - 1); } } public void Reset() // { for ( int i = 0; i < 8; i++) { weight[i] = 1; } } // public string Bytes { get { string str = "" ; for ( int i = 0; i < 8; i++) { str += input[i].ToString(); } return str; } } public string Weights { get { string str = "" ; for ( int i = 0; i < 8; i++) { str += weight[i].ToString(); str += " " ; } return str; } } public string Mx { get { return mx.ToString(); } } public string Sum { get { return sum.ToString(); } } } * This source code was highlighted with Source Code Highlighter .
public class Neuron { int [] input = new int [8]; // double [] weight = new double [8]; // double mx = 0; // double sum = 0; // int k = 1; // public Neuron() { for ( int i = 0; i < 8; i++) { weight[i] = 1; // // } } public byte Analyze( byte b) { for ( int i = 0; i < 8; i++) { input[i] = 0; } for ( int i = 0; i < 8; i++) // { if ((b / 2) != 0) { input[i] = b % 2; b = Convert .ToByte(b / 2); } else { input[i] = b % 2; break ; } } sum = 0; mx = weight.Sum() / 8; // for ( int i = 0; i < 8; i++) { if (weight[i] > 0) // sum += weight[i] * input[i]; } if (sum > mx) // return 1; else return 0; } public void Yes() // { double s = weight.Sum(); for ( int i = 0; i < 8; i++) { weight[i] += input[i] * (weight[i] / s) * k; } this .Normalize(); } public void No() // { double s = weight.Sum(); for ( int i = 0; i < 8; i++) { weight[i] -= input[i] * (weight[i] / s) * k; } this .Normalize(); } private void Normalize() // { // double min = weight.Min(); double max = weight.Max(); int pow = 0; double b = max / 10; while (b > 1) { b = b / 10; pow++; } for ( int i = 0; i < 8; i++) { weight[i] = weight[i] / Math .Pow(10, pow - 1); } } public void Reset() // { for ( int i = 0; i < 8; i++) { weight[i] = 1; } } // public string Bytes { get { string str = "" ; for ( int i = 0; i < 8; i++) { str += input[i].ToString(); } return str; } } public string Weights { get { string str = "" ; for ( int i = 0; i < 8; i++) { str += weight[i].ToString(); str += " " ; } return str; } } public string Mx { get { return mx.ToString(); } } public string Sum { get { return sum.ToString(); } } } * This source code was highlighted with Source Code Highlighter .
public class Neuron { int [] input = new int [8]; // double [] weight = new double [8]; // double mx = 0; // double sum = 0; // int k = 1; // public Neuron() { for ( int i = 0; i < 8; i++) { weight[i] = 1; // // } } public byte Analyze( byte b) { for ( int i = 0; i < 8; i++) { input[i] = 0; } for ( int i = 0; i < 8; i++) // { if ((b / 2) != 0) { input[i] = b % 2; b = Convert .ToByte(b / 2); } else { input[i] = b % 2; break ; } } sum = 0; mx = weight.Sum() / 8; // for ( int i = 0; i < 8; i++) { if (weight[i] > 0) // sum += weight[i] * input[i]; } if (sum > mx) // return 1; else return 0; } public void Yes() // { double s = weight.Sum(); for ( int i = 0; i < 8; i++) { weight[i] += input[i] * (weight[i] / s) * k; } this .Normalize(); } public void No() // { double s = weight.Sum(); for ( int i = 0; i < 8; i++) { weight[i] -= input[i] * (weight[i] / s) * k; } this .Normalize(); } private void Normalize() // { // double min = weight.Min(); double max = weight.Max(); int pow = 0; double b = max / 10; while (b > 1) { b = b / 10; pow++; } for ( int i = 0; i < 8; i++) { weight[i] = weight[i] / Math .Pow(10, pow - 1); } } public void Reset() // { for ( int i = 0; i < 8; i++) { weight[i] = 1; } } // public string Bytes { get { string str = "" ; for ( int i = 0; i < 8; i++) { str += input[i].ToString(); } return str; } } public string Weights { get { string str = "" ; for ( int i = 0; i < 8; i++) { str += weight[i].ToString(); str += " " ; } return str; } } public string Mx { get { return mx.ToString(); } } public string Sum { get { return sum.ToString(); } } } * This source code was highlighted with Source Code Highlighter .
public class Neuron { int [] input = new int [8]; // double [] weight = new double [8]; // double mx = 0; // double sum = 0; // int k = 1; // public Neuron() { for ( int i = 0; i < 8; i++) { weight[i] = 1; // // } } public byte Analyze( byte b) { for ( int i = 0; i < 8; i++) { input[i] = 0; } for ( int i = 0; i < 8; i++) // { if ((b / 2) != 0) { input[i] = b % 2; b = Convert .ToByte(b / 2); } else { input[i] = b % 2; break ; } } sum = 0; mx = weight.Sum() / 8; // for ( int i = 0; i < 8; i++) { if (weight[i] > 0) // sum += weight[i] * input[i]; } if (sum > mx) // return 1; else return 0; } public void Yes() // { double s = weight.Sum(); for ( int i = 0; i < 8; i++) { weight[i] += input[i] * (weight[i] / s) * k; } this .Normalize(); } public void No() // { double s = weight.Sum(); for ( int i = 0; i < 8; i++) { weight[i] -= input[i] * (weight[i] / s) * k; } this .Normalize(); } private void Normalize() // { // double min = weight.Min(); double max = weight.Max(); int pow = 0; double b = max / 10; while (b > 1) { b = b / 10; pow++; } for ( int i = 0; i < 8; i++) { weight[i] = weight[i] / Math .Pow(10, pow - 1); } } public void Reset() // { for ( int i = 0; i < 8; i++) { weight[i] = 1; } } // public string Bytes { get { string str = "" ; for ( int i = 0; i < 8; i++) { str += input[i].ToString(); } return str; } } public string Weights { get { string str = "" ; for ( int i = 0; i < 8; i++) { str += weight[i].ToString(); str += " " ; } return str; } } public string Mx { get { return mx.ToString(); } } public string Sum { get { return sum.ToString(); } } } * This source code was highlighted with Source Code Highlighter .
public class Neuron { int [] input = new int [8]; // double [] weight = new double [8]; // double mx = 0; // double sum = 0; // int k = 1; // public Neuron() { for ( int i = 0; i < 8; i++) { weight[i] = 1; // // } } public byte Analyze( byte b) { for ( int i = 0; i < 8; i++) { input[i] = 0; } for ( int i = 0; i < 8; i++) // { if ((b / 2) != 0) { input[i] = b % 2; b = Convert .ToByte(b / 2); } else { input[i] = b % 2; break ; } } sum = 0; mx = weight.Sum() / 8; // for ( int i = 0; i < 8; i++) { if (weight[i] > 0) // sum += weight[i] * input[i]; } if (sum > mx) // return 1; else return 0; } public void Yes() // { double s = weight.Sum(); for ( int i = 0; i < 8; i++) { weight[i] += input[i] * (weight[i] / s) * k; } this .Normalize(); } public void No() // { double s = weight.Sum(); for ( int i = 0; i < 8; i++) { weight[i] -= input[i] * (weight[i] / s) * k; } this .Normalize(); } private void Normalize() // { // double min = weight.Min(); double max = weight.Max(); int pow = 0; double b = max / 10; while (b > 1) { b = b / 10; pow++; } for ( int i = 0; i < 8; i++) { weight[i] = weight[i] / Math .Pow(10, pow - 1); } } public void Reset() // { for ( int i = 0; i < 8; i++) { weight[i] = 1; } } // public string Bytes { get { string str = "" ; for ( int i = 0; i < 8; i++) { str += input[i].ToString(); } return str; } } public string Weights { get { string str = "" ; for ( int i = 0; i < 8; i++) { str += weight[i].ToString(); str += " " ; } return str; } } public string Mx { get { return mx.ToString(); } } public string Sum { get { return sum.ToString(); } } } * This source code was highlighted with Source Code Highlighter .
public class Neuron { int [] input = new int [8]; // double [] weight = new double [8]; // double mx = 0; // double sum = 0; // int k = 1; // public Neuron() { for ( int i = 0; i < 8; i++) { weight[i] = 1; // // } } public byte Analyze( byte b) { for ( int i = 0; i < 8; i++) { input[i] = 0; } for ( int i = 0; i < 8; i++) // { if ((b / 2) != 0) { input[i] = b % 2; b = Convert .ToByte(b / 2); } else { input[i] = b % 2; break ; } } sum = 0; mx = weight.Sum() / 8; // for ( int i = 0; i < 8; i++) { if (weight[i] > 0) // sum += weight[i] * input[i]; } if (sum > mx) // return 1; else return 0; } public void Yes() // { double s = weight.Sum(); for ( int i = 0; i < 8; i++) { weight[i] += input[i] * (weight[i] / s) * k; } this .Normalize(); } public void No() // { double s = weight.Sum(); for ( int i = 0; i < 8; i++) { weight[i] -= input[i] * (weight[i] / s) * k; } this .Normalize(); } private void Normalize() // { // double min = weight.Min(); double max = weight.Max(); int pow = 0; double b = max / 10; while (b > 1) { b = b / 10; pow++; } for ( int i = 0; i < 8; i++) { weight[i] = weight[i] / Math .Pow(10, pow - 1); } } public void Reset() // { for ( int i = 0; i < 8; i++) { weight[i] = 1; } } // public string Bytes { get { string str = "" ; for ( int i = 0; i < 8; i++) { str += input[i].ToString(); } return str; } } public string Weights { get { string str = "" ; for ( int i = 0; i < 8; i++) { str += weight[i].ToString(); str += " " ; } return str; } } public string Mx { get { return mx.ToString(); } } public string Sum { get { return sum.ToString(); } } } * This source code was highlighted with Source Code Highlighter .
public class Neuron { int [] input = new int [8]; // double [] weight = new double [8]; // double mx = 0; // double sum = 0; // int k = 1; // public Neuron() { for ( int i = 0; i < 8; i++) { weight[i] = 1; // // } } public byte Analyze( byte b) { for ( int i = 0; i < 8; i++) { input[i] = 0; } for ( int i = 0; i < 8; i++) // { if ((b / 2) != 0) { input[i] = b % 2; b = Convert .ToByte(b / 2); } else { input[i] = b % 2; break ; } } sum = 0; mx = weight.Sum() / 8; // for ( int i = 0; i < 8; i++) { if (weight[i] > 0) // sum += weight[i] * input[i]; } if (sum > mx) // return 1; else return 0; } public void Yes() // { double s = weight.Sum(); for ( int i = 0; i < 8; i++) { weight[i] += input[i] * (weight[i] / s) * k; } this .Normalize(); } public void No() // { double s = weight.Sum(); for ( int i = 0; i < 8; i++) { weight[i] -= input[i] * (weight[i] / s) * k; } this .Normalize(); } private void Normalize() // { // double min = weight.Min(); double max = weight.Max(); int pow = 0; double b = max / 10; while (b > 1) { b = b / 10; pow++; } for ( int i = 0; i < 8; i++) { weight[i] = weight[i] / Math .Pow(10, pow - 1); } } public void Reset() // { for ( int i = 0; i < 8; i++) { weight[i] = 1; } } // public string Bytes { get { string str = "" ; for ( int i = 0; i < 8; i++) { str += input[i].ToString(); } return str; } } public string Weights { get { string str = "" ; for ( int i = 0; i < 8; i++) { str += weight[i].ToString(); str += " " ; } return str; } } public string Mx { get { return mx.ToString(); } } public string Sum { get { return sum.ToString(); } } } * This source code was highlighted with Source Code Highlighter .
public class Neuron { int [] input = new int [8]; // double [] weight = new double [8]; // double mx = 0; // double sum = 0; // int k = 1; // public Neuron() { for ( int i = 0; i < 8; i++) { weight[i] = 1; // // } } public byte Analyze( byte b) { for ( int i = 0; i < 8; i++) { input[i] = 0; } for ( int i = 0; i < 8; i++) // { if ((b / 2) != 0) { input[i] = b % 2; b = Convert .ToByte(b / 2); } else { input[i] = b % 2; break ; } } sum = 0; mx = weight.Sum() / 8; // for ( int i = 0; i < 8; i++) { if (weight[i] > 0) // sum += weight[i] * input[i]; } if (sum > mx) // return 1; else return 0; } public void Yes() // { double s = weight.Sum(); for ( int i = 0; i < 8; i++) { weight[i] += input[i] * (weight[i] / s) * k; } this .Normalize(); } public void No() // { double s = weight.Sum(); for ( int i = 0; i < 8; i++) { weight[i] -= input[i] * (weight[i] / s) * k; } this .Normalize(); } private void Normalize() // { // double min = weight.Min(); double max = weight.Max(); int pow = 0; double b = max / 10; while (b > 1) { b = b / 10; pow++; } for ( int i = 0; i < 8; i++) { weight[i] = weight[i] / Math .Pow(10, pow - 1); } } public void Reset() // { for ( int i = 0; i < 8; i++) { weight[i] = 1; } } // public string Bytes { get { string str = "" ; for ( int i = 0; i < 8; i++) { str += input[i].ToString(); } return str; } } public string Weights { get { string str = "" ; for ( int i = 0; i < 8; i++) { str += weight[i].ToString(); str += " " ; } return str; } } public string Mx { get { return mx.ToString(); } } public string Sum { get { return sum.ToString(); } } } * This source code was highlighted with Source Code Highlighter .
public class Neuron { int [] input = new int [8]; // double [] weight = new double [8]; // double mx = 0; // double sum = 0; // int k = 1; // public Neuron() { for ( int i = 0; i < 8; i++) { weight[i] = 1; // // } } public byte Analyze( byte b) { for ( int i = 0; i < 8; i++) { input[i] = 0; } for ( int i = 0; i < 8; i++) // { if ((b / 2) != 0) { input[i] = b % 2; b = Convert .ToByte(b / 2); } else { input[i] = b % 2; break ; } } sum = 0; mx = weight.Sum() / 8; // for ( int i = 0; i < 8; i++) { if (weight[i] > 0) // sum += weight[i] * input[i]; } if (sum > mx) // return 1; else return 0; } public void Yes() // { double s = weight.Sum(); for ( int i = 0; i < 8; i++) { weight[i] += input[i] * (weight[i] / s) * k; } this .Normalize(); } public void No() // { double s = weight.Sum(); for ( int i = 0; i < 8; i++) { weight[i] -= input[i] * (weight[i] / s) * k; } this .Normalize(); } private void Normalize() // { // double min = weight.Min(); double max = weight.Max(); int pow = 0; double b = max / 10; while (b > 1) { b = b / 10; pow++; } for ( int i = 0; i < 8; i++) { weight[i] = weight[i] / Math .Pow(10, pow - 1); } } public void Reset() // { for ( int i = 0; i < 8; i++) { weight[i] = 1; } } // public string Bytes { get { string str = "" ; for ( int i = 0; i < 8; i++) { str += input[i].ToString(); } return str; } } public string Weights { get { string str = "" ; for ( int i = 0; i < 8; i++) { str += weight[i].ToString(); str += " " ; } return str; } } public string Mx { get { return mx.ToString(); } } public string Sum { get { return sum.ToString(); } } } * This source code was highlighted with Source Code Highlighter .
public class Neuron { int [] input = new int [8]; // double [] weight = new double [8]; // double mx = 0; // double sum = 0; // int k = 1; // public Neuron() { for ( int i = 0; i < 8; i++) { weight[i] = 1; // // } } public byte Analyze( byte b) { for ( int i = 0; i < 8; i++) { input[i] = 0; } for ( int i = 0; i < 8; i++) // { if ((b / 2) != 0) { input[i] = b % 2; b = Convert .ToByte(b / 2); } else { input[i] = b % 2; break ; } } sum = 0; mx = weight.Sum() / 8; // for ( int i = 0; i < 8; i++) { if (weight[i] > 0) // sum += weight[i] * input[i]; } if (sum > mx) // return 1; else return 0; } public void Yes() // { double s = weight.Sum(); for ( int i = 0; i < 8; i++) { weight[i] += input[i] * (weight[i] / s) * k; } this .Normalize(); } public void No() // { double s = weight.Sum(); for ( int i = 0; i < 8; i++) { weight[i] -= input[i] * (weight[i] / s) * k; } this .Normalize(); } private void Normalize() // { // double min = weight.Min(); double max = weight.Max(); int pow = 0; double b = max / 10; while (b > 1) { b = b / 10; pow++; } for ( int i = 0; i < 8; i++) { weight[i] = weight[i] / Math .Pow(10, pow - 1); } } public void Reset() // { for ( int i = 0; i < 8; i++) { weight[i] = 1; } } // public string Bytes { get { string str = "" ; for ( int i = 0; i < 8; i++) { str += input[i].ToString(); } return str; } } public string Weights { get { string str = "" ; for ( int i = 0; i < 8; i++) { str += weight[i].ToString(); str += " " ; } return str; } } public string Mx { get { return mx.ToString(); } } public string Sum { get { return sum.ToString(); } } } * This source code was highlighted with Source Code Highlighter .
public class Neuron { int [] input = new int [8]; // double [] weight = new double [8]; // double mx = 0; // double sum = 0; // int k = 1; // public Neuron() { for ( int i = 0; i < 8; i++) { weight[i] = 1; // // } } public byte Analyze( byte b) { for ( int i = 0; i < 8; i++) { input[i] = 0; } for ( int i = 0; i < 8; i++) // { if ((b / 2) != 0) { input[i] = b % 2; b = Convert .ToByte(b / 2); } else { input[i] = b % 2; break ; } } sum = 0; mx = weight.Sum() / 8; // for ( int i = 0; i < 8; i++) { if (weight[i] > 0) // sum += weight[i] * input[i]; } if (sum > mx) // return 1; else return 0; } public void Yes() // { double s = weight.Sum(); for ( int i = 0; i < 8; i++) { weight[i] += input[i] * (weight[i] / s) * k; } this .Normalize(); } public void No() // { double s = weight.Sum(); for ( int i = 0; i < 8; i++) { weight[i] -= input[i] * (weight[i] / s) * k; } this .Normalize(); } private void Normalize() // { // double min = weight.Min(); double max = weight.Max(); int pow = 0; double b = max / 10; while (b > 1) { b = b / 10; pow++; } for ( int i = 0; i < 8; i++) { weight[i] = weight[i] / Math .Pow(10, pow - 1); } } public void Reset() // { for ( int i = 0; i < 8; i++) { weight[i] = 1; } } // public string Bytes { get { string str = "" ; for ( int i = 0; i < 8; i++) { str += input[i].ToString(); } return str; } } public string Weights { get { string str = "" ; for ( int i = 0; i < 8; i++) { str += weight[i].ToString(); str += " " ; } return str; } } public string Mx { get { return mx.ToString(); } } public string Sum { get { return sum.ToString(); } } } * This source code was highlighted with Source Code Highlighter .
public class Neuron { int [] input = new int [8]; // double [] weight = new double [8]; // double mx = 0; // double sum = 0; // int k = 1; // public Neuron() { for ( int i = 0; i < 8; i++) { weight[i] = 1; // // } } public byte Analyze( byte b) { for ( int i = 0; i < 8; i++) { input[i] = 0; } for ( int i = 0; i < 8; i++) // { if ((b / 2) != 0) { input[i] = b % 2; b = Convert .ToByte(b / 2); } else { input[i] = b % 2; break ; } } sum = 0; mx = weight.Sum() / 8; // for ( int i = 0; i < 8; i++) { if (weight[i] > 0) // sum += weight[i] * input[i]; } if (sum > mx) // return 1; else return 0; } public void Yes() // { double s = weight.Sum(); for ( int i = 0; i < 8; i++) { weight[i] += input[i] * (weight[i] / s) * k; } this .Normalize(); } public void No() // { double s = weight.Sum(); for ( int i = 0; i < 8; i++) { weight[i] -= input[i] * (weight[i] / s) * k; } this .Normalize(); } private void Normalize() // { // double min = weight.Min(); double max = weight.Max(); int pow = 0; double b = max / 10; while (b > 1) { b = b / 10; pow++; } for ( int i = 0; i < 8; i++) { weight[i] = weight[i] / Math .Pow(10, pow - 1); } } public void Reset() // { for ( int i = 0; i < 8; i++) { weight[i] = 1; } } // public string Bytes { get { string str = "" ; for ( int i = 0; i < 8; i++) { str += input[i].ToString(); } return str; } } public string Weights { get { string str = "" ; for ( int i = 0; i < 8; i++) { str += weight[i].ToString(); str += " " ; } return str; } } public string Mx { get { return mx.ToString(); } } public string Sum { get { return sum.ToString(); } } } * This source code was highlighted with Source Code Highlighter .
public class Neuron { int [] input = new int [8]; // double [] weight = new double [8]; // double mx = 0; // double sum = 0; // int k = 1; // public Neuron() { for ( int i = 0; i < 8; i++) { weight[i] = 1; // // } } public byte Analyze( byte b) { for ( int i = 0; i < 8; i++) { input[i] = 0; } for ( int i = 0; i < 8; i++) // { if ((b / 2) != 0) { input[i] = b % 2; b = Convert .ToByte(b / 2); } else { input[i] = b % 2; break ; } } sum = 0; mx = weight.Sum() / 8; // for ( int i = 0; i < 8; i++) { if (weight[i] > 0) // sum += weight[i] * input[i]; } if (sum > mx) // return 1; else return 0; } public void Yes() // { double s = weight.Sum(); for ( int i = 0; i < 8; i++) { weight[i] += input[i] * (weight[i] / s) * k; } this .Normalize(); } public void No() // { double s = weight.Sum(); for ( int i = 0; i < 8; i++) { weight[i] -= input[i] * (weight[i] / s) * k; } this .Normalize(); } private void Normalize() // { // double min = weight.Min(); double max = weight.Max(); int pow = 0; double b = max / 10; while (b > 1) { b = b / 10; pow++; } for ( int i = 0; i < 8; i++) { weight[i] = weight[i] / Math .Pow(10, pow - 1); } } public void Reset() // { for ( int i = 0; i < 8; i++) { weight[i] = 1; } } // public string Bytes { get { string str = "" ; for ( int i = 0; i < 8; i++) { str += input[i].ToString(); } return str; } } public string Weights { get { string str = "" ; for ( int i = 0; i < 8; i++) { str += weight[i].ToString(); str += " " ; } return str; } } public string Mx { get { return mx.ToString(); } } public string Sum { get { return sum.ToString(); } } } * This source code was highlighted with Source Code Highlighter .
public class Neuron { int [] input = new int [8]; // double [] weight = new double [8]; // double mx = 0; // double sum = 0; // int k = 1; // public Neuron() { for ( int i = 0; i < 8; i++) { weight[i] = 1; // // } } public byte Analyze( byte b) { for ( int i = 0; i < 8; i++) { input[i] = 0; } for ( int i = 0; i < 8; i++) // { if ((b / 2) != 0) { input[i] = b % 2; b = Convert .ToByte(b / 2); } else { input[i] = b % 2; break ; } } sum = 0; mx = weight.Sum() / 8; // for ( int i = 0; i < 8; i++) { if (weight[i] > 0) // sum += weight[i] * input[i]; } if (sum > mx) // return 1; else return 0; } public void Yes() // { double s = weight.Sum(); for ( int i = 0; i < 8; i++) { weight[i] += input[i] * (weight[i] / s) * k; } this .Normalize(); } public void No() // { double s = weight.Sum(); for ( int i = 0; i < 8; i++) { weight[i] -= input[i] * (weight[i] / s) * k; } this .Normalize(); } private void Normalize() // { // double min = weight.Min(); double max = weight.Max(); int pow = 0; double b = max / 10; while (b > 1) { b = b / 10; pow++; } for ( int i = 0; i < 8; i++) { weight[i] = weight[i] / Math .Pow(10, pow - 1); } } public void Reset() // { for ( int i = 0; i < 8; i++) { weight[i] = 1; } } // public string Bytes { get { string str = "" ; for ( int i = 0; i < 8; i++) { str += input[i].ToString(); } return str; } } public string Weights { get { string str = "" ; for ( int i = 0; i < 8; i++) { str += weight[i].ToString(); str += " " ; } return str; } } public string Mx { get { return mx.ToString(); } } public string Sum { get { return sum.ToString(); } } } * This source code was highlighted with Source Code Highlighter .
public class Neuron { int [] input = new int [8]; // double [] weight = new double [8]; // double mx = 0; // double sum = 0; // int k = 1; // public Neuron() { for ( int i = 0; i < 8; i++) { weight[i] = 1; // // } } public byte Analyze( byte b) { for ( int i = 0; i < 8; i++) { input[i] = 0; } for ( int i = 0; i < 8; i++) // { if ((b / 2) != 0) { input[i] = b % 2; b = Convert .ToByte(b / 2); } else { input[i] = b % 2; break ; } } sum = 0; mx = weight.Sum() / 8; // for ( int i = 0; i < 8; i++) { if (weight[i] > 0) // sum += weight[i] * input[i]; } if (sum > mx) // return 1; else return 0; } public void Yes() // { double s = weight.Sum(); for ( int i = 0; i < 8; i++) { weight[i] += input[i] * (weight[i] / s) * k; } this .Normalize(); } public void No() // { double s = weight.Sum(); for ( int i = 0; i < 8; i++) { weight[i] -= input[i] * (weight[i] / s) * k; } this .Normalize(); } private void Normalize() // { // double min = weight.Min(); double max = weight.Max(); int pow = 0; double b = max / 10; while (b > 1) { b = b / 10; pow++; } for ( int i = 0; i < 8; i++) { weight[i] = weight[i] / Math .Pow(10, pow - 1); } } public void Reset() // { for ( int i = 0; i < 8; i++) { weight[i] = 1; } } // public string Bytes { get { string str = "" ; for ( int i = 0; i < 8; i++) { str += input[i].ToString(); } return str; } } public string Weights { get { string str = "" ; for ( int i = 0; i < 8; i++) { str += weight[i].ToString(); str += " " ; } return str; } } public string Mx { get { return mx.ToString(); } } public string Sum { get { return sum.ToString(); } } } * This source code was highlighted with Source Code Highlighter .
public class Neuron { int [] input = new int [8]; // double [] weight = new double [8]; // double mx = 0; // double sum = 0; // int k = 1; // public Neuron() { for ( int i = 0; i < 8; i++) { weight[i] = 1; // // } } public byte Analyze( byte b) { for ( int i = 0; i < 8; i++) { input[i] = 0; } for ( int i = 0; i < 8; i++) // { if ((b / 2) != 0) { input[i] = b % 2; b = Convert .ToByte(b / 2); } else { input[i] = b % 2; break ; } } sum = 0; mx = weight.Sum() / 8; // for ( int i = 0; i < 8; i++) { if (weight[i] > 0) // sum += weight[i] * input[i]; } if (sum > mx) // return 1; else return 0; } public void Yes() // { double s = weight.Sum(); for ( int i = 0; i < 8; i++) { weight[i] += input[i] * (weight[i] / s) * k; } this .Normalize(); } public void No() // { double s = weight.Sum(); for ( int i = 0; i < 8; i++) { weight[i] -= input[i] * (weight[i] / s) * k; } this .Normalize(); } private void Normalize() // { // double min = weight.Min(); double max = weight.Max(); int pow = 0; double b = max / 10; while (b > 1) { b = b / 10; pow++; } for ( int i = 0; i < 8; i++) { weight[i] = weight[i] / Math .Pow(10, pow - 1); } } public void Reset() // { for ( int i = 0; i < 8; i++) { weight[i] = 1; } } // public string Bytes { get { string str = "" ; for ( int i = 0; i < 8; i++) { str += input[i].ToString(); } return str; } } public string Weights { get { string str = "" ; for ( int i = 0; i < 8; i++) { str += weight[i].ToString(); str += " " ; } return str; } } public string Mx { get { return mx.ToString(); } } public string Sum { get { return sum.ToString(); } } } * This source code was highlighted with Source Code Highlighter .
public class Neuron { int [] input = new int [8]; // double [] weight = new double [8]; // double mx = 0; // double sum = 0; // int k = 1; // public Neuron() { for ( int i = 0; i < 8; i++) { weight[i] = 1; // // } } public byte Analyze( byte b) { for ( int i = 0; i < 8; i++) { input[i] = 0; } for ( int i = 0; i < 8; i++) // { if ((b / 2) != 0) { input[i] = b % 2; b = Convert .ToByte(b / 2); } else { input[i] = b % 2; break ; } } sum = 0; mx = weight.Sum() / 8; // for ( int i = 0; i < 8; i++) { if (weight[i] > 0) // sum += weight[i] * input[i]; } if (sum > mx) // return 1; else return 0; } public void Yes() // { double s = weight.Sum(); for ( int i = 0; i < 8; i++) { weight[i] += input[i] * (weight[i] / s) * k; } this .Normalize(); } public void No() // { double s = weight.Sum(); for ( int i = 0; i < 8; i++) { weight[i] -= input[i] * (weight[i] / s) * k; } this .Normalize(); } private void Normalize() // { // double min = weight.Min(); double max = weight.Max(); int pow = 0; double b = max / 10; while (b > 1) { b = b / 10; pow++; } for ( int i = 0; i < 8; i++) { weight[i] = weight[i] / Math .Pow(10, pow - 1); } } public void Reset() // { for ( int i = 0; i < 8; i++) { weight[i] = 1; } } // public string Bytes { get { string str = "" ; for ( int i = 0; i < 8; i++) { str += input[i].ToString(); } return str; } } public string Weights { get { string str = "" ; for ( int i = 0; i < 8; i++) { str += weight[i].ToString(); str += " " ; } return str; } } public string Mx { get { return mx.ToString(); } } public string Sum { get { return sum.ToString(); } } } * This source code was highlighted with Source Code Highlighter .
public class Neuron { int [] input = new int [8]; // double [] weight = new double [8]; // double mx = 0; // double sum = 0; // int k = 1; // public Neuron() { for ( int i = 0; i < 8; i++) { weight[i] = 1; // // } } public byte Analyze( byte b) { for ( int i = 0; i < 8; i++) { input[i] = 0; } for ( int i = 0; i < 8; i++) // { if ((b / 2) != 0) { input[i] = b % 2; b = Convert .ToByte(b / 2); } else { input[i] = b % 2; break ; } } sum = 0; mx = weight.Sum() / 8; // for ( int i = 0; i < 8; i++) { if (weight[i] > 0) // sum += weight[i] * input[i]; } if (sum > mx) // return 1; else return 0; } public void Yes() // { double s = weight.Sum(); for ( int i = 0; i < 8; i++) { weight[i] += input[i] * (weight[i] / s) * k; } this .Normalize(); } public void No() // { double s = weight.Sum(); for ( int i = 0; i < 8; i++) { weight[i] -= input[i] * (weight[i] / s) * k; } this .Normalize(); } private void Normalize() // { // double min = weight.Min(); double max = weight.Max(); int pow = 0; double b = max / 10; while (b > 1) { b = b / 10; pow++; } for ( int i = 0; i < 8; i++) { weight[i] = weight[i] / Math .Pow(10, pow - 1); } } public void Reset() // { for ( int i = 0; i < 8; i++) { weight[i] = 1; } } // public string Bytes { get { string str = "" ; for ( int i = 0; i < 8; i++) { str += input[i].ToString(); } return str; } } public string Weights { get { string str = "" ; for ( int i = 0; i < 8; i++) { str += weight[i].ToString(); str += " " ; } return str; } } public string Mx { get { return mx.ToString(); } } public string Sum { get { return sum.ToString(); } } } * This source code was highlighted with Source Code Highlighter .
public class Neuron { int [] input = new int [8]; // double [] weight = new double [8]; // double mx = 0; // double sum = 0; // int k = 1; // public Neuron() { for ( int i = 0; i < 8; i++) { weight[i] = 1; // // } } public byte Analyze( byte b) { for ( int i = 0; i < 8; i++) { input[i] = 0; } for ( int i = 0; i < 8; i++) // { if ((b / 2) != 0) { input[i] = b % 2; b = Convert .ToByte(b / 2); } else { input[i] = b % 2; break ; } } sum = 0; mx = weight.Sum() / 8; // for ( int i = 0; i < 8; i++) { if (weight[i] > 0) // sum += weight[i] * input[i]; } if (sum > mx) // return 1; else return 0; } public void Yes() // { double s = weight.Sum(); for ( int i = 0; i < 8; i++) { weight[i] += input[i] * (weight[i] / s) * k; } this .Normalize(); } public void No() // { double s = weight.Sum(); for ( int i = 0; i < 8; i++) { weight[i] -= input[i] * (weight[i] / s) * k; } this .Normalize(); } private void Normalize() // { // double min = weight.Min(); double max = weight.Max(); int pow = 0; double b = max / 10; while (b > 1) { b = b / 10; pow++; } for ( int i = 0; i < 8; i++) { weight[i] = weight[i] / Math .Pow(10, pow - 1); } } public void Reset() // { for ( int i = 0; i < 8; i++) { weight[i] = 1; } } // public string Bytes { get { string str = "" ; for ( int i = 0; i < 8; i++) { str += input[i].ToString(); } return str; } } public string Weights { get { string str = "" ; for ( int i = 0; i < 8; i++) { str += weight[i].ToString(); str += " " ; } return str; } } public string Mx { get { return mx.ToString(); } } public string Sum { get { return sum.ToString(); } } } * This source code was highlighted with Source Code Highlighter .
public class Neuron { int [] input = new int [8]; // double [] weight = new double [8]; // double mx = 0; // double sum = 0; // int k = 1; // public Neuron() { for ( int i = 0; i < 8; i++) { weight[i] = 1; // // } } public byte Analyze( byte b) { for ( int i = 0; i < 8; i++) { input[i] = 0; } for ( int i = 0; i < 8; i++) // { if ((b / 2) != 0) { input[i] = b % 2; b = Convert .ToByte(b / 2); } else { input[i] = b % 2; break ; } } sum = 0; mx = weight.Sum() / 8; // for ( int i = 0; i < 8; i++) { if (weight[i] > 0) // sum += weight[i] * input[i]; } if (sum > mx) // return 1; else return 0; } public void Yes() // { double s = weight.Sum(); for ( int i = 0; i < 8; i++) { weight[i] += input[i] * (weight[i] / s) * k; } this .Normalize(); } public void No() // { double s = weight.Sum(); for ( int i = 0; i < 8; i++) { weight[i] -= input[i] * (weight[i] / s) * k; } this .Normalize(); } private void Normalize() // { // double min = weight.Min(); double max = weight.Max(); int pow = 0; double b = max / 10; while (b > 1) { b = b / 10; pow++; } for ( int i = 0; i < 8; i++) { weight[i] = weight[i] / Math .Pow(10, pow - 1); } } public void Reset() // { for ( int i = 0; i < 8; i++) { weight[i] = 1; } } // public string Bytes { get { string str = "" ; for ( int i = 0; i < 8; i++) { str += input[i].ToString(); } return str; } } public string Weights { get { string str = "" ; for ( int i = 0; i < 8; i++) { str += weight[i].ToString(); str += " " ; } return str; } } public string Mx { get { return mx.ToString(); } } public string Sum { get { return sum.ToString(); } } } * This source code was highlighted with Source Code Highlighter .
public class Neuron { int [] input = new int [8]; // double [] weight = new double [8]; // double mx = 0; // double sum = 0; // int k = 1; // public Neuron() { for ( int i = 0; i < 8; i++) { weight[i] = 1; // // } } public byte Analyze( byte b) { for ( int i = 0; i < 8; i++) { input[i] = 0; } for ( int i = 0; i < 8; i++) // { if ((b / 2) != 0) { input[i] = b % 2; b = Convert .ToByte(b / 2); } else { input[i] = b % 2; break ; } } sum = 0; mx = weight.Sum() / 8; // for ( int i = 0; i < 8; i++) { if (weight[i] > 0) // sum += weight[i] * input[i]; } if (sum > mx) // return 1; else return 0; } public void Yes() // { double s = weight.Sum(); for ( int i = 0; i < 8; i++) { weight[i] += input[i] * (weight[i] / s) * k; } this .Normalize(); } public void No() // { double s = weight.Sum(); for ( int i = 0; i < 8; i++) { weight[i] -= input[i] * (weight[i] / s) * k; } this .Normalize(); } private void Normalize() // { // double min = weight.Min(); double max = weight.Max(); int pow = 0; double b = max / 10; while (b > 1) { b = b / 10; pow++; } for ( int i = 0; i < 8; i++) { weight[i] = weight[i] / Math .Pow(10, pow - 1); } } public void Reset() // { for ( int i = 0; i < 8; i++) { weight[i] = 1; } } // public string Bytes { get { string str = "" ; for ( int i = 0; i < 8; i++) { str += input[i].ToString(); } return str; } } public string Weights { get { string str = "" ; for ( int i = 0; i < 8; i++) { str += weight[i].ToString(); str += " " ; } return str; } } public string Mx { get { return mx.ToString(); } } public string Sum { get { return sum.ToString(); } } } * This source code was highlighted with Source Code Highlighter .
public class Neuron { int [] input = new int [8]; // double [] weight = new double [8]; // double mx = 0; // double sum = 0; // int k = 1; // public Neuron() { for ( int i = 0; i < 8; i++) { weight[i] = 1; // // } } public byte Analyze( byte b) { for ( int i = 0; i < 8; i++) { input[i] = 0; } for ( int i = 0; i < 8; i++) // { if ((b / 2) != 0) { input[i] = b % 2; b = Convert .ToByte(b / 2); } else { input[i] = b % 2; break ; } } sum = 0; mx = weight.Sum() / 8; // for ( int i = 0; i < 8; i++) { if (weight[i] > 0) // sum += weight[i] * input[i]; } if (sum > mx) // return 1; else return 0; } public void Yes() // { double s = weight.Sum(); for ( int i = 0; i < 8; i++) { weight[i] += input[i] * (weight[i] / s) * k; } this .Normalize(); } public void No() // { double s = weight.Sum(); for ( int i = 0; i < 8; i++) { weight[i] -= input[i] * (weight[i] / s) * k; } this .Normalize(); } private void Normalize() // { // double min = weight.Min(); double max = weight.Max(); int pow = 0; double b = max / 10; while (b > 1) { b = b / 10; pow++; } for ( int i = 0; i < 8; i++) { weight[i] = weight[i] / Math .Pow(10, pow - 1); } } public void Reset() // { for ( int i = 0; i < 8; i++) { weight[i] = 1; } } // public string Bytes { get { string str = "" ; for ( int i = 0; i < 8; i++) { str += input[i].ToString(); } return str; } } public string Weights { get { string str = "" ; for ( int i = 0; i < 8; i++) { str += weight[i].ToString(); str += " " ; } return str; } } public string Mx { get { return mx.ToString(); } } public string Sum { get { return sum.ToString(); } } } * This source code was highlighted with Source Code Highlighter .
public class Neuron { int [] input = new int [8]; // double [] weight = new double [8]; // double mx = 0; // double sum = 0; // int k = 1; // public Neuron() { for ( int i = 0; i < 8; i++) { weight[i] = 1; // // } } public byte Analyze( byte b) { for ( int i = 0; i < 8; i++) { input[i] = 0; } for ( int i = 0; i < 8; i++) // { if ((b / 2) != 0) { input[i] = b % 2; b = Convert .ToByte(b / 2); } else { input[i] = b % 2; break ; } } sum = 0; mx = weight.Sum() / 8; // for ( int i = 0; i < 8; i++) { if (weight[i] > 0) // sum += weight[i] * input[i]; } if (sum > mx) // return 1; else return 0; } public void Yes() // { double s = weight.Sum(); for ( int i = 0; i < 8; i++) { weight[i] += input[i] * (weight[i] / s) * k; } this .Normalize(); } public void No() // { double s = weight.Sum(); for ( int i = 0; i < 8; i++) { weight[i] -= input[i] * (weight[i] / s) * k; } this .Normalize(); } private void Normalize() // { // double min = weight.Min(); double max = weight.Max(); int pow = 0; double b = max / 10; while (b > 1) { b = b / 10; pow++; } for ( int i = 0; i < 8; i++) { weight[i] = weight[i] / Math .Pow(10, pow - 1); } } public void Reset() // { for ( int i = 0; i < 8; i++) { weight[i] = 1; } } // public string Bytes { get { string str = "" ; for ( int i = 0; i < 8; i++) { str += input[i].ToString(); } return str; } } public string Weights { get { string str = "" ; for ( int i = 0; i < 8; i++) { str += weight[i].ToString(); str += " " ; } return str; } } public string Mx { get { return mx.ToString(); } } public string Sum { get { return sum.ToString(); } } } * This source code was highlighted with Source Code Highlighter .
public class Neuron { int [] input = new int [8]; // double [] weight = new double [8]; // double mx = 0; // double sum = 0; // int k = 1; // public Neuron() { for ( int i = 0; i < 8; i++) { weight[i] = 1; // // } } public byte Analyze( byte b) { for ( int i = 0; i < 8; i++) { input[i] = 0; } for ( int i = 0; i < 8; i++) // { if ((b / 2) != 0) { input[i] = b % 2; b = Convert .ToByte(b / 2); } else { input[i] = b % 2; break ; } } sum = 0; mx = weight.Sum() / 8; // for ( int i = 0; i < 8; i++) { if (weight[i] > 0) // sum += weight[i] * input[i]; } if (sum > mx) // return 1; else return 0; } public void Yes() // { double s = weight.Sum(); for ( int i = 0; i < 8; i++) { weight[i] += input[i] * (weight[i] / s) * k; } this .Normalize(); } public void No() // { double s = weight.Sum(); for ( int i = 0; i < 8; i++) { weight[i] -= input[i] * (weight[i] / s) * k; } this .Normalize(); } private void Normalize() // { // double min = weight.Min(); double max = weight.Max(); int pow = 0; double b = max / 10; while (b > 1) { b = b / 10; pow++; } for ( int i = 0; i < 8; i++) { weight[i] = weight[i] / Math .Pow(10, pow - 1); } } public void Reset() // { for ( int i = 0; i < 8; i++) { weight[i] = 1; } } // public string Bytes { get { string str = "" ; for ( int i = 0; i < 8; i++) { str += input[i].ToString(); } return str; } } public string Weights { get { string str = "" ; for ( int i = 0; i < 8; i++) { str += weight[i].ToString(); str += " " ; } return str; } } public string Mx { get { return mx.ToString(); } } public string Sum { get { return sum.ToString(); } } } * This source code was highlighted with Source Code Highlighter .
public class Neuron { int [] input = new int [8]; // double [] weight = new double [8]; // double mx = 0; // double sum = 0; // int k = 1; // public Neuron() { for ( int i = 0; i < 8; i++) { weight[i] = 1; // // } } public byte Analyze( byte b) { for ( int i = 0; i < 8; i++) { input[i] = 0; } for ( int i = 0; i < 8; i++) // { if ((b / 2) != 0) { input[i] = b % 2; b = Convert .ToByte(b / 2); } else { input[i] = b % 2; break ; } } sum = 0; mx = weight.Sum() / 8; // for ( int i = 0; i < 8; i++) { if (weight[i] > 0) // sum += weight[i] * input[i]; } if (sum > mx) // return 1; else return 0; } public void Yes() // { double s = weight.Sum(); for ( int i = 0; i < 8; i++) { weight[i] += input[i] * (weight[i] / s) * k; } this .Normalize(); } public void No() // { double s = weight.Sum(); for ( int i = 0; i < 8; i++) { weight[i] -= input[i] * (weight[i] / s) * k; } this .Normalize(); } private void Normalize() // { // double min = weight.Min(); double max = weight.Max(); int pow = 0; double b = max / 10; while (b > 1) { b = b / 10; pow++; } for ( int i = 0; i < 8; i++) { weight[i] = weight[i] / Math .Pow(10, pow - 1); } } public void Reset() // { for ( int i = 0; i < 8; i++) { weight[i] = 1; } } // public string Bytes { get { string str = "" ; for ( int i = 0; i < 8; i++) { str += input[i].ToString(); } return str; } } public string Weights { get { string str = "" ; for ( int i = 0; i < 8; i++) { str += weight[i].ToString(); str += " " ; } return str; } } public string Mx { get { return mx.ToString(); } } public string Sum { get { return sum.ToString(); } } } * This source code was highlighted with Source Code Highlighter .
public class Neuron { int [] input = new int [8]; // double [] weight = new double [8]; // double mx = 0; // double sum = 0; // int k = 1; // public Neuron() { for ( int i = 0; i < 8; i++) { weight[i] = 1; // // } } public byte Analyze( byte b) { for ( int i = 0; i < 8; i++) { input[i] = 0; } for ( int i = 0; i < 8; i++) // { if ((b / 2) != 0) { input[i] = b % 2; b = Convert .ToByte(b / 2); } else { input[i] = b % 2; break ; } } sum = 0; mx = weight.Sum() / 8; // for ( int i = 0; i < 8; i++) { if (weight[i] > 0) // sum += weight[i] * input[i]; } if (sum > mx) // return 1; else return 0; } public void Yes() // { double s = weight.Sum(); for ( int i = 0; i < 8; i++) { weight[i] += input[i] * (weight[i] / s) * k; } this .Normalize(); } public void No() // { double s = weight.Sum(); for ( int i = 0; i < 8; i++) { weight[i] -= input[i] * (weight[i] / s) * k; } this .Normalize(); } private void Normalize() // { // double min = weight.Min(); double max = weight.Max(); int pow = 0; double b = max / 10; while (b > 1) { b = b / 10; pow++; } for ( int i = 0; i < 8; i++) { weight[i] = weight[i] / Math .Pow(10, pow - 1); } } public void Reset() // { for ( int i = 0; i < 8; i++) { weight[i] = 1; } } // public string Bytes { get { string str = "" ; for ( int i = 0; i < 8; i++) { str += input[i].ToString(); } return str; } } public string Weights { get { string str = "" ; for ( int i = 0; i < 8; i++) { str += weight[i].ToString(); str += " " ; } return str; } } public string Mx { get { return mx.ToString(); } } public string Sum { get { return sum.ToString(); } } } * This source code was highlighted with Source Code Highlighter .
public class Neuron { int [] input = new int [8]; // double [] weight = new double [8]; // double mx = 0; // double sum = 0; // int k = 1; // public Neuron() { for ( int i = 0; i < 8; i++) { weight[i] = 1; // // } } public byte Analyze( byte b) { for ( int i = 0; i < 8; i++) { input[i] = 0; } for ( int i = 0; i < 8; i++) // { if ((b / 2) != 0) { input[i] = b % 2; b = Convert .ToByte(b / 2); } else { input[i] = b % 2; break ; } } sum = 0; mx = weight.Sum() / 8; // for ( int i = 0; i < 8; i++) { if (weight[i] > 0) // sum += weight[i] * input[i]; } if (sum > mx) // return 1; else return 0; } public void Yes() // { double s = weight.Sum(); for ( int i = 0; i < 8; i++) { weight[i] += input[i] * (weight[i] / s) * k; } this .Normalize(); } public void No() // { double s = weight.Sum(); for ( int i = 0; i < 8; i++) { weight[i] -= input[i] * (weight[i] / s) * k; } this .Normalize(); } private void Normalize() // { // double min = weight.Min(); double max = weight.Max(); int pow = 0; double b = max / 10; while (b > 1) { b = b / 10; pow++; } for ( int i = 0; i < 8; i++) { weight[i] = weight[i] / Math .Pow(10, pow - 1); } } public void Reset() // { for ( int i = 0; i < 8; i++) { weight[i] = 1; } } // public string Bytes { get { string str = "" ; for ( int i = 0; i < 8; i++) { str += input[i].ToString(); } return str; } } public string Weights { get { string str = "" ; for ( int i = 0; i < 8; i++) { str += weight[i].ToString(); str += " " ; } return str; } } public string Mx { get { return mx.ToString(); } } public string Sum { get { return sum.ToString(); } } } * This source code was highlighted with Source Code Highlighter .
public class Neuron { int [] input = new int [8]; // double [] weight = new double [8]; // double mx = 0; // double sum = 0; // int k = 1; // public Neuron() { for ( int i = 0; i < 8; i++) { weight[i] = 1; // // } } public byte Analyze( byte b) { for ( int i = 0; i < 8; i++) { input[i] = 0; } for ( int i = 0; i < 8; i++) // { if ((b / 2) != 0) { input[i] = b % 2; b = Convert .ToByte(b / 2); } else { input[i] = b % 2; break ; } } sum = 0; mx = weight.Sum() / 8; // for ( int i = 0; i < 8; i++) { if (weight[i] > 0) // sum += weight[i] * input[i]; } if (sum > mx) // return 1; else return 0; } public void Yes() // { double s = weight.Sum(); for ( int i = 0; i < 8; i++) { weight[i] += input[i] * (weight[i] / s) * k; } this .Normalize(); } public void No() // { double s = weight.Sum(); for ( int i = 0; i < 8; i++) { weight[i] -= input[i] * (weight[i] / s) * k; } this .Normalize(); } private void Normalize() // { // double min = weight.Min(); double max = weight.Max(); int pow = 0; double b = max / 10; while (b > 1) { b = b / 10; pow++; } for ( int i = 0; i < 8; i++) { weight[i] = weight[i] / Math .Pow(10, pow - 1); } } public void Reset() // { for ( int i = 0; i < 8; i++) { weight[i] = 1; } } // public string Bytes { get { string str = "" ; for ( int i = 0; i < 8; i++) { str += input[i].ToString(); } return str; } } public string Weights { get { string str = "" ; for ( int i = 0; i < 8; i++) { str += weight[i].ToString(); str += " " ; } return str; } } public string Mx { get { return mx.ToString(); } } public string Sum { get { return sum.ToString(); } } } * This source code was highlighted with Source Code Highlighter .
public class Neuron { int [] input = new int [8]; // double [] weight = new double [8]; // double mx = 0; // double sum = 0; // int k = 1; // public Neuron() { for ( int i = 0; i < 8; i++) { weight[i] = 1; // // } } public byte Analyze( byte b) { for ( int i = 0; i < 8; i++) { input[i] = 0; } for ( int i = 0; i < 8; i++) // { if ((b / 2) != 0) { input[i] = b % 2; b = Convert .ToByte(b / 2); } else { input[i] = b % 2; break ; } } sum = 0; mx = weight.Sum() / 8; // for ( int i = 0; i < 8; i++) { if (weight[i] > 0) // sum += weight[i] * input[i]; } if (sum > mx) // return 1; else return 0; } public void Yes() // { double s = weight.Sum(); for ( int i = 0; i < 8; i++) { weight[i] += input[i] * (weight[i] / s) * k; } this .Normalize(); } public void No() // { double s = weight.Sum(); for ( int i = 0; i < 8; i++) { weight[i] -= input[i] * (weight[i] / s) * k; } this .Normalize(); } private void Normalize() // { // double min = weight.Min(); double max = weight.Max(); int pow = 0; double b = max / 10; while (b > 1) { b = b / 10; pow++; } for ( int i = 0; i < 8; i++) { weight[i] = weight[i] / Math .Pow(10, pow - 1); } } public void Reset() // { for ( int i = 0; i < 8; i++) { weight[i] = 1; } } // public string Bytes { get { string str = "" ; for ( int i = 0; i < 8; i++) { str += input[i].ToString(); } return str; } } public string Weights { get { string str = "" ; for ( int i = 0; i < 8; i++) { str += weight[i].ToString(); str += " " ; } return str; } } public string Mx { get { return mx.ToString(); } } public string Sum { get { return sum.ToString(); } } } * This source code was highlighted with Source Code Highlighter .
public class Neuron { int [] input = new int [8]; // double [] weight = new double [8]; // double mx = 0; // double sum = 0; // int k = 1; // public Neuron() { for ( int i = 0; i < 8; i++) { weight[i] = 1; // // } } public byte Analyze( byte b) { for ( int i = 0; i < 8; i++) { input[i] = 0; } for ( int i = 0; i < 8; i++) // { if ((b / 2) != 0) { input[i] = b % 2; b = Convert .ToByte(b / 2); } else { input[i] = b % 2; break ; } } sum = 0; mx = weight.Sum() / 8; // for ( int i = 0; i < 8; i++) { if (weight[i] > 0) // sum += weight[i] * input[i]; } if (sum > mx) // return 1; else return 0; } public void Yes() // { double s = weight.Sum(); for ( int i = 0; i < 8; i++) { weight[i] += input[i] * (weight[i] / s) * k; } this .Normalize(); } public void No() // { double s = weight.Sum(); for ( int i = 0; i < 8; i++) { weight[i] -= input[i] * (weight[i] / s) * k; } this .Normalize(); } private void Normalize() // { // double min = weight.Min(); double max = weight.Max(); int pow = 0; double b = max / 10; while (b > 1) { b = b / 10; pow++; } for ( int i = 0; i < 8; i++) { weight[i] = weight[i] / Math .Pow(10, pow - 1); } } public void Reset() // { for ( int i = 0; i < 8; i++) { weight[i] = 1; } } // public string Bytes { get { string str = "" ; for ( int i = 0; i < 8; i++) { str += input[i].ToString(); } return str; } } public string Weights { get { string str = "" ; for ( int i = 0; i < 8; i++) { str += weight[i].ToString(); str += " " ; } return str; } } public string Mx { get { return mx.ToString(); } } public string Sum { get { return sum.ToString(); } } } * This source code was highlighted with Source Code Highlighter .
public class Neuron { int [] input = new int [8]; // double [] weight = new double [8]; // double mx = 0; // double sum = 0; // int k = 1; // public Neuron() { for ( int i = 0; i < 8; i++) { weight[i] = 1; // // } } public byte Analyze( byte b) { for ( int i = 0; i < 8; i++) { input[i] = 0; } for ( int i = 0; i < 8; i++) // { if ((b / 2) != 0) { input[i] = b % 2; b = Convert .ToByte(b / 2); } else { input[i] = b % 2; break ; } } sum = 0; mx = weight.Sum() / 8; // for ( int i = 0; i < 8; i++) { if (weight[i] > 0) // sum += weight[i] * input[i]; } if (sum > mx) // return 1; else return 0; } public void Yes() // { double s = weight.Sum(); for ( int i = 0; i < 8; i++) { weight[i] += input[i] * (weight[i] / s) * k; } this .Normalize(); } public void No() // { double s = weight.Sum(); for ( int i = 0; i < 8; i++) { weight[i] -= input[i] * (weight[i] / s) * k; } this .Normalize(); } private void Normalize() // { // double min = weight.Min(); double max = weight.Max(); int pow = 0; double b = max / 10; while (b > 1) { b = b / 10; pow++; } for ( int i = 0; i < 8; i++) { weight[i] = weight[i] / Math .Pow(10, pow - 1); } } public void Reset() // { for ( int i = 0; i < 8; i++) { weight[i] = 1; } } // public string Bytes { get { string str = "" ; for ( int i = 0; i < 8; i++) { str += input[i].ToString(); } return str; } } public string Weights { get { string str = "" ; for ( int i = 0; i < 8; i++) { str += weight[i].ToString(); str += " " ; } return str; } } public string Mx { get { return mx.ToString(); } } public string Sum { get { return sum.ToString(); } } } * This source code was highlighted with Source Code Highlighter .
public class Neuron { int [] input = new int [8]; // double [] weight = new double [8]; // double mx = 0; // double sum = 0; // int k = 1; // public Neuron() { for ( int i = 0; i < 8; i++) { weight[i] = 1; // // } } public byte Analyze( byte b) { for ( int i = 0; i < 8; i++) { input[i] = 0; } for ( int i = 0; i < 8; i++) // { if ((b / 2) != 0) { input[i] = b % 2; b = Convert .ToByte(b / 2); } else { input[i] = b % 2; break ; } } sum = 0; mx = weight.Sum() / 8; // for ( int i = 0; i < 8; i++) { if (weight[i] > 0) // sum += weight[i] * input[i]; } if (sum > mx) // return 1; else return 0; } public void Yes() // { double s = weight.Sum(); for ( int i = 0; i < 8; i++) { weight[i] += input[i] * (weight[i] / s) * k; } this .Normalize(); } public void No() // { double s = weight.Sum(); for ( int i = 0; i < 8; i++) { weight[i] -= input[i] * (weight[i] / s) * k; } this .Normalize(); } private void Normalize() // { // double min = weight.Min(); double max = weight.Max(); int pow = 0; double b = max / 10; while (b > 1) { b = b / 10; pow++; } for ( int i = 0; i < 8; i++) { weight[i] = weight[i] / Math .Pow(10, pow - 1); } } public void Reset() // { for ( int i = 0; i < 8; i++) { weight[i] = 1; } } // public string Bytes { get { string str = "" ; for ( int i = 0; i < 8; i++) { str += input[i].ToString(); } return str; } } public string Weights { get { string str = "" ; for ( int i = 0; i < 8; i++) { str += weight[i].ToString(); str += " " ; } return str; } } public string Mx { get { return mx.ToString(); } } public string Sum { get { return sum.ToString(); } } } * This source code was highlighted with Source Code Highlighter .
public class Neuron { int [] input = new int [8]; // double [] weight = new double [8]; // double mx = 0; // double sum = 0; // int k = 1; // public Neuron() { for ( int i = 0; i < 8; i++) { weight[i] = 1; // // } } public byte Analyze( byte b) { for ( int i = 0; i < 8; i++) { input[i] = 0; } for ( int i = 0; i < 8; i++) // { if ((b / 2) != 0) { input[i] = b % 2; b = Convert .ToByte(b / 2); } else { input[i] = b % 2; break ; } } sum = 0; mx = weight.Sum() / 8; // for ( int i = 0; i < 8; i++) { if (weight[i] > 0) // sum += weight[i] * input[i]; } if (sum > mx) // return 1; else return 0; } public void Yes() // { double s = weight.Sum(); for ( int i = 0; i < 8; i++) { weight[i] += input[i] * (weight[i] / s) * k; } this .Normalize(); } public void No() // { double s = weight.Sum(); for ( int i = 0; i < 8; i++) { weight[i] -= input[i] * (weight[i] / s) * k; } this .Normalize(); } private void Normalize() // { // double min = weight.Min(); double max = weight.Max(); int pow = 0; double b = max / 10; while (b > 1) { b = b / 10; pow++; } for ( int i = 0; i < 8; i++) { weight[i] = weight[i] / Math .Pow(10, pow - 1); } } public void Reset() // { for ( int i = 0; i < 8; i++) { weight[i] = 1; } } // public string Bytes { get { string str = "" ; for ( int i = 0; i < 8; i++) { str += input[i].ToString(); } return str; } } public string Weights { get { string str = "" ; for ( int i = 0; i < 8; i++) { str += weight[i].ToString(); str += " " ; } return str; } } public string Mx { get { return mx.ToString(); } } public string Sum { get { return sum.ToString(); } } } * This source code was highlighted with Source Code Highlighter .
public class Neuron { int [] input = new int [8]; // double [] weight = new double [8]; // double mx = 0; // double sum = 0; // int k = 1; // public Neuron() { for ( int i = 0; i < 8; i++) { weight[i] = 1; // // } } public byte Analyze( byte b) { for ( int i = 0; i < 8; i++) { input[i] = 0; } for ( int i = 0; i < 8; i++) // { if ((b / 2) != 0) { input[i] = b % 2; b = Convert .ToByte(b / 2); } else { input[i] = b % 2; break ; } } sum = 0; mx = weight.Sum() / 8; // for ( int i = 0; i < 8; i++) { if (weight[i] > 0) // sum += weight[i] * input[i]; } if (sum > mx) // return 1; else return 0; } public void Yes() // { double s = weight.Sum(); for ( int i = 0; i < 8; i++) { weight[i] += input[i] * (weight[i] / s) * k; } this .Normalize(); } public void No() // { double s = weight.Sum(); for ( int i = 0; i < 8; i++) { weight[i] -= input[i] * (weight[i] / s) * k; } this .Normalize(); } private void Normalize() // { // double min = weight.Min(); double max = weight.Max(); int pow = 0; double b = max / 10; while (b > 1) { b = b / 10; pow++; } for ( int i = 0; i < 8; i++) { weight[i] = weight[i] / Math .Pow(10, pow - 1); } } public void Reset() // { for ( int i = 0; i < 8; i++) { weight[i] = 1; } } // public string Bytes { get { string str = "" ; for ( int i = 0; i < 8; i++) { str += input[i].ToString(); } return str; } } public string Weights { get { string str = "" ; for ( int i = 0; i < 8; i++) { str += weight[i].ToString(); str += " " ; } return str; } } public string Mx { get { return mx.ToString(); } } public string Sum { get { return sum.ToString(); } } } * This source code was highlighted with Source Code Highlighter .
public class Neuron { int [] input = new int [8]; // double [] weight = new double [8]; // double mx = 0; // double sum = 0; // int k = 1; // public Neuron() { for ( int i = 0; i < 8; i++) { weight[i] = 1; // // } } public byte Analyze( byte b) { for ( int i = 0; i < 8; i++) { input[i] = 0; } for ( int i = 0; i < 8; i++) // { if ((b / 2) != 0) { input[i] = b % 2; b = Convert .ToByte(b / 2); } else { input[i] = b % 2; break ; } } sum = 0; mx = weight.Sum() / 8; // for ( int i = 0; i < 8; i++) { if (weight[i] > 0) // sum += weight[i] * input[i]; } if (sum > mx) // return 1; else return 0; } public void Yes() // { double s = weight.Sum(); for ( int i = 0; i < 8; i++) { weight[i] += input[i] * (weight[i] / s) * k; } this .Normalize(); } public void No() // { double s = weight.Sum(); for ( int i = 0; i < 8; i++) { weight[i] -= input[i] * (weight[i] / s) * k; } this .Normalize(); } private void Normalize() // { // double min = weight.Min(); double max = weight.Max(); int pow = 0; double b = max / 10; while (b > 1) { b = b / 10; pow++; } for ( int i = 0; i < 8; i++) { weight[i] = weight[i] / Math .Pow(10, pow - 1); } } public void Reset() // { for ( int i = 0; i < 8; i++) { weight[i] = 1; } } // public string Bytes { get { string str = "" ; for ( int i = 0; i < 8; i++) { str += input[i].ToString(); } return str; } } public string Weights { get { string str = "" ; for ( int i = 0; i < 8; i++) { str += weight[i].ToString(); str += " " ; } return str; } } public string Mx { get { return mx.ToString(); } } public string Sum { get { return sum.ToString(); } } } * This source code was highlighted with Source Code Highlighter .
public class Neuron { int [] input = new int [8]; // double [] weight = new double [8]; // double mx = 0; // double sum = 0; // int k = 1; // public Neuron() { for ( int i = 0; i < 8; i++) { weight[i] = 1; // // } } public byte Analyze( byte b) { for ( int i = 0; i < 8; i++) { input[i] = 0; } for ( int i = 0; i < 8; i++) // { if ((b / 2) != 0) { input[i] = b % 2; b = Convert .ToByte(b / 2); } else { input[i] = b % 2; break ; } } sum = 0; mx = weight.Sum() / 8; // for ( int i = 0; i < 8; i++) { if (weight[i] > 0) // sum += weight[i] * input[i]; } if (sum > mx) // return 1; else return 0; } public void Yes() // { double s = weight.Sum(); for ( int i = 0; i < 8; i++) { weight[i] += input[i] * (weight[i] / s) * k; } this .Normalize(); } public void No() // { double s = weight.Sum(); for ( int i = 0; i < 8; i++) { weight[i] -= input[i] * (weight[i] / s) * k; } this .Normalize(); } private void Normalize() // { // double min = weight.Min(); double max = weight.Max(); int pow = 0; double b = max / 10; while (b > 1) { b = b / 10; pow++; } for ( int i = 0; i < 8; i++) { weight[i] = weight[i] / Math .Pow(10, pow - 1); } } public void Reset() // { for ( int i = 0; i < 8; i++) { weight[i] = 1; } } // public string Bytes { get { string str = "" ; for ( int i = 0; i < 8; i++) { str += input[i].ToString(); } return str; } } public string Weights { get { string str = "" ; for ( int i = 0; i < 8; i++) { str += weight[i].ToString(); str += " " ; } return str; } } public string Mx { get { return mx.ToString(); } } public string Sum { get { return sum.ToString(); } } } * This source code was highlighted with Source Code Highlighter .
public class Neuron { int [] input = new int [8]; // double [] weight = new double [8]; // double mx = 0; // double sum = 0; // int k = 1; // public Neuron() { for ( int i = 0; i < 8; i++) { weight[i] = 1; // // } } public byte Analyze( byte b) { for ( int i = 0; i < 8; i++) { input[i] = 0; } for ( int i = 0; i < 8; i++) // { if ((b / 2) != 0) { input[i] = b % 2; b = Convert .ToByte(b / 2); } else { input[i] = b % 2; break ; } } sum = 0; mx = weight.Sum() / 8; // for ( int i = 0; i < 8; i++) { if (weight[i] > 0) // sum += weight[i] * input[i]; } if (sum > mx) // return 1; else return 0; } public void Yes() // { double s = weight.Sum(); for ( int i = 0; i < 8; i++) { weight[i] += input[i] * (weight[i] / s) * k; } this .Normalize(); } public void No() // { double s = weight.Sum(); for ( int i = 0; i < 8; i++) { weight[i] -= input[i] * (weight[i] / s) * k; } this .Normalize(); } private void Normalize() // { // double min = weight.Min(); double max = weight.Max(); int pow = 0; double b = max / 10; while (b > 1) { b = b / 10; pow++; } for ( int i = 0; i < 8; i++) { weight[i] = weight[i] / Math .Pow(10, pow - 1); } } public void Reset() // { for ( int i = 0; i < 8; i++) { weight[i] = 1; } } // public string Bytes { get { string str = "" ; for ( int i = 0; i < 8; i++) { str += input[i].ToString(); } return str; } } public string Weights { get { string str = "" ; for ( int i = 0; i < 8; i++) { str += weight[i].ToString(); str += " " ; } return str; } } public string Mx { get { return mx.ToString(); } } public string Sum { get { return sum.ToString(); } } } * This source code was highlighted with Source Code Highlighter .
public class Neuron { int [] input = new int [8]; // double [] weight = new double [8]; // double mx = 0; // double sum = 0; // int k = 1; // public Neuron() { for ( int i = 0; i < 8; i++) { weight[i] = 1; // // } } public byte Analyze( byte b) { for ( int i = 0; i < 8; i++) { input[i] = 0; } for ( int i = 0; i < 8; i++) // { if ((b / 2) != 0) { input[i] = b % 2; b = Convert .ToByte(b / 2); } else { input[i] = b % 2; break ; } } sum = 0; mx = weight.Sum() / 8; // for ( int i = 0; i < 8; i++) { if (weight[i] > 0) // sum += weight[i] * input[i]; } if (sum > mx) // return 1; else return 0; } public void Yes() // { double s = weight.Sum(); for ( int i = 0; i < 8; i++) { weight[i] += input[i] * (weight[i] / s) * k; } this .Normalize(); } public void No() // { double s = weight.Sum(); for ( int i = 0; i < 8; i++) { weight[i] -= input[i] * (weight[i] / s) * k; } this .Normalize(); } private void Normalize() // { // double min = weight.Min(); double max = weight.Max(); int pow = 0; double b = max / 10; while (b > 1) { b = b / 10; pow++; } for ( int i = 0; i < 8; i++) { weight[i] = weight[i] / Math .Pow(10, pow - 1); } } public void Reset() // { for ( int i = 0; i < 8; i++) { weight[i] = 1; } } // public string Bytes { get { string str = "" ; for ( int i = 0; i < 8; i++) { str += input[i].ToString(); } return str; } } public string Weights { get { string str = "" ; for ( int i = 0; i < 8; i++) { str += weight[i].ToString(); str += " " ; } return str; } } public string Mx { get { return mx.ToString(); } } public string Sum { get { return sum.ToString(); } } } * This source code was highlighted with Source Code Highlighter .
public class Neuron { int [] input = new int [8]; // double [] weight = new double [8]; // double mx = 0; // double sum = 0; // int k = 1; // public Neuron() { for ( int i = 0; i < 8; i++) { weight[i] = 1; // // } } public byte Analyze( byte b) { for ( int i = 0; i < 8; i++) { input[i] = 0; } for ( int i = 0; i < 8; i++) // { if ((b / 2) != 0) { input[i] = b % 2; b = Convert .ToByte(b / 2); } else { input[i] = b % 2; break ; } } sum = 0; mx = weight.Sum() / 8; // for ( int i = 0; i < 8; i++) { if (weight[i] > 0) // sum += weight[i] * input[i]; } if (sum > mx) // return 1; else return 0; } public void Yes() // { double s = weight.Sum(); for ( int i = 0; i < 8; i++) { weight[i] += input[i] * (weight[i] / s) * k; } this .Normalize(); } public void No() // { double s = weight.Sum(); for ( int i = 0; i < 8; i++) { weight[i] -= input[i] * (weight[i] / s) * k; } this .Normalize(); } private void Normalize() // { // double min = weight.Min(); double max = weight.Max(); int pow = 0; double b = max / 10; while (b > 1) { b = b / 10; pow++; } for ( int i = 0; i < 8; i++) { weight[i] = weight[i] / Math .Pow(10, pow - 1); } } public void Reset() // { for ( int i = 0; i < 8; i++) { weight[i] = 1; } } // public string Bytes { get { string str = "" ; for ( int i = 0; i < 8; i++) { str += input[i].ToString(); } return str; } } public string Weights { get { string str = "" ; for ( int i = 0; i < 8; i++) { str += weight[i].ToString(); str += " " ; } return str; } } public string Mx { get { return mx.ToString(); } } public string Sum { get { return sum.ToString(); } } } * This source code was highlighted with Source Code Highlighter .
public class Neuron { int [] input = new int [8]; // double [] weight = new double [8]; // double mx = 0; // double sum = 0; // int k = 1; // public Neuron() { for ( int i = 0; i < 8; i++) { weight[i] = 1; // // } } public byte Analyze( byte b) { for ( int i = 0; i < 8; i++) { input[i] = 0; } for ( int i = 0; i < 8; i++) // { if ((b / 2) != 0) { input[i] = b % 2; b = Convert .ToByte(b / 2); } else { input[i] = b % 2; break ; } } sum = 0; mx = weight.Sum() / 8; // for ( int i = 0; i < 8; i++) { if (weight[i] > 0) // sum += weight[i] * input[i]; } if (sum > mx) // return 1; else return 0; } public void Yes() // { double s = weight.Sum(); for ( int i = 0; i < 8; i++) { weight[i] += input[i] * (weight[i] / s) * k; } this .Normalize(); } public void No() // { double s = weight.Sum(); for ( int i = 0; i < 8; i++) { weight[i] -= input[i] * (weight[i] / s) * k; } this .Normalize(); } private void Normalize() // { // double min = weight.Min(); double max = weight.Max(); int pow = 0; double b = max / 10; while (b > 1) { b = b / 10; pow++; } for ( int i = 0; i < 8; i++) { weight[i] = weight[i] / Math .Pow(10, pow - 1); } } public void Reset() // { for ( int i = 0; i < 8; i++) { weight[i] = 1; } } // public string Bytes { get { string str = "" ; for ( int i = 0; i < 8; i++) { str += input[i].ToString(); } return str; } } public string Weights { get { string str = "" ; for ( int i = 0; i < 8; i++) { str += weight[i].ToString(); str += " " ; } return str; } } public string Mx { get { return mx.ToString(); } } public string Sum { get { return sum.ToString(); } } } * This source code was highlighted with Source Code Highlighter .
備考
ニューロンのトレーニングを整理するのは非常に簡単です。別の方法で数の偶数(奇数)を確認し、彼の答えが正しいかどうかを伝える必要があります。 その結果、適切にトレーニングされたニューロンの場合、最初の放電時の重み(実際は1の場合、数値は奇数、0が偶数の場合)を除くすべての重みが極端に小さくなります。つまり、パリティ(奇数)には影響しません。重量が増加し、その重要性を示します。 私たちのニューロンは、数千回のトレーニング実行後、選択した範囲の数値で正しく動作しますが、たとえば、重みを1と0に変更し、1ずつ変更すると、ニューロンは1ダースの実行でトレーニングでき、トレーニングされたニューロンは最初の数字は0に等しく、1に等しくなります。