Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

XorAndOr test project issue #110

Open
Kryuski opened this issue Feb 27, 2023 · 4 comments
Open

XorAndOr test project issue #110

Kryuski opened this issue Feb 27, 2023 · 4 comments
Assignees

Comments

@Kryuski
Copy link

Kryuski commented Feb 27, 2023

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.

@Kryuski
Copy link
Author

Kryuski commented Feb 28, 2023

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 Kryuski closed this as completed Feb 28, 2023
@joaopauloschuler
Copy link
Owner

joaopauloschuler commented Mar 4, 2023

@Kryuski ,
Many thanks for reporting.

I'm reopening until I can reproduce and apply a fix to the source code.

@joaopauloschuler
Copy link
Owner

@Kryuski ,
Have you got this error while running one of the examples that come with this API?

@joaopauloschuler joaopauloschuler self-assigned this Mar 4, 2023
@Kryuski
Copy link
Author

Kryuski commented Mar 11, 2023

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.

maxkleiner added a commit to maxkleiner/neural-api that referenced this issue Apr 17, 2023
for the ml package bpmagazine joaopauloschuler#110
maxkleiner added a commit to maxkleiner/neural-api that referenced this issue Apr 17, 2023
maxkleiner added a commit to maxkleiner/neural-api that referenced this issue Apr 17, 2023
for bpmagazine joaopauloschuler#110 ML package
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants