Tuesday, August 18, 2009

t

t

A Novel Generic Multi-Layer Neural Networks :: Part 1: The Neuron Class

A Novel Generic Multi-Layer Neural Networks
Part 1: The Neuron Class


This post presents a model that I created for a NN program that I developed to solve general numeric problems (prediction, estimation, interpolation, extrapolation, etc.).

public class Neuron

{
private double __lastOutput;

private double __lastError;

private double __lastBias;

private double[] __lastWeights;

private int __siblingCount;

private int __layerInputCount;

#region Properties
private Delegates.ActivationFunction _ActivationFunction;

public Delegates.ActivationFunction ActivationFunction

{ get { return _ActivationFunction; } }

private int _InputCount;

public int InputCount

{ get { return _InputCount; } }

private double _Bias;

public double Bias

{ get { return _Bias; } }


private double[] _Weights;

public double[] Weights

{ get { return _Weights; } }

#endregion

#region Constructor


public Neuron(Delegates.ActivationFunction activationFunction, int inputCount, double? initialBias, double[] initialWeights, int siblingCount)

{ _ActivationFunction = activationFunction;

_InputCount = inputCount;

__siblingCount = siblingCount;

__layerInputCount = _InputCount * __siblingCount;

__lastError = 0.0;


if (initialBias == null)

_Bias = GlobalModule.GetRandomValue();

else

_Bias = initialBias.Value;

__lastBias = _Bias;
if (initialWeights == null)

{

_Weights = GlobalModule.GetRandomValue(inputCount);

}

else if (initialWeights.Length == inputCount)

{

initialWeights.CopyTo(_Weights, 0);

initialWeights.CopyTo(__lastWeights, 0);

}

else

throw new Exception("Invalid number of initial weights!");
}


#endregion


#region Public Methods


public double ComputeOutput(double[] input)

{

double totalInput = _Bias;
for (int i = 0; i <>

totalInput += _Weights[i] * input[i];

__lastOutput = _ActivationFunction.Invoke(totalInput);

return __lastOutput;

}

public void ChangeWeights(double error) // it also modifies the bias

{

double roughSharePlus = Math.Abs(error) / __layerInputCount;

double roughShareMinus = -roughSharePlus;

double curBias = _Bias;

if (Math.Abs(error) > Math.Abs(__lastError)) // worse (weak result)

{

roughSharePlus = -roughSharePlus;

roughShareMinus = -roughShareMinus;

}

for (int i = 0; i <> _Weights[i])

{

__lastWeights[i] = _Weights[i];

_Weights[i] += roughShareMinus * GlobalModule.GetRandomValue();

}

} // next i

if(__lastBias <> curBias)

_Bias += roughShareMinus * GlobalModule.GetRandomValue() * (__lastBias - curBias);
__lastBias = curBias;
return;

}


public void ReinitializeWeights() // it also reinitialize the bias

{

_Weights = GlobalModule.GetRandomValue(_InputCount);

_Bias = GlobalModule.GetRandomValue();

}


#endregion


} // end of class Neuron

Sunday, August 9, 2009

Conceptual Design in Database Development

Conceptual Design in Database Development!

The conceptual design is the first phase in the database design process:
  1. Conceptual Design
  2. Logical Design
  3. Implementation (Adaption)
  4. Physical Design

The conceptual design phase is a process of "Analysis and Discovery" and its goal is to define the "Requirements" of a system (a company/business/organization/etc.).

There are four main tasks to do in this phase:

1. Documenting the entities and the relationships between entities

2. Documenting the business rules for data

3. Defining the scope of the system

4. Defining a plan for security of the system

Saturday, August 8, 2009

a

a

Could not start Telegram Desktop

[2016.11.26 12:21:28] Launched version: 10019, alpha: [FALSE], beta: 0, debug mode: [FALSE], test dc: [FALSE]
[2016.11.26 12:21:28] Executable dir: C:/Users/Reza/AppData/Roaming/Telegram Desktop/, name: Telegram.exe
[2016.11.26 12:21:28] Initial working dir: C:/Users/Reza/AppData/Roaming/Telegram Desktop/
[2016.11.26 12:21:28] Working dir: C:/Users/Reza/AppData/Roaming/Telegram Desktop/
[2016.11.26 12:21:28] Arguments: "C:\Users\Reza\AppData\Roaming\Telegram Desktop\Telegram.exe"
[2016.11.26 12:21:28] Logs started
[2016.11.26 12:21:28] Connecting local socket to Global\e46b93575710e55e3b6a560b9ded52e1-{87A94AB0-E370-4cde-98D3-ACC110C5967D}...
[2016.11.26 12:21:28] This is the only instance of Telegram, starting server and app...
[2016.11.26 12:21:28] Could not copy 'log_start0.txt' to 'C:/Users/Reza/AppData/Roaming/Telegram Desktop/log.txt' to start new logging!
[2016.11.26 12:21:28] FATAL: Could not move logging to 'C:/Users/Reza/AppData/Roaming/Telegram Desktop/log.txt'!