Adi Sidapara
Adi Sidapara

Reputation: 39

Importing weights on Encog Java Library

Is it possible to import weights on an Encog neural network? I know it is possible to export the weights, but in I am constructing a dual neural net system, in which one is trained periodically with data and updates the other, which serves strictly to generate an output. Is it possible to adjust the weights of the non-training network by specifying the actual values? Thanks!

Upvotes: 1

Views: 289

Answers (2)

Yuriy Zaletskyy
Yuriy Zaletskyy

Reputation: 5151

In C# you can save NN into file like this ( IMHO saving is like an import ) :

EncogDirectoryPersistence.SaveObject(new System.IO.FileInfo("C:\\1.nnn"), _network);

and then export your data:

var network = (BasicNetwork)EncogDirectoryPersistence.LoadObject("c:\\1.nnn");

Upvotes: 0

Booley
Booley

Reputation: 859

I haven't tried it myself but it looks like you can use the network.setWeight(int fromLayer, int fromNeuron, int toNeuron, double value) method to set individual neuron weights, so you'd have to iterate over all neurons you want to update.

Upvotes: 1

Related Questions