neural-api icon indicating copy to clipboard operation
neural-api copied to clipboard

How can I get the weights and biases of the trained neural network?

Open gwiesenekker opened this issue 2 years ago • 2 comments

How can I get the weights and biases of the trained neural network?

gwiesenekker avatar Aug 31 '23 23:08 gwiesenekker

Each layer (TNNetLayer) has a list of Neurons:

property Neurons: TNNetNeuronList read FNeurons;

The neuron list is implemented as follows:

TNNetNeuronList = class (specialize TFPGObjectList<TNNetNeuron>)  

From TNNetNeuron, you have:

property Weights: TNNetVolume read FWeights;

So, regarding weights, you'll load from TNNetNeuron.Weights.

I'll FUP about bias.

joaopauloschuler avatar Sep 01 '23 02:09 joaopauloschuler

Just added support to read the bias in the most recent commit.

joaopauloschuler avatar Sep 01 '23 02:09 joaopauloschuler