Saving a Model

Function Signature

def save(self, file_location: str) -> None:

Parameters

Return Value

This function does not return anything. It saves the model's state to the specified file location.

Description

The save function saves the current state of the deeprai.models.FeedForward instance to a file. This allows for easy checkpointing and restoration of trained models. The model's weights, architecture, and configurations are stored at the specified file location. It's recommended to save the model periodically during training to avoid potential data loss.

Examples

Here's an example of how to use the save function:

from deeprai.models import FeedForward

# ... [Building and training the model] ...

# Saving the model's state to a file
model.save('path/to/save/model.deepr')

This code initializes and trains a FeedForward model and then saves its state to the file located at 'path/to/save/model.deepr'.


Revision #1
Created 6 September 2023 13:40:39 by Kieran Carter
Updated 6 September 2023 13:50:33 by Kieran Carter