load method

Future<void> load(
  1. String filePath
)

Implementation

Future<void> load(String filePath) async {
  try {
    File file = File(filePath);
    bool exists = await file.exists();
    if (!exists) {
      Logger.log('Error loading network: File not found at $filePath');
      return;
    }
    String jsonString = await file.readAsString();
    Map<String, dynamic> networkWeights = jsonDecode(jsonString);

    setWeights(networkWeights);
    Logger.log('Network weights loaded from $filePath');
  } catch (e) {
    Logger.log('Error loading network: $e');
  }
}