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

Some data parts are not stored using "SaveStructureToString" #137

Open mikerabat opened 1 month ago

mikerabat commented 1 month ago

E.g. the base class TNNetAddNoiseBase does not store the "Enabled" property in that structure. That has the following impact: Assume you have a TNNetDropout layer in your net. Based on that definition if the enabled flag is set on each learning iteration it randomly changes the which activations are used in a learning step. Now assume you finished learning and save the net to a file - later loading it and use it to classify an unseen example.

Based on randomness the outcome is unpredictable and changes on each iteration! (I found that when I tried to analyze some ECG recordings for sleeping apneas and the output probabilites changed each time)

My workaround is to manually go through each layer after loading or cloning (for threads) and set the flag "Enabled" to false. Would be nice though to have either a general switch or have a function to remove TNNetAddNoiseBase layers at all for production runs that rely on same input = same output principle ;) or have the structure enhanced by storing additional properties...

joaopauloschuler commented 1 month ago

Dear @mikerabat , I'll look into it and FUP.