TNeuron = class(TObject)
private
FThreshold: Single;
FInputCount: Integer;
FInputs:TSingleDynArray;
FWeights:TSingleDynArray;
FAnalogOutput:Boolean;
function GetInput(Index: Integer): Single;
function GetOutput: Single;
function GetWeight(Index: Integer): Single;
procedure SetInput(Index: Integer; const Value: Single);
procedure SetWeight(Index: Integer; const Value: Single);
procedure SetInputCount(const Value: Integer);
function GetLoad: Single;
public
Constructor Create(aInputCount:Integer);
procedure RandomInitialize;
Property Load:Single read GetLoad;
property Output:Single read GetOutput;
property Threshold:Single read FThreshold write FThreshold;
property Inputs[Index: Integer]: Single read GetInput write SetInput;
property Weights[Index: Integer]: Single read GetWeight write SetWeight;
property InputCount:Integer read FInputCount write SetInputCount;
property AnalogOutput read FAnalogOutput write FAnalogOutput;
end;
Download the updated TNeuron project for Delphi XE5 Firemonkey.
Head over and read the full blog post about the Delphi XE5 neuron object.