@@ -358,13 +358,29 @@ def main():
358358
359359 # Save the model
360360 os .makedirs ('data' , exist_ok = True )
361+ # Determine model architecture name from best_model_name
362+ model_architecture = best_model_name
363+ # Map common names to architecture names
364+ if "GAIL_Wide_Extra" in best_model_name or "GAILWideExtra" in best_model_name :
365+ model_architecture = "GAILWideExtra"
366+ elif "GAIL_Wide" in best_model_name :
367+ model_architecture = "GAILWide"
368+ elif "GAIL_Deep" in best_model_name :
369+ model_architecture = "GAILDeep"
370+ elif "GAIL_Narrow" in best_model_name :
371+ model_architecture = "GAILNarrow"
372+ elif "GAIL" in best_model_name :
373+ model_architecture = "GAILDiscriminator"
374+
361375 torch .save ({
362376 'model_state_dict' : best_model .model .state_dict (),
363377 'scaler' : best_model .scaler ,
364378 'learning_rate' : best_model .learning_rate ,
365- 'weight_pos' : best_model .criterion .pos_weight .item () if hasattr (best_model .criterion , 'pos_weight' ) else None
379+ 'weight_pos' : best_model .criterion .pos_weight .item () if hasattr (best_model .criterion , 'pos_weight' ) else None ,
380+ 'model_architecture' : model_architecture ,
381+ 'model_name' : best_model_name
366382 }, 'data/GAIL.pt' )
367- print (f"Model saved to data/GAIL.pt" )
383+ print (f"Model saved to data/GAIL.pt (architecture: { model_architecture } ) " )
368384
369385 # Re-validate after extended training
370386 final_val_metrics = validate_filtration_AI (
0 commit comments