Shuffle a dataset. Shuffles assuming the dimensions of each matrix are (n_samples, size).
Scale a dataset between [min, max].
Normalize a dataset using the L2 norm.
Returns the current tom
version.
Serialize a matrix's data to a file. Returns 1
if successful, otherwise it returns 0
.
Deserialize a matrix's data from a file. Returns 1
if successful, otherwise it returns 0
.
Serialize a layer. Returns 1
if successful, otherwise it returns 0
.
Serialize a layer's parameters. Returns 1
if successful, otherwise it returns 0
.
Deserialize a layer and add it to a model. Returns 1
if successful, otherwise it returns 0
.
Deserialize a layer's parameters. Returns 1
if successful, otherwise it returns 0
.
Serialize a model. We serialize in two passes, once for layer information, and again for layer parameters. Returns 1
if successful, otherwise it returns 0
.
Deserialize a model. Again, deserialize in two passes, loading layer data, initializing and finalizing the model, and then loading layer parameters. Returns 1
if successful, otherwise it returns 0
.
Initialize the RNG.
Generate a uniform random value from min to min+range.
Generate a normal random value.
The last error message string.
extern char *LAST_ERROR;
Print the last error to stdout.
Return the last error.
Macro to quit on error.
#define QUIT_ON_ERROR(x) { \
int ret = (x); \
if (!ret) { \
print_last_error(); \
exit(1); \
} \
}