@@ -224,32 +224,6 @@ def suggest(
224
224
"""
225
225
return _suggest (self , left , right , count , batch_size = batch_size , ** kwargs )
226
226
227
- def save (self , target_directory : Path , name : str , include_optimizer : bool = True ) -> None :
228
- """Save the deep learning model to disk.
229
-
230
- Saves the model architecture, weights, and optimizer state (optional),
231
- along with the similarity map.
232
-
233
- Args:
234
- target_directory: The directory where the model will be saved.
235
- name: The name of the model (used as a subdirectory).
236
- include_optimizer: Whether to save the optimizer state.
237
- """
238
- # Ensure target_directory is a Path object
239
- target_directory = Path (target_directory ) / name / 'model'
240
-
241
- # Ensure the directory exists
242
- target_directory .mkdir (parents = True , exist_ok = True )
243
-
244
- # Save the model architecture and weights
245
- super ().save (target_directory / "model.h5" , include_optimizer = include_optimizer )
246
-
247
- # Save the similarity map
248
- with open (target_directory / "similarity_map.pkl" , "wb" ) as f :
249
- pickle .dump (self .similarity_map , f )
250
-
251
- print (f"Model successfully saved to { target_directory } " )
252
-
253
227
@property
254
228
def similarity_map (self ) -> SimilarityMap :
255
229
"""Similarity Map of the Model."""
@@ -671,34 +645,6 @@ def suggest(
671
645
"""
672
646
return _suggest (self , left , right , count , batch_size = batch_size )
673
647
674
- def save (self , target_directory : Path , name : str ) -> None :
675
- """Save the neural-symbolic model to disk.
676
-
677
- Saves the record pair network, similarity map, and optimizer.
678
-
679
- Args:
680
- target_directory: The directory where the model will be saved.
681
- name: The name of the model (used as a subdirectory).
682
- """
683
- # Ensure target_directory is a Path object
684
- target_directory = Path (target_directory ) / name / 'model'
685
-
686
- # Ensure the directory exists
687
- target_directory .mkdir (parents = True , exist_ok = True )
688
-
689
- # Save the record pair network weights
690
- self .record_pair_network .save_weights (target_directory / "record_pair_network.weights.h5" )
691
-
692
- # Save the similarity map
693
- with open (target_directory / "similarity_map.pkl" , "wb" ) as f :
694
- pickle .dump (self .record_pair_network .similarity_map , f )
695
-
696
- # Save the optimizer state
697
- with open (target_directory / "optimizer.pkl" , "wb" ) as f :
698
- pickle .dump (self .optimizer .get_config (), f )
699
-
700
- print (f"Model successfully saved to { target_directory } " )
701
-
702
648
@property
703
649
def similarity_map (self ) -> SimilarityMap :
704
650
"""Similarity Map of the Model."""
0 commit comments