Skip to content

Commit

Permalink
Adding TNNetSplitChannels.Create(ChannelStart, ChannelLen: integer)
Browse files Browse the repository at this point in the history
  • Loading branch information
joaopauloschuler committed Dec 3, 2019
1 parent 1ef4b10 commit 9600a72
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions neural/neuralnetwork.pas
Original file line number Diff line number Diff line change
Expand Up @@ -664,6 +664,7 @@ TNNetSplitChannels = class(TNNetLayer)
FChannels: TNeuralIntegerArray;
procedure SetPrevLayer(pPrevLayer: TNNetLayer); override;
public
constructor Create(ChannelStart, ChannelLen: integer); overload;
constructor Create(pChannels: array of integer); overload;
destructor Destroy(); override;

Expand Down Expand Up @@ -3833,6 +3834,17 @@ procedure TNNetSplitChannels.SetPrevLayer(pPrevLayer: TNNetLayer);
FActivationFnDerivative := pPrevLayer.ActivationFnDerivative;
end;

constructor TNNetSplitChannels.Create(ChannelStart, ChannelLen: integer);
var
pChannels: array of integer;
ChannelCnt: integer;
begin
SetLength(pChannels, ChannelLen);
for ChannelCnt := 0 to ChannelLen - 1 do
pChannels[ChannelCnt] := ChannelStart + ChannelCnt;
Create(pChannels);
end;

constructor TNNetSplitChannels.Create(pChannels: array of integer);
var
I: integer;
Expand Down

0 comments on commit 9600a72

Please sign in to comment.