|
NeuroTIC 0.0
|
Save and Load Files.
http://tituxdev.github.io/NeuroTIC/src/CPU/ntfile.c.
More...
#include "ntcore.h"

Go to the source code of this file.
Functions | |
| unsigned char | savenet (net_s *net, const char *name) |
| Saves a network to a binary file with extension .ntic. | |
| struct net_s | loadnet (char *name) |
| Loads a network from a binary file with extension .ntic. | |
Save and Load Files.
http://tituxdev.github.io/NeuroTIC/src/CPU/ntfile.c.
Provides functions to persist network structures and weights, allowing training to be stored and reloaded.
The file format is binary with a custom structure, including endianness and floating-point representation handling for cross-platform compatibility.
Currently, the implementation focuses on core data serialization and deserialization, with future plans for validation and standardization of loaded data.
Implement file validation and data standardization during loading to ensure compatibility and integrity of loaded networks.
Consider adding support for versioning in the file format to allow for future extensions and backward compatibility.
Explore options for compressing the saved network files to reduce disk space usage, especially for larger networks.
Definition in file ntfile.h.
| struct net_s loadnet | ( | char * | name | ) |
Loads a network from a binary file with extension .ntic.
| name | Base filename (without extension) to load the network from. |
Reconstructs the network structure, weights, biases, and buffer wiring from a binary file.
The function reads the file header to validate the format and version, then proceeds to read the core network data while handling endianness and floating-point representation.
Implement file validation and data standardization during loading to ensure compatibility and integrity of loaded networks.
Consider adding support for versioning in the file format to allow for future extensions and backward compatibility.
Explore options for compressing the saved network files to reduce disk space usage, especially for larger networks.
References wiring_s::array_type, wiring_s::arrays, neuron_s::b, neuron_s::bff_idx, buildnet(), neuron_s::fn, neuron_s::inputs, net_s::inputs, net_s::layers, net_s::neurons, newnet(), net_s::nn, wiring_s::size, wiring_s::src_index, wiring_s::src_layer, wiring_s::src_type, neuron_s::w, and net_s::wiring.
| unsigned char savenet | ( | net_s * | net, |
| const char * | name | ||
| ) |
Saves a network to a binary file with extension .ntic.
| net | Pointer to the network to save. |
| name | Base filename (without extension) to save the network as. |
Saves the network's layers, neurons, weights, biases, and buffer wiring to a binary file.
The file is structured with a header containing a magic string and version byte, followed by the network's core data.
The function handles endianness and floating-point representation to ensure cross-platform compatibility.
Add validation checks for the input network structure before attempting to save, ensuring that all necessary data is present and correctly formatted.
Implement error handling for file operations, such as checking for write permissions and handling disk space issues.
Consider adding metadata to the file format, such as timestamps or training information, to provide more context when loading networks in the future.
Explore options for compressing the saved network files to reduce disk space usage, especially for larger networks.
Implement file validation and data standardization during loading to ensure compatibility and integrity of loaded networks.
References wiring_s::array_type, wiring_s::arrays, neuron_s::bff_idx, neuron_s::fn, neuron_s::inputs, net_s::layers, net_s::neurons, net_s::nn, wiring_s::size, wiring_s::src_type, and net_s::wiring.