@@ -729,3 +729,46 @@ def generate_ann_output_set(problem, reduced_problem, input_set, mode=None):
729
729
os .system (f"rm { checkpoint_path_u } " )
730
730
print (f"Training time (u): { elapsed_time } " )
731
731
732
+ # Error analysis dataset
733
+ print ("\n " )
734
+ print ("Generating error analysis (only input/parameters) dataset" )
735
+ print ("\n " )
736
+ error_analysis_set = generate_ann_input_set (num_ann_samples = error_analysis_samples_num )
737
+ error_numpy_sigma = np .zeros (error_analysis_set_sigma .shape [0 ])
738
+
739
+ for i in range (error_analysis_set .shape [0 ]):
740
+ print (f"Error analysis parameter number { i + 1 } of " )
741
+ print (f"{ error_analysis_set .shape [0 ]} : { error_analysis_set [i ,:]} " )
742
+ error_numpy_sigma [i ] = error_analysis (reduced_problem , problem_parametric ,
743
+ error_analysis_set [i , :], model_sigma ,
744
+ len (reduced_problem ._basis_functions_sigma ), online_nn ,
745
+ norm_error = reduced_problem .norm_error_sigma ,
746
+ reconstruct_solution = reduced_problem .reconstruct_solution_sigma ,
747
+ input_scaling_range = reduced_problem .input_scaling_range ,
748
+ output_scaling_range = reduced_problem .output_scaling_range_sigma ,
749
+ input_range = reduced_problem .input_range ,
750
+ output_range = reduced_problem .output_range_sigma ,
751
+ index = 0 , verbose = True )
752
+ print (f"Error: { error_numpy_sigma [i ]} " )
753
+
754
+ # Error analysis dataset
755
+ print ("\n " )
756
+ print ("Generating error analysis (only input/parameters) dataset" )
757
+ print ("\n " )
758
+ error_analysis_set = generate_ann_input_set (num_ann_samples = error_analysis_samples_num )
759
+ error_numpy_u = np .zeros (error_analysis_set_u .shape [0 ])
760
+
761
+ for i in range (error_analysis_set .shape [0 ]):
762
+ print (f"Error analysis parameter number { i + 1 } of " )
763
+ print (f"{ error_analysis_set .shape [0 ]} : { error_analysis_set [i ,:]} " )
764
+ error_numpy_sigma [i ] = error_analysis (reduced_problem , problem_parametric ,
765
+ error_analysis_set [i , :], model_u ,
766
+ len (reduced_problem ._basis_functions_u ), online_nn ,
767
+ norm_error = reduced_problem .norm_error_u ,
768
+ reconstruct_solution = reduced_problem .reconstruct_solution_u ,
769
+ input_scaling_range = reduced_problem .input_scaling_range ,
770
+ output_scaling_range = reduced_problem .output_scaling_range_u ,
771
+ input_range = reduced_problem .input_range ,
772
+ output_range = reduced_problem .output_range_u ,
773
+ index = 1 , verbose = True )
774
+ print (f"Error: { error_numpy_sigma [i ]} " )
0 commit comments