Neural Memory is a model of the Neural Network. neural memory file is saved with the extension of .gnn
or .gnn2
.
Load Neural Memory
There’s an input field in every NeuralNet component that loads neural memory to NeuralComponent. you’ll find it in the Memory section.
you can also Load Neural Memory during runtime by using LoadMemory()
method
NeuralComponent NN;
NeuralMemory Memory;
if(NN.LoadMemory(Memory))
Debug.Log("New Memory load success");
else
Debug.Log("New Memory load failed");
Save Neural Memory
As for Saving the neural memory, you can do it manually via inspector by setting the save path, and click the save button
If you’re doing training, there’s an option for AutoSave, it’ll automatically save the NeuralMemory into a file for every Checkpoint Interval that you’ve set.
you can do it also manually during runtime, like this
NeuralComponent NN;
NN.Save("V1" , "Gtion/Brain"); //you can also use this `NN.Save("V1");`
//it'll be saved to `Application.dataPath/Gtion/Brain_V1.gnn2`
//in case you want the NeuralMemory only, without saving to file, you can do this
NeuralMemory memory = NN.GetNeuralMemory();