joaopauloschuler / neural-api

CAI NEURAL API - Pascal based deep learning neural network API optimized for AVX, AVX2 and AVX512 instruction sets plus OpenCL capable devices including AMD, Intel and NVIDIA.
GNU Lesser General Public License v2.1
356 stars 195 forks source link

Small problem in MulAdd #18

Closed Pigrecos closed 4 years ago

Pigrecos commented 4 years ago

If I run the XorAndOr example in delphi (or by disabling AVX support in Lazaurus) I get errors while calculating the output of the last layer.

TVolume.MulAdd procedures (Value: T; Original: TVolume); begin {$ IFDEF Debug} if Original.Size <> Self.Size then raise Exception.Create ('Sizes don''t match at MulAdd:' + IntToStr (Self.Size) + 'and' + IntToStr (Original.Size) + '.'); {$ ENDIF} MulAdd (Value, Addr (Original.FData [0])); end;

Throws the exception which is not the case with AVX.

thank you

joaopauloschuler commented 4 years ago

Backpropagation was trying to calculate errors for the input layer (this was the cause of the problem). Please let me know if this fix works at your end. Thank you very much for reporting!

Pigrecos commented 4 years ago

now works very well. Thank you