diff --git a/dependencies.xml b/dependencies.xml index 3b4ba4c0c2..d1a93e8532 100644 --- a/dependencies.xml +++ b/dependencies.xml @@ -13,6 +13,7 @@ Note all install methods after "main" take add with no pinned version: remove a library: remove action for limited OS: ... + action for certain machine ... add library from forge: ... optional: ... skip run/install check: ... @@ -42,12 +43,12 @@ Note all install methods after "main" take 2023 - 1.5 + 1.6 3.5 0.13 2.2 - 2.10 - 2.10 + 2.13 + 3.8 3 @@ -64,13 +65,11 @@ Note all install methods after "main" take - 2.2 - 1.13 - 1 + 2.6 2.22 - + 1.1 diff --git a/ravenframework/Optimizers/Factory.py b/ravenframework/Optimizers/Factory.py index 7eefb5c52d..6362c727b7 100644 --- a/ravenframework/Optimizers/Factory.py +++ b/ravenframework/Optimizers/Factory.py @@ -24,10 +24,14 @@ from .GradientDescent import GradientDescent from .SimulatedAnnealing import SimulatedAnnealing from .GeneticAlgorithm import GeneticAlgorithm -from .BayesianOptimizer import BayesianOptimizer factory = EntityFactory('Optimizer') factory.registerType('GradientDescent', GradientDescent) factory.registerType('SimulatedAnnealing', SimulatedAnnealing) factory.registerType('GeneticAlgorithm', GeneticAlgorithm) -factory.registerType('BayesianOptimizer', BayesianOptimizer) + +try: + from .BayesianOptimizer import BayesianOptimizer + factory.registerType('BayesianOptimizer', BayesianOptimizer) +except ModuleNotFoundError as error: + print("ERROR: Unable to import BayesianOptimizer", error) diff --git a/ravenframework/Optimizers/__init__.py b/ravenframework/Optimizers/__init__.py index 8822fd0a25..dc5a8c80a1 100644 --- a/ravenframework/Optimizers/__init__.py +++ b/ravenframework/Optimizers/__init__.py @@ -24,6 +24,9 @@ from .RavenSampled import RavenSampled from .GradientDescent import GradientDescent from .SimulatedAnnealing import SimulatedAnnealing -from .BayesianOptimizer import BayesianOptimizer +try: + from .BayesianOptimizer import BayesianOptimizer +except ModuleNotFoundError as error: + print("ERROR: Unable to import BayesianOptimizer", error) from .Factory import factory diff --git a/ravenframework/SupervisedLearning/KerasBase.py b/ravenframework/SupervisedLearning/KerasBase.py index 5d0617afd3..5b03970e60 100644 --- a/ravenframework/SupervisedLearning/KerasBase.py +++ b/ravenframework/SupervisedLearning/KerasBase.py @@ -1910,7 +1910,9 @@ def __init__(self): # continues learning even when many updates have been done. self.availOptimizer['adadelta'] = tf.keras.optimizers.Adadelta # Adam optimzer - self.availOptimizer['adam'] = tf.keras.optimizers.Adam + self.availOptimizer['adam_new'] = tf.keras.optimizers.Adam + # Adam legacy optimizer + self.availOptimizer['adam'] = tf.keras.optimizers.legacy.Adam # Adamax optimizer from Adam paper's section 7 self.availOptimizer['adamax'] = tf.keras.optimizers.Adamax # Nesterov Adam optimizer diff --git a/scripts/library_handler.py b/scripts/library_handler.py index 05a95423c3..97640de567 100644 --- a/scripts/library_handler.py +++ b/scripts/library_handler.py @@ -449,6 +449,14 @@ def _readLibNode(libNode, config, toRemove, opSys, addOptional, limitSources, re # if this library's OS's don't match the requested OS, then we move on if opSys not in [x.lower().strip() for x in libOS.split(',')]: return # nothing to do + libMachine = libNode.attrib.get('machine', None) + if libMachine is not None: + machineType = platform.machine() + machineSubst = {'AMD64':'x86_64'} #substitutions for different names + if machineType in machineSubst: + machineType = machineSubst[machineType] #convert to standard name. + if machineType not in [x.lower().strip() for x in libMachine.split(',')]: + return # nothing to do since not machine type specified # check optional ## note that None means "not optional" in this case ## further note anything besides "True" is taken to mean "not optional" diff --git a/tests/framework/CodeInterfaceTests/CobraTF/tests b/tests/framework/CodeInterfaceTests/CobraTF/tests index 6d26c8196d..07f8a9caf8 100644 --- a/tests/framework/CodeInterfaceTests/CobraTF/tests +++ b/tests/framework/CodeInterfaceTests/CobraTF/tests @@ -19,8 +19,13 @@ [./test3] type = 'RavenFramework' input = 'test3_cobratf_code_interface.xml' - text = 'CobraTFinterfaceTest3/testDummyStep_MC/1/sample.inp CobraTFinterfaceTest3/testDummyStep_MC/1/vuq_param.txt CobraTFinterfaceTest3/testDummyStep_MC/2/sample.inp CobraTFinterfaceTest3/testDummyStep_MC/2/vuq_param.txt' + text = 'CobraTFinterfaceTest3/testDummyStep_MC/1/sample.inp CobraTFinterfaceTest3/testDummyStep_MC/2/sample.inp' csv = 'CobraTFinterfaceTest3/cobra_out.csv' + [./text] + type = NumericText + output = ' CobraTFinterfaceTest3/testDummyStep_MC/1/vuq_param.txt CobraTFinterfaceTest3/testDummyStep_MC/2/vuq_param.txt' + rel_err = 1e-8 + [../] test_interface_only = True [../] diff --git a/tests/framework/Optimizers/BayesianOptimizer/tests b/tests/framework/Optimizers/BayesianOptimizer/tests index d7240f58f2..6c5bde176d 100644 --- a/tests/framework/Optimizers/BayesianOptimizer/tests +++ b/tests/framework/Optimizers/BayesianOptimizer/tests @@ -3,6 +3,7 @@ type = 'RavenFramework' input = 'Basic/BayesianBasic.xml' skip_if_OS = 'linux' + required_libraries = 'smt' [./data] type = OrderedCSV output = 'Basic/opt_export_0.csv' @@ -17,6 +18,7 @@ type = 'RavenFramework' input = 'Basic/BayesianBasic.xml' skip_if_OS = 'mac,windows' + required_libraries = 'smt' [./data] type = OrderedCSV output = 'Basic/final_opt.csv' @@ -29,6 +31,7 @@ type = 'RavenFramework' input = 'MishraBirdConstrained/BayesianMishraBirdConstrained.xml' skip_if_OS = 'linux' + required_libraries = 'smt' [./data] type = OrderedCSV output = 'MishraBirdConstrained/opt_export_0.csv' @@ -43,6 +46,7 @@ type = 'RavenFramework' input = 'MishraBirdConstrained/BayesianMishraBirdConstrained.xml' skip_if_OS = 'mac,windows' + required_libraries = 'smt' [./data] type = OrderedCSV output = 'MishraBirdConstrained/final_opt.csv' @@ -55,6 +59,7 @@ type = 'RavenFramework' input = 'Matyas/BayesianMatyas.xml' skip_if_OS = 'linux' + required_libraries = 'smt' [./data] type = OrderedCSV output = 'Matyas/opt_export_0.csv' @@ -69,6 +74,7 @@ type = 'RavenFramework' input = 'Matyas/BayesianMatyas.xml' skip_if_OS = 'mac,windows' + required_libraries = 'smt' [./data] type = OrderedCSV output = 'Matyas/final_opt.csv' diff --git a/tests/framework/PostProcessors/LimitSurface/tests b/tests/framework/PostProcessors/LimitSurface/tests index ebd064fb1c..ed29f7d8d4 100644 --- a/tests/framework/PostProcessors/LimitSurface/tests +++ b/tests/framework/PostProcessors/LimitSurface/tests @@ -39,6 +39,7 @@ output = 'limitSurfaceBoundingError/LimitSurfaceWeightedPb_dump.csv' windows_gold = 'limitSurfaceBoundingError/WindowsLimitSurfaceWeightedPb_dump.csv' mac_gold = 'limitSurfaceBoundingError/MacLimitSurfaceWeightedPb_dump.csv' + rel_err = 0.002 [../] [../] diff --git a/tests/framework/Samplers/SparseGrid/tests b/tests/framework/Samplers/SparseGrid/tests index 920842dc28..c7f87d600b 100644 --- a/tests/framework/Samplers/SparseGrid/tests +++ b/tests/framework/Samplers/SparseGrid/tests @@ -62,6 +62,7 @@ input = 'test_scgpc_normal.xml' UnorderedXml = 'scgpc/Ndumprom.xml' csv = 'scgpc/Ndump.csv' + zero_threshold = 1e-12 [../] [./gamma] type = 'RavenFramework' @@ -96,6 +97,7 @@ input = 'test_scgpc_triang.xml' UnorderedXml = 'scgpc/Tdumprom.xml' csv = 'scgpc/Tdump.csv' + zero_threshold = 1e-12 [../] [./exponential] type = 'RavenFramework' diff --git a/tests/framework/pca_adaptive_sgc/gold/Adaptive/dump.xml b/tests/framework/pca_adaptive_sgc/gold/Adaptive/dump.xml index eb862d6176..9a9bbe44ca 100644 --- a/tests/framework/pca_adaptive_sgc/gold/Adaptive/dump.xml +++ b/tests/framework/pca_adaptive_sgc/gold/Adaptive/dump.xml @@ -2,6 +2,8 @@ GAUSSgpcROM + y1,y2 + ans,ans2 1.434 diff --git a/tests/framework/pca_adaptive_sgc/tests b/tests/framework/pca_adaptive_sgc/tests index 1378d63c91..db9dcf1fa9 100644 --- a/tests/framework/pca_adaptive_sgc/tests +++ b/tests/framework/pca_adaptive_sgc/tests @@ -3,7 +3,7 @@ type = 'RavenFramework' input = 'test_adaptive_sgc_pca_analytic.xml' UnorderedCsv = 'Adaptive/data.csv' - UnorderedXml = 'Adaptive/dump.xml' + xml = 'Adaptive/dump.xml' zero_threshold = 1e-12 [../] @@ -35,6 +35,7 @@ UnorderedCsv = 'polynomial/csv_database.csv' UnorderedXml = 'polynomial/stats_td1.xml' #analytic, "Tensor Polynomial (First-Order) with Multivariate Normal Distribution" max_time = 500 # windows test box is slow, so very slow + zero_threshold = 1e-12 [../] [] diff --git a/tests/framework/pca_sparseGridCollocation/tests b/tests/framework/pca_sparseGridCollocation/tests index b10dd0921a..2366c268ea 100644 --- a/tests/framework/pca_sparseGridCollocation/tests +++ b/tests/framework/pca_sparseGridCollocation/tests @@ -35,6 +35,8 @@ input = 'test_poly_correlation.xml' csv = 'polyCorrelation/csv_database.csv' UnorderedXml = 'polyCorrelation/stats_td1.xml' + zero_threshold = 1e-12 + rel_err = 1e-8 [../] [./polyCorrelationMC] diff --git a/tests/framework/tests b/tests/framework/tests index ef382a3403..ede7c77c07 100644 --- a/tests/framework/tests +++ b/tests/framework/tests @@ -228,6 +228,7 @@ input = 'test_redundant_inputs.xml' output = 'RedundantInputs/mc_out.xml RedundantInputs/grid_out.xml' csv = 'RedundantInputs/mc_out.csv RedundantInputs/grid_out.csv' + rel_err = 2.0e-3 [../] [./redundantInputsSCgPC] type = 'RavenFramework' @@ -262,6 +263,7 @@ type = 'RavenFramework' input = 'test_simple_ND_grid_probabilityWeight_value.xml' csv = 'NDGridPWvalue/testPrintPointSet_dump.csv' + rel_err = 1.0e-9 [../] [./LHSVariables]