Wiki
Clone wikiPyiB2c / Saving and loading behaviors and networks
Saving and loading behaviors and networks
Save behaviors and networkd
With Py-iB2c we can store in a single file a behavior and load it afterwards to use it in another network. Similarly, once we have tested a network for a specific task, we can save it and reuse it as it was a single behavior module.
To save a behavior module, use the method store_behavior_module(self, ID, path='~', name='')
:
- ID: - int - ID of the module to be stored
- path: - str - absolute path where the behavior will be saved
- name: - str - name of the file
Similarly, we can save the complete network we have created with the method store_network(self, path='~', name='').
Load behaviors and networks
Since the network interfaces (input, stimulations, inhibitions, activities and ratings) are implemented in the same way than for a behavior module, we can equally load a saved network or a behavior and use it as a behavior module. To do that, the method add_external_behavior(self, name, path)
is used. This method must be called before generating the network (before calling the method generate()
).
Updated