neural-api
neural-api copied to clipboard
XorAndOr test project issue
I tested the XorAndOr neural network in the new Lazarus 2.24 (FPS 3.2.2), and found an unintentional modification of the structure of NN in the Fit procedure. Before Fit:
Layer 0 Neurons: 0 Weights: 0 TNNetInput(2,1,1,0,0) Output:2,1,1 ...
Layer 1 Neurons: 3 Weights: 6 TNNetFullConnect(3,1,1,0,0) Output:3,1,1 ...
Layer 2 Neurons: 3 Weights: 9 TNNetFullConnectLinear(3,1,1,0,0) Output:3,1,1 ...
After Fit:
Layer 0 Neurons: 0 Weights: 0 TNNetInput(2,1,1,0,0) Output:2,1,1 ...
Layer 1 Neurons: 32 Weights: 64 TNNetFullConnectReLU(32,1,1,0,0) Output:32,1,1 ...
Layer 2 Neurons: 32 Weights: 1024 TNNetFullConnectReLU(32,1,1,0,0) Output:32,1,1 ...
Layer 3 Neurons: 1 Weights: 32 TNNetFullConnectLinear(1,1,1,0,0) Output:1,1,1 ...
I used NN.DebugStructure to get the structure. Can anyone confirm this, or is it just me? P.S. Delphi 10.4 Community Edition does not have this problem.
OK the issue is eliminated. How to fix: delete autosave.nn on the beginning of procedure TNeuralDataLoadingFit.FitLoading:
FileName := FFileNameBase + '.nn';
if FileExists(FileName) then // <-- add these lines
SysUtils.DeleteFile(FileName);
@Kryuski , Many thanks for reporting.
I'm reopening until I can reproduce and apply a fix to the source code.
@Kryuski , Have you got this error while running one of the examples that come with this API?
Yes, I ran various applications from the examples folder. Some of them create the autosave.nn file as they work. The XorAndOr app printed information to the console from this file, which was left over from running another example.