Davout 0.1.1.dev164__tar.gz → 0.1.1.dev166__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {davout-0.1.1.dev164/source/Davout.egg-info → davout-0.1.1.dev166}/PKG-INFO +1 -1
- {davout-0.1.1.dev164 → davout-0.1.1.dev166}/pyproject.toml +1 -1
- davout-0.1.1.dev166/source/Davout/DeepMech/aa_tests/mecsol_2026_quotient_space/neural_network_trainer.py +553 -0
- {davout-0.1.1.dev164 → davout-0.1.1.dev166}/source/Davout/DeepMech/tool_box/training_tools.py +19 -9
- {davout-0.1.1.dev164 → davout-0.1.1.dev166}/source/Davout/MultiMech/tool_box/binary_tools.py +10 -4
- {davout-0.1.1.dev164 → davout-0.1.1.dev166/source/Davout.egg-info}/PKG-INFO +1 -1
- davout-0.1.1.dev164/source/Davout/DeepMech/aa_tests/mecsol_2026_quotient_space/neural_network_trainer.py +0 -197
- {davout-0.1.1.dev164 → davout-0.1.1.dev166}/LICENSE +0 -0
- {davout-0.1.1.dev164 → davout-0.1.1.dev166}/README.md +0 -0
- {davout-0.1.1.dev164 → davout-0.1.1.dev166}/setup.cfg +0 -0
- {davout-0.1.1.dev164 → davout-0.1.1.dev166}/setup.py +0 -0
- {davout-0.1.1.dev164 → davout-0.1.1.dev166}/source/Davout/CuboidGmsh/__init__.py +0 -0
- {davout-0.1.1.dev164 → davout-0.1.1.dev166}/source/Davout/CuboidGmsh/aa_tests/RVEs/__init__.py +0 -0
- {davout-0.1.1.dev164 → davout-0.1.1.dev166}/source/Davout/CuboidGmsh/aa_tests/RVEs/non_transfinite/RVE_artery.py +0 -0
- {davout-0.1.1.dev164 → davout-0.1.1.dev166}/source/Davout/CuboidGmsh/aa_tests/RVEs/non_transfinite/RVE_matrix_with_fiber.py +0 -0
- {davout-0.1.1.dev164 → davout-0.1.1.dev166}/source/Davout/CuboidGmsh/aa_tests/RVEs/non_transfinite/__init__.py +0 -0
- {davout-0.1.1.dev164 → davout-0.1.1.dev166}/source/Davout/CuboidGmsh/aa_tests/RVEs/non_transfinite/elastin_fiber_creator.py +0 -0
- {davout-0.1.1.dev164 → davout-0.1.1.dev166}/source/Davout/CuboidGmsh/aa_tests/RVEs/transfinite/RVE_artery_transfinite.py +0 -0
- {davout-0.1.1.dev164 → davout-0.1.1.dev166}/source/Davout/CuboidGmsh/aa_tests/RVEs/transfinite/RVE_matrix_with_fiber_transfinite.py +0 -0
- {davout-0.1.1.dev164 → davout-0.1.1.dev166}/source/Davout/CuboidGmsh/aa_tests/RVEs/transfinite/__init__.py +0 -0
- {davout-0.1.1.dev164 → davout-0.1.1.dev166}/source/Davout/CuboidGmsh/aa_tests/RVEs/transfinite/elastin_fiber_creator.py +0 -0
- {davout-0.1.1.dev164 → davout-0.1.1.dev166}/source/Davout/CuboidGmsh/aa_tests/RVEs/transfinite/spherical_RVE.py +0 -0
- {davout-0.1.1.dev164 → davout-0.1.1.dev166}/source/Davout/CuboidGmsh/aa_tests/__init__.py +0 -0
- {davout-0.1.1.dev164 → davout-0.1.1.dev166}/source/Davout/CuboidGmsh/aa_tests/artery/artery_macroscale.py +0 -0
- {davout-0.1.1.dev164 → davout-0.1.1.dev166}/source/Davout/CuboidGmsh/aa_tests/artery/artery_macroscale_ellipsoid.py +0 -0
- {davout-0.1.1.dev164 → davout-0.1.1.dev166}/source/Davout/CuboidGmsh/aa_tests/micropolar_meshes/__init__.py +0 -0
- {davout-0.1.1.dev164 → davout-0.1.1.dev166}/source/Davout/CuboidGmsh/aa_tests/micropolar_meshes/beam_micropolar_case_1.py +0 -0
- {davout-0.1.1.dev164 → davout-0.1.1.dev166}/source/Davout/CuboidGmsh/aa_tests/periodic_meshes/__init__.py +0 -0
- {davout-0.1.1.dev164 → davout-0.1.1.dev166}/source/Davout/CuboidGmsh/aa_tests/periodic_meshes/artery_parameters.py +0 -0
- {davout-0.1.1.dev164 → davout-0.1.1.dev166}/source/Davout/CuboidGmsh/aa_tests/periodic_meshes/fiber_matrix_parameters.py +0 -0
- {davout-0.1.1.dev164 → davout-0.1.1.dev166}/source/Davout/CuboidGmsh/aa_tests/periodic_meshes/periodic_structure.py +0 -0
- {davout-0.1.1.dev164 → davout-0.1.1.dev166}/source/Davout/CuboidGmsh/aa_tests/solids/__init__.py +0 -0
- {davout-0.1.1.dev164 → davout-0.1.1.dev166}/source/Davout/CuboidGmsh/aa_tests/solids/intervertebral_disc.py +0 -0
- {davout-0.1.1.dev164 → davout-0.1.1.dev166}/source/Davout/CuboidGmsh/aa_tests/solids/whole_ensemble_of_geometries.py +0 -0
- {davout-0.1.1.dev164 → davout-0.1.1.dev166}/source/Davout/CuboidGmsh/solids/__init__.py +0 -0
- {davout-0.1.1.dev164 → davout-0.1.1.dev166}/source/Davout/CuboidGmsh/solids/cuboid_cylinders.py +0 -0
- {davout-0.1.1.dev164 → davout-0.1.1.dev166}/source/Davout/CuboidGmsh/solids/cuboid_ellipsoids.py +0 -0
- {davout-0.1.1.dev164 → davout-0.1.1.dev166}/source/Davout/CuboidGmsh/solids/cuboid_generator.py +0 -0
- {davout-0.1.1.dev164 → davout-0.1.1.dev166}/source/Davout/CuboidGmsh/solids/cuboid_helicoids.py +0 -0
- {davout-0.1.1.dev164 → davout-0.1.1.dev166}/source/Davout/CuboidGmsh/solids/cuboid_prisms.py +0 -0
- {davout-0.1.1.dev164 → davout-0.1.1.dev166}/source/Davout/CuboidGmsh/tool_box/__init__.py +0 -0
- {davout-0.1.1.dev164 → davout-0.1.1.dev166}/source/Davout/CuboidGmsh/tool_box/geometric_tools.py +0 -0
- {davout-0.1.1.dev164 → davout-0.1.1.dev166}/source/Davout/CuboidGmsh/tool_box/mesh_data_retriever.py +0 -0
- {davout-0.1.1.dev164 → davout-0.1.1.dev166}/source/Davout/CuboidGmsh/tool_box/meshing_tools.py +0 -0
- {davout-0.1.1.dev164 → davout-0.1.1.dev166}/source/Davout/CuboidGmsh/tool_box/region_finder.py +0 -0
- {davout-0.1.1.dev164 → davout-0.1.1.dev166}/source/Davout/CuboidGmsh/tool_box/verification_tools.py +0 -0
- {davout-0.1.1.dev164 → davout-0.1.1.dev166}/source/Davout/DeepMech/PINNs/Physics/__init__.py +0 -0
- {davout-0.1.1.dev164 → davout-0.1.1.dev166}/source/Davout/DeepMech/PINNs/Physics/elasticity_equation.py +0 -0
- {davout-0.1.1.dev164 → davout-0.1.1.dev166}/source/Davout/DeepMech/PINNs/__init__.py +0 -0
- {davout-0.1.1.dev164 → davout-0.1.1.dev166}/source/Davout/DeepMech/__init__.py +0 -0
- {davout-0.1.1.dev164 → davout-0.1.1.dev166}/source/Davout/DeepMech/aa_tests/SVD_framework/box_with_imposed_displacement_gradient.py +0 -0
- {davout-0.1.1.dev164 → davout-0.1.1.dev166}/source/Davout/DeepMech/aa_tests/SVD_framework/box_with_young_modulus_field.py +0 -0
- {davout-0.1.1.dev164 → davout-0.1.1.dev166}/source/Davout/DeepMech/aa_tests/SVD_framework/dataset_generator.py +0 -0
- {davout-0.1.1.dev164 → davout-0.1.1.dev166}/source/Davout/DeepMech/aa_tests/SVD_framework/input_data_filler.py +0 -0
- {davout-0.1.1.dev164 → davout-0.1.1.dev166}/source/Davout/DeepMech/aa_tests/SVD_framework/kinematics_surrogate_model.py +0 -0
- {davout-0.1.1.dev164 → davout-0.1.1.dev166}/source/Davout/DeepMech/aa_tests/SVD_framework/young_modulus_field_generator.py +0 -0
- {davout-0.1.1.dev164 → davout-0.1.1.dev166}/source/Davout/DeepMech/aa_tests/heat_equation.py +0 -0
- {davout-0.1.1.dev164 → davout-0.1.1.dev166}/source/Davout/DeepMech/aa_tests/mecsol_2026_quotient_space/box_with_imposed_displacement_gradient.py +0 -0
- {davout-0.1.1.dev164 → davout-0.1.1.dev166}/source/Davout/DeepMech/aa_tests/mecsol_2026_quotient_space/box_with_young_modulus_field.py +0 -0
- {davout-0.1.1.dev164 → davout-0.1.1.dev166}/source/Davout/DeepMech/aa_tests/mecsol_2026_quotient_space/dataset_generator.py +0 -0
- {davout-0.1.1.dev164 → davout-0.1.1.dev166}/source/Davout/DeepMech/aa_tests/mecsol_2026_quotient_space/input_data_filler.py +0 -0
- {davout-0.1.1.dev164 → davout-0.1.1.dev166}/source/Davout/DeepMech/aa_tests/mecsol_2026_quotient_space/young_modulus_field_generator.py +0 -0
- {davout-0.1.1.dev164 → davout-0.1.1.dev166}/source/Davout/DeepMech/aa_tests/tests_tool_box/test_ANN_optimization.py +0 -0
- {davout-0.1.1.dev164 → davout-0.1.1.dev166}/source/Davout/DeepMech/aa_tests/tests_tool_box/test_ANN_tools.py +0 -0
- {davout-0.1.1.dev164 → davout-0.1.1.dev166}/source/Davout/DeepMech/aa_tests/tests_tool_box/test_SVD_based_NNs.py +0 -0
- {davout-0.1.1.dev164 → davout-0.1.1.dev166}/source/Davout/DeepMech/aa_tests/tests_tool_box/test_SVD_tools.py +0 -0
- {davout-0.1.1.dev164 → davout-0.1.1.dev166}/source/Davout/DeepMech/aa_tests/tests_tool_box/test_convex_and_partially_convex_input_NNs.py +0 -0
- {davout-0.1.1.dev164 → davout-0.1.1.dev166}/source/Davout/DeepMech/aa_tests/tests_tool_box/test_math_tools.py +0 -0
- {davout-0.1.1.dev164 → davout-0.1.1.dev166}/source/Davout/DeepMech/aa_tests/tests_tool_box/test_quotient_space_NNs.py +0 -0
- {davout-0.1.1.dev164 → davout-0.1.1.dev166}/source/Davout/DeepMech/aa_tests/tests_tool_box/test_tensor_tools.py +0 -0
- {davout-0.1.1.dev164 → davout-0.1.1.dev166}/source/Davout/DeepMech/custom_architectures/SVD_quotient_space.py +0 -0
- {davout-0.1.1.dev164 → davout-0.1.1.dev166}/source/Davout/DeepMech/custom_architectures/__init__.py +0 -0
- {davout-0.1.1.dev164 → davout-0.1.1.dev166}/source/Davout/DeepMech/custom_architectures/convexity_concerned_NNs.py +0 -0
- {davout-0.1.1.dev164 → davout-0.1.1.dev166}/source/Davout/DeepMech/custom_architectures/gated_quotient_space.py +0 -0
- {davout-0.1.1.dev164 → davout-0.1.1.dev166}/source/Davout/DeepMech/custom_architectures/generic_feed_forward.py +0 -0
- {davout-0.1.1.dev164 → davout-0.1.1.dev166}/source/Davout/DeepMech/tool_box/ANN_tools.py +0 -0
- {davout-0.1.1.dev164 → davout-0.1.1.dev166}/source/Davout/DeepMech/tool_box/SVD_tools.py +0 -0
- {davout-0.1.1.dev164 → davout-0.1.1.dev166}/source/Davout/DeepMech/tool_box/__init__.py +0 -0
- {davout-0.1.1.dev164 → davout-0.1.1.dev166}/source/Davout/DeepMech/tool_box/activation_function_utilities.py +0 -0
- {davout-0.1.1.dev164 → davout-0.1.1.dev166}/source/Davout/DeepMech/tool_box/custom_activation_functions.py +0 -0
- {davout-0.1.1.dev164 → davout-0.1.1.dev166}/source/Davout/DeepMech/tool_box/differentiation_tools.py +0 -0
- {davout-0.1.1.dev164 → davout-0.1.1.dev166}/source/Davout/DeepMech/tool_box/loss_assembler_classes.py +0 -0
- {davout-0.1.1.dev164 → davout-0.1.1.dev166}/source/Davout/DeepMech/tool_box/loss_tools.py +0 -0
- {davout-0.1.1.dev164 → davout-0.1.1.dev166}/source/Davout/DeepMech/tool_box/math_tools.py +0 -0
- {davout-0.1.1.dev164 → davout-0.1.1.dev166}/source/Davout/DeepMech/tool_box/numerical_tools.py +0 -0
- {davout-0.1.1.dev164 → davout-0.1.1.dev166}/source/Davout/DeepMech/tool_box/parameters_tools.py +0 -0
- {davout-0.1.1.dev164 → davout-0.1.1.dev166}/source/Davout/DeepMech/tool_box/tensor_tools.py +0 -0
- {davout-0.1.1.dev164 → davout-0.1.1.dev166}/source/Davout/FENN/__init__.py +0 -0
- {davout-0.1.1.dev164 → davout-0.1.1.dev166}/source/Davout/FENN/aa_tests/REPL_experiments.py +0 -0
- {davout-0.1.1.dev164 → davout-0.1.1.dev166}/source/Davout/FENN/aa_tests/__init__.py +0 -0
- {davout-0.1.1.dev164 → davout-0.1.1.dev166}/source/Davout/FENN/aa_tests/optimization/__init__.py +0 -0
- {davout-0.1.1.dev164 → davout-0.1.1.dev166}/source/Davout/FENN/aa_tests/optimization/tests_optimization_methods.py +0 -0
- {davout-0.1.1.dev164 → davout-0.1.1.dev166}/source/Davout/FENN/aa_tests/tests_batching.py +0 -0
- {davout-0.1.1.dev164 → davout-0.1.1.dev166}/source/Davout/FENN/aa_tests/tests_finite_elements.py +0 -0
- {davout-0.1.1.dev164 → davout-0.1.1.dev166}/source/Davout/FENN/aa_tests/tests_loss_function.py +0 -0
- {davout-0.1.1.dev164 → davout-0.1.1.dev166}/source/Davout/FENN/aa_tests/tests_physics.py +0 -0
- {davout-0.1.1.dev164 → davout-0.1.1.dev166}/source/Davout/FENN/aa_tests/unidimensional/__init__.py +0 -0
- {davout-0.1.1.dev164 → davout-0.1.1.dev166}/source/Davout/FENN/aa_tests/unidimensional/bar_fea.py +0 -0
- {davout-0.1.1.dev164 → davout-0.1.1.dev166}/source/Davout/FENN/aa_tests/unidimensional/hyperelastic_1D_energies.py +0 -0
- {davout-0.1.1.dev164 → davout-0.1.1.dev166}/source/Davout/FENN/aa_tests/unidimensional/variational_tools.py +0 -0
- {davout-0.1.1.dev164 → davout-0.1.1.dev166}/source/Davout/FENN/assembly/__init__.py +0 -0
- {davout-0.1.1.dev164 → davout-0.1.1.dev166}/source/Davout/FENN/assembly/body_forces_work.py +0 -0
- {davout-0.1.1.dev164 → davout-0.1.1.dev166}/source/Davout/FENN/assembly/dirichlet_boundary_conditions_enforcer.py +0 -0
- {davout-0.1.1.dev164 → davout-0.1.1.dev166}/source/Davout/FENN/assembly/hyperelastic_internal_work.py +0 -0
- {davout-0.1.1.dev164 → davout-0.1.1.dev166}/source/Davout/FENN/assembly/surface_forces_work.py +0 -0
- {davout-0.1.1.dev164 → davout-0.1.1.dev166}/source/Davout/FENN/constitutive_models/__init__.py +0 -0
- {davout-0.1.1.dev164 → davout-0.1.1.dev166}/source/Davout/FENN/constitutive_models/hyperelastic_isotropic_models.py +0 -0
- {davout-0.1.1.dev164 → davout-0.1.1.dev166}/source/Davout/FENN/finite_elements/__init__.py +0 -0
- {davout-0.1.1.dev164 → davout-0.1.1.dev166}/source/Davout/FENN/finite_elements/elements_manager.py +0 -0
- {davout-0.1.1.dev164 → davout-0.1.1.dev166}/source/Davout/FENN/finite_elements/finite_element_dispatcher.py +0 -0
- {davout-0.1.1.dev164 → davout-0.1.1.dev166}/source/Davout/FENN/finite_elements/surface_elements/__init__.py +0 -0
- {davout-0.1.1.dev164 → davout-0.1.1.dev166}/source/Davout/FENN/finite_elements/surface_elements/triangles.py +0 -0
- {davout-0.1.1.dev164 → davout-0.1.1.dev166}/source/Davout/FENN/finite_elements/volume_elements/__init__.py +0 -0
- {davout-0.1.1.dev164 → davout-0.1.1.dev166}/source/Davout/FENN/finite_elements/volume_elements/tetrahedrons.py +0 -0
- {davout-0.1.1.dev164 → davout-0.1.1.dev166}/source/Davout/FENN/optimization/__init__.py +0 -0
- {davout-0.1.1.dev164 → davout-0.1.1.dev166}/source/Davout/FENN/optimization/conditioning_matrices.py +0 -0
- {davout-0.1.1.dev164 → davout-0.1.1.dev166}/source/Davout/FENN/optimization/loss_functions.py +0 -0
- {davout-0.1.1.dev164 → davout-0.1.1.dev166}/source/Davout/FENN/optimization/neural_network_assembler.py +0 -0
- {davout-0.1.1.dev164 → davout-0.1.1.dev166}/source/Davout/FENN/optimization/objective_function.py +0 -0
- {davout-0.1.1.dev164 → davout-0.1.1.dev166}/source/Davout/FENN/physics/compressible_cauchy_hyperelasticy.py +0 -0
- {davout-0.1.1.dev164 → davout-0.1.1.dev166}/source/Davout/FENN/tool_box/__init__.py +0 -0
- {davout-0.1.1.dev164 → davout-0.1.1.dev166}/source/Davout/FENN/tool_box/constitutive_tools.py +0 -0
- {davout-0.1.1.dev164 → davout-0.1.1.dev166}/source/Davout/FENN/tool_box/dirichlet_loading_tools.py +0 -0
- {davout-0.1.1.dev164 → davout-0.1.1.dev166}/source/Davout/FENN/tool_box/math_tools.py +0 -0
- {davout-0.1.1.dev164 → davout-0.1.1.dev166}/source/Davout/FENN/tool_box/mesh_info_tools.py +0 -0
- {davout-0.1.1.dev164 → davout-0.1.1.dev166}/source/Davout/FENN/tool_box/mesh_tools.py +0 -0
- {davout-0.1.1.dev164 → davout-0.1.1.dev166}/source/Davout/FENN/tool_box/neumann_loading_tools.py +0 -0
- {davout-0.1.1.dev164 → davout-0.1.1.dev166}/source/Davout/FENN/tool_box/node_ordering.py +0 -0
- {davout-0.1.1.dev164 → davout-0.1.1.dev166}/source/Davout/FENN/tool_box/optimization_tools.py +0 -0
- {davout-0.1.1.dev164 → davout-0.1.1.dev166}/source/Davout/FENN/tool_box/parametric_curves_tools.py +0 -0
- {davout-0.1.1.dev164 → davout-0.1.1.dev166}/source/Davout/FENN/tool_box/sensitivity_tools.py +0 -0
- {davout-0.1.1.dev164 → davout-0.1.1.dev166}/source/Davout/FENN/tool_box/tensorflow_utilities.py +0 -0
- {davout-0.1.1.dev164 → davout-0.1.1.dev166}/source/Davout/GraphUtilities/__init__.py +0 -0
- {davout-0.1.1.dev164 → davout-0.1.1.dev166}/source/Davout/GraphUtilities/aa_tests/__init__.py +0 -0
- {davout-0.1.1.dev164 → davout-0.1.1.dev166}/source/Davout/GraphUtilities/aa_tests/cauchy_tetrahedron.py +0 -0
- {davout-0.1.1.dev164 → davout-0.1.1.dev166}/source/Davout/GraphUtilities/aa_tests/continuum_mechanics_potato_collage.py +0 -0
- {davout-0.1.1.dev164 → davout-0.1.1.dev166}/source/Davout/GraphUtilities/aa_tests/fake_book_spines.py +0 -0
- {davout-0.1.1.dev164 → davout-0.1.1.dev166}/source/Davout/GraphUtilities/aa_tests/null_space_architecture.py +0 -0
- {davout-0.1.1.dev164 → davout-0.1.1.dev166}/source/Davout/GraphUtilities/aa_tests/strain_tensors.py +0 -0
- {davout-0.1.1.dev164 → davout-0.1.1.dev166}/source/Davout/GraphUtilities/aa_tests/tests_collage_tools.py +0 -0
- {davout-0.1.1.dev164 → davout-0.1.1.dev166}/source/Davout/GraphUtilities/aa_tests/tests_delaunay.py +0 -0
- {davout-0.1.1.dev164 → davout-0.1.1.dev166}/source/Davout/GraphUtilities/aa_tests/tests_paraview_tools.py +0 -0
- {davout-0.1.1.dev164 → davout-0.1.1.dev166}/source/Davout/GraphUtilities/aa_tests/tests_plotting_tools.py +0 -0
- {davout-0.1.1.dev164 → davout-0.1.1.dev166}/source/Davout/GraphUtilities/collage_tools.py +0 -0
- {davout-0.1.1.dev164 → davout-0.1.1.dev166}/source/Davout/GraphUtilities/paraview_tools.py +0 -0
- {davout-0.1.1.dev164 → davout-0.1.1.dev166}/source/Davout/GraphUtilities/plotting_tools.py +0 -0
- {davout-0.1.1.dev164 → davout-0.1.1.dev166}/source/Davout/GraphUtilities/tool_box/__init__.py +0 -0
- {davout-0.1.1.dev164 → davout-0.1.1.dev166}/source/Davout/GraphUtilities/tool_box/arrows_lines_tools.py +0 -0
- {davout-0.1.1.dev164 → davout-0.1.1.dev166}/source/Davout/GraphUtilities/tool_box/box_and_markers_classes.py +0 -0
- {davout-0.1.1.dev164 → davout-0.1.1.dev166}/source/Davout/GraphUtilities/tool_box/box_tools.py +0 -0
- {davout-0.1.1.dev164 → davout-0.1.1.dev166}/source/Davout/GraphUtilities/tool_box/collage_classes.py +0 -0
- {davout-0.1.1.dev164 → davout-0.1.1.dev166}/source/Davout/GraphUtilities/tool_box/curves_setter.py +0 -0
- {davout-0.1.1.dev164 → davout-0.1.1.dev166}/source/Davout/GraphUtilities/tool_box/image_tools.py +0 -0
- {davout-0.1.1.dev164 → davout-0.1.1.dev166}/source/Davout/GraphUtilities/tool_box/interactivity_tools.py +0 -0
- {davout-0.1.1.dev164 → davout-0.1.1.dev166}/source/Davout/GraphUtilities/tool_box/paraview_scripts.py +0 -0
- {davout-0.1.1.dev164 → davout-0.1.1.dev166}/source/Davout/GraphUtilities/tool_box/perspective_tools.py +0 -0
- {davout-0.1.1.dev164 → davout-0.1.1.dev166}/source/Davout/GraphUtilities/tool_box/text_excerpt_tools.py +0 -0
- {davout-0.1.1.dev164 → davout-0.1.1.dev166}/source/Davout/LaTeXUtilities/LaTeXUtilities.sty +0 -0
- {davout-0.1.1.dev164 → davout-0.1.1.dev166}/source/Davout/LaTeXUtilities/__init__.py +0 -0
- {davout-0.1.1.dev164 → davout-0.1.1.dev166}/source/Davout/LaTeXUtilities/aa_tests/__init__.py +0 -0
- {davout-0.1.1.dev164 → davout-0.1.1.dev166}/source/Davout/LaTeXUtilities/aa_tests/latex_parser_tests.py +0 -0
- {davout-0.1.1.dev164 → davout-0.1.1.dev166}/source/Davout/LaTeXUtilities/latex_parser.py +0 -0
- {davout-0.1.1.dev164 → davout-0.1.1.dev166}/source/Davout/LaTeXUtilities/tool_box/__init__.py +0 -0
- {davout-0.1.1.dev164 → davout-0.1.1.dev166}/source/Davout/LaTeXUtilities/tool_box/command_tools.py +0 -0
- {davout-0.1.1.dev164 → davout-0.1.1.dev166}/source/Davout/LaTeXUtilities/tool_box/parsing_tools.py +0 -0
- {davout-0.1.1.dev164 → davout-0.1.1.dev166}/source/Davout/LaTeXUtilities/tool_box/sty_file_tools.py +0 -0
- {davout-0.1.1.dev164 → davout-0.1.1.dev166}/source/Davout/MultiMech/__init__.py +0 -0
- {davout-0.1.1.dev164 → davout-0.1.1.dev166}/source/Davout/MultiMech/aa_tests_and_examples/heat_transfer/heat_box.py +0 -0
- {davout-0.1.1.dev164 → davout-0.1.1.dev166}/source/Davout/MultiMech/aa_tests_and_examples/hyperelasticity/beam_with_fibers.py +0 -0
- {davout-0.1.1.dev164 → davout-0.1.1.dev166}/source/Davout/MultiMech/aa_tests_and_examples/hyperelasticity/box_with_young_modulus_field.py +0 -0
- {davout-0.1.1.dev164 → davout-0.1.1.dev166}/source/Davout/MultiMech/aa_tests_and_examples/hyperelasticity/disc_HGO.py +0 -0
- {davout-0.1.1.dev164 → davout-0.1.1.dev166}/source/Davout/MultiMech/aa_tests_and_examples/hyperelasticity/disc_neo_hookean.py +0 -0
- {davout-0.1.1.dev164 → davout-0.1.1.dev166}/source/Davout/MultiMech/aa_tests_and_examples/hyperelasticity/disc_neo_hookean_incompressible.py +0 -0
- {davout-0.1.1.dev164 → davout-0.1.1.dev166}/source/Davout/MultiMech/aa_tests_and_examples/hyperelasticity/hyperelastic_box.py +0 -0
- {davout-0.1.1.dev164 → davout-0.1.1.dev166}/source/Davout/MultiMech/aa_tests_and_examples/hyperelasticity/incompressible_hyperelastic_box.py +0 -0
- {davout-0.1.1.dev164 → davout-0.1.1.dev166}/source/Davout/MultiMech/aa_tests_and_examples/hyperelasticity/intervertebral_disc/cylindrical_coordinates_material_property.py +0 -0
- {davout-0.1.1.dev164 → davout-0.1.1.dev166}/source/Davout/MultiMech/aa_tests_and_examples/hyperelasticity/intervertebral_disc/disc_HGO.py +0 -0
- {davout-0.1.1.dev164 → davout-0.1.1.dev166}/source/Davout/MultiMech/aa_tests_and_examples/hyperelasticity/intervertebral_disc/local_coordinate_system_generation.py +0 -0
- {davout-0.1.1.dev164 → davout-0.1.1.dev166}/source/Davout/MultiMech/aa_tests_and_examples/hyperelasticity/parallel_hyperelastic_box.py +0 -0
- {davout-0.1.1.dev164 → davout-0.1.1.dev166}/source/Davout/MultiMech/aa_tests_and_examples/hyperelasticity/parallel_incompressible_box.py +0 -0
- {davout-0.1.1.dev164 → davout-0.1.1.dev166}/source/Davout/MultiMech/aa_tests_and_examples/hyperelasticity/read_dofs_in_volume.py +0 -0
- {davout-0.1.1.dev164 → davout-0.1.1.dev166}/source/Davout/MultiMech/aa_tests_and_examples/hyperelasticity/young_modulus_field.py +0 -0
- {davout-0.1.1.dev164 → davout-0.1.1.dev166}/source/Davout/MultiMech/aa_tests_and_examples/micropolar/bending_case/beam_with_fibers_macroscale.py +0 -0
- {davout-0.1.1.dev164 → davout-0.1.1.dev166}/source/Davout/MultiMech/aa_tests_and_examples/micropolar/bending_case/beam_with_fibers_microscale.py +0 -0
- {davout-0.1.1.dev164 → davout-0.1.1.dev166}/source/Davout/MultiMech/aa_tests_and_examples/micropolar/deformation_laboratory/microscale_deformation_lab.py +0 -0
- {davout-0.1.1.dev164 → davout-0.1.1.dev166}/source/Davout/MultiMech/aa_tests_and_examples/micropolar/disc_micropolar_neo_hookean.py +0 -0
- {davout-0.1.1.dev164 → davout-0.1.1.dev166}/source/Davout/MultiMech/aa_tests_and_examples/micropolar/old_tests/Bauer_et_al/beam.py +0 -0
- {davout-0.1.1.dev164 → davout-0.1.1.dev166}/source/Davout/MultiMech/aa_tests_and_examples/micropolar/old_tests/Bauer_et_al/beam_neo_hookean.py +0 -0
- {davout-0.1.1.dev164 → davout-0.1.1.dev166}/source/Davout/MultiMech/aa_tests_and_examples/micropolar/old_tests/Bauer_et_al/beam_neo_hookean_pure_dolfin.py +0 -0
- {davout-0.1.1.dev164 → davout-0.1.1.dev166}/source/Davout/MultiMech/aa_tests_and_examples/micropolar/old_tests/Bauer_et_al/beam_neo_hookean_pure_dolfin_old.py +0 -0
- {davout-0.1.1.dev164 → davout-0.1.1.dev166}/source/Davout/MultiMech/aa_tests_and_examples/micropolar/old_tests/Suh_et_al/suh_implementation.py +0 -0
- {davout-0.1.1.dev164 → davout-0.1.1.dev166}/source/Davout/MultiMech/aa_tests_and_examples/micropolar/old_tests/micropolar_with_homogenization.py +0 -0
- {davout-0.1.1.dev164 → davout-0.1.1.dev166}/source/Davout/MultiMech/aa_tests_and_examples/micropolar/old_tests/micropolar_with_homogenization_original.py +0 -0
- {davout-0.1.1.dev164 → davout-0.1.1.dev166}/source/Davout/MultiMech/aa_tests_and_examples/micropolar/old_tests/tools_homogenization.py +0 -0
- {davout-0.1.1.dev164 → davout-0.1.1.dev166}/source/Davout/MultiMech/aa_tests_and_examples/micropolar/old_tests/tools_io.py +0 -0
- {davout-0.1.1.dev164 → davout-0.1.1.dev166}/source/Davout/MultiMech/aa_tests_and_examples/micropolar/stress_plots.py +0 -0
- {davout-0.1.1.dev164 → davout-0.1.1.dev166}/source/Davout/MultiMech/aa_tests_and_examples/micropolar/tangent_operators/numerical_differentiation.py +0 -0
- {davout-0.1.1.dev164 → davout-0.1.1.dev166}/source/Davout/MultiMech/aa_tests_and_examples/micropolar/tangent_operators/numerical_differentiation_second_elasticity_tensor.py +0 -0
- {davout-0.1.1.dev164 → davout-0.1.1.dev166}/source/Davout/MultiMech/aa_tests_and_examples/micropolar/tangent_operators/tangent_operator_plotter.py +0 -0
- {davout-0.1.1.dev164 → davout-0.1.1.dev166}/source/Davout/MultiMech/aa_tests_and_examples/micropolar/torsion_case/beam_with_fibers_macroscale.py +0 -0
- {davout-0.1.1.dev164 → davout-0.1.1.dev166}/source/Davout/MultiMech/aa_tests_and_examples/micropolar/torsion_case/beam_with_fibers_microscale.py +0 -0
- {davout-0.1.1.dev164 → davout-0.1.1.dev166}/source/Davout/MultiMech/aa_tests_and_examples/micropolar/traction_case/beam_with_fibers_macroscale.py +0 -0
- {davout-0.1.1.dev164 → davout-0.1.1.dev166}/source/Davout/MultiMech/aa_tests_and_examples/micropolar/traction_case/beam_with_fibers_microscale.py +0 -0
- {davout-0.1.1.dev164 → davout-0.1.1.dev166}/source/Davout/MultiMech/aa_tests_and_examples/minimal_working_examples_forum/curve_fitting.py +0 -0
- {davout-0.1.1.dev164 → davout-0.1.1.dev166}/source/Davout/MultiMech/aa_tests_and_examples/minimal_working_examples_forum/cylindrical_coordinates_field.py +0 -0
- {davout-0.1.1.dev164 → davout-0.1.1.dev166}/source/Davout/MultiMech/aa_tests_and_examples/minimal_working_examples_forum/cylindrical_coordinates_material_property.py +0 -0
- {davout-0.1.1.dev164 → davout-0.1.1.dev166}/source/Davout/MultiMech/aa_tests_and_examples/minimal_working_examples_forum/elasticity_tensor.py +0 -0
- {davout-0.1.1.dev164 → davout-0.1.1.dev166}/source/Davout/MultiMech/aa_tests_and_examples/minimal_working_examples_forum/incompressible.py +0 -0
- {davout-0.1.1.dev164 → davout-0.1.1.dev166}/source/Davout/MultiMech/aa_tests_and_examples/minimal_working_examples_forum/linear_expression_test.py +0 -0
- {davout-0.1.1.dev164 → davout-0.1.1.dev166}/source/Davout/MultiMech/aa_tests_and_examples/minimal_working_examples_forum/petsc_2D.py +0 -0
- {davout-0.1.1.dev164 → davout-0.1.1.dev166}/source/Davout/MultiMech/aa_tests_and_examples/minimal_working_examples_forum/test_periodic.py +0 -0
- {davout-0.1.1.dev164 → davout-0.1.1.dev166}/source/Davout/MultiMech/aa_tests_and_examples/minimal_working_examples_forum/test_periodic_class.py +0 -0
- {davout-0.1.1.dev164 → davout-0.1.1.dev166}/source/Davout/MultiMech/aa_tests_and_examples/minimal_working_examples_forum/test_shifted_field.py +0 -0
- {davout-0.1.1.dev164 → davout-0.1.1.dev166}/source/Davout/MultiMech/aa_tests_and_examples/minimal_working_examples_forum/teste_afim.py +0 -0
- {davout-0.1.1.dev164 → davout-0.1.1.dev166}/source/Davout/MultiMech/aa_tests_and_examples/minimal_working_examples_forum/working_example_dictionaries.py +0 -0
- {davout-0.1.1.dev164 → davout-0.1.1.dev166}/source/Davout/MultiMech/aa_tests_and_examples/multiscale/hyperelasticity/beam_with_fibers_microscale.py +0 -0
- {davout-0.1.1.dev164 → davout-0.1.1.dev166}/source/Davout/MultiMech/aa_tests_and_examples/physics_prototypes/compressible_hyperelasticity.py +0 -0
- {davout-0.1.1.dev164 → davout-0.1.1.dev166}/source/Davout/MultiMech/aa_tests_and_examples/physics_prototypes/incompressible_hyperelasticity.py +0 -0
- {davout-0.1.1.dev164 → davout-0.1.1.dev166}/source/Davout/MultiMech/aa_tests_and_examples/test_meshes/beam_gmsh.py +0 -0
- {davout-0.1.1.dev164 → davout-0.1.1.dev166}/source/Davout/MultiMech/aa_tests_and_examples/test_meshes_paths.py +0 -0
- {davout-0.1.1.dev164 → davout-0.1.1.dev166}/source/Davout/MultiMech/aa_tests_and_examples/various_physics_tests.py +0 -0
- {davout-0.1.1.dev164 → davout-0.1.1.dev166}/source/Davout/MultiMech/constitutive_models/__init__.py +0 -0
- {davout-0.1.1.dev164 → davout-0.1.1.dev166}/source/Davout/MultiMech/constitutive_models/heat_transfer/isotropic_heat_conduction.py +0 -0
- {davout-0.1.1.dev164 → davout-0.1.1.dev166}/source/Davout/MultiMech/constitutive_models/hyperelasticity/__init__.py +0 -0
- {davout-0.1.1.dev164 → davout-0.1.1.dev166}/source/Davout/MultiMech/constitutive_models/hyperelasticity/anisotropic_hyperelasticity.py +0 -0
- {davout-0.1.1.dev164 → davout-0.1.1.dev166}/source/Davout/MultiMech/constitutive_models/hyperelasticity/isotropic_hyperelasticity.py +0 -0
- {davout-0.1.1.dev164 → davout-0.1.1.dev166}/source/Davout/MultiMech/constitutive_models/hyperelasticity/micropolar_hyperelasticity.py +0 -0
- {davout-0.1.1.dev164 → davout-0.1.1.dev166}/source/Davout/MultiMech/multiscale/__init__.py +0 -0
- {davout-0.1.1.dev164 → davout-0.1.1.dev166}/source/Davout/MultiMech/multiscale/multiscale_boundary_conditions/__init__.py +0 -0
- {davout-0.1.1.dev164 → davout-0.1.1.dev166}/source/Davout/MultiMech/multiscale/multiscale_boundary_conditions/multiscale_classes.py +0 -0
- {davout-0.1.1.dev164 → davout-0.1.1.dev166}/source/Davout/MultiMech/multiscale/multiscale_boundary_conditions/multiscale_expressions.py +0 -0
- {davout-0.1.1.dev164 → davout-0.1.1.dev166}/source/Davout/MultiMech/multiscale/multiscale_hyperelasticity.py +0 -0
- {davout-0.1.1.dev164 → davout-0.1.1.dev166}/source/Davout/MultiMech/multiscale/multiscale_micropolar.py +0 -0
- {davout-0.1.1.dev164 → davout-0.1.1.dev166}/source/Davout/MultiMech/physics/__init__.py +0 -0
- {davout-0.1.1.dev164 → davout-0.1.1.dev166}/source/Davout/MultiMech/physics/hyperelastic_cauchy_continuum.py +0 -0
- {davout-0.1.1.dev164 → davout-0.1.1.dev166}/source/Davout/MultiMech/physics/hyperelastic_incompressible_cauchy_continuum.py +0 -0
- {davout-0.1.1.dev164 → davout-0.1.1.dev166}/source/Davout/MultiMech/physics/hyperelastic_micropolar_continuum.py +0 -0
- {davout-0.1.1.dev164 → davout-0.1.1.dev166}/source/Davout/MultiMech/physics/steady_state_heat_transfer.py +0 -0
- {davout-0.1.1.dev164 → davout-0.1.1.dev166}/source/Davout/MultiMech/post_processes/__init__.py +0 -0
- {davout-0.1.1.dev164 → davout-0.1.1.dev166}/source/Davout/MultiMech/post_processes/post_processes_classes.py +0 -0
- {davout-0.1.1.dev164 → davout-0.1.1.dev166}/source/Davout/MultiMech/post_processes/post_processes_functions.py +0 -0
- {davout-0.1.1.dev164 → davout-0.1.1.dev166}/source/Davout/MultiMech/tool_box/__init__.py +0 -0
- {davout-0.1.1.dev164 → davout-0.1.1.dev166}/source/Davout/MultiMech/tool_box/body_forces_loading_tools.py +0 -0
- {davout-0.1.1.dev164 → davout-0.1.1.dev166}/source/Davout/MultiMech/tool_box/boundary_conditions_tools.py +0 -0
- {davout-0.1.1.dev164 → davout-0.1.1.dev166}/source/Davout/MultiMech/tool_box/constitutive_tools.py +0 -0
- {davout-0.1.1.dev164 → davout-0.1.1.dev166}/source/Davout/MultiMech/tool_box/dirichlet_load_tools.py +0 -0
- {davout-0.1.1.dev164 → davout-0.1.1.dev166}/source/Davout/MultiMech/tool_box/expressions_tools.py +0 -0
- {davout-0.1.1.dev164 → davout-0.1.1.dev166}/source/Davout/MultiMech/tool_box/functional_tools.py +0 -0
- {davout-0.1.1.dev164 → davout-0.1.1.dev166}/source/Davout/MultiMech/tool_box/homogenization_tools.py +0 -0
- {davout-0.1.1.dev164 → davout-0.1.1.dev166}/source/Davout/MultiMech/tool_box/mesh_handling_tools.py +0 -0
- {davout-0.1.1.dev164 → davout-0.1.1.dev166}/source/Davout/MultiMech/tool_box/multiscale_boundary_conditions_tools.py +0 -0
- {davout-0.1.1.dev164 → davout-0.1.1.dev166}/source/Davout/MultiMech/tool_box/numerical_tools.py +0 -0
- {davout-0.1.1.dev164 → davout-0.1.1.dev166}/source/Davout/MultiMech/tool_box/parallelization_tools.py +0 -0
- {davout-0.1.1.dev164 → davout-0.1.1.dev166}/source/Davout/MultiMech/tool_box/post_processing_tools.py +0 -0
- {davout-0.1.1.dev164 → davout-0.1.1.dev166}/source/Davout/MultiMech/tool_box/pseudotime_stepping_tools.py +0 -0
- {davout-0.1.1.dev164 → davout-0.1.1.dev166}/source/Davout/MultiMech/tool_box/read_write_tools.py +0 -0
- {davout-0.1.1.dev164 → davout-0.1.1.dev166}/source/Davout/MultiMech/tool_box/surface_loading_tools.py +0 -0
- {davout-0.1.1.dev164 → davout-0.1.1.dev166}/source/Davout/MultiMech/tool_box/tensor_tools.py +0 -0
- {davout-0.1.1.dev164 → davout-0.1.1.dev166}/source/Davout/MultiMech/tool_box/variational_tools.py +0 -0
- {davout-0.1.1.dev164 → davout-0.1.1.dev166}/source/Davout/MultiMech/tool_box/weak_boundary_conditions_tools.py +0 -0
- {davout-0.1.1.dev164 → davout-0.1.1.dev166}/source/Davout/PythonicUtilities/__init__.py +0 -0
- {davout-0.1.1.dev164 → davout-0.1.1.dev166}/source/Davout/PythonicUtilities/aa_tests/__init__.py +0 -0
- {davout-0.1.1.dev164 → davout-0.1.1.dev166}/source/Davout/PythonicUtilities/aa_tests/tests_template.py +0 -0
- {davout-0.1.1.dev164 → davout-0.1.1.dev166}/source/Davout/PythonicUtilities/aa_tests/txt_tests.py +0 -0
- {davout-0.1.1.dev164 → davout-0.1.1.dev166}/source/Davout/PythonicUtilities/coordinate_systems_tools.py +0 -0
- {davout-0.1.1.dev164 → davout-0.1.1.dev166}/source/Davout/PythonicUtilities/dictionary_tools.py +0 -0
- {davout-0.1.1.dev164 → davout-0.1.1.dev166}/source/Davout/PythonicUtilities/file_handling_tools.py +0 -0
- {davout-0.1.1.dev164 → davout-0.1.1.dev166}/source/Davout/PythonicUtilities/fonts/CMU_Serif_Roman.ttf +0 -0
- {davout-0.1.1.dev164 → davout-0.1.1.dev166}/source/Davout/PythonicUtilities/function_tools.py +0 -0
- {davout-0.1.1.dev164 → davout-0.1.1.dev166}/source/Davout/PythonicUtilities/interpolation_tools.py +0 -0
- {davout-0.1.1.dev164 → davout-0.1.1.dev166}/source/Davout/PythonicUtilities/math_experiments.py +0 -0
- {davout-0.1.1.dev164 → davout-0.1.1.dev166}/source/Davout/PythonicUtilities/numpy_tools.py +0 -0
- {davout-0.1.1.dev164 → davout-0.1.1.dev166}/source/Davout/PythonicUtilities/package_tools.py +0 -0
- {davout-0.1.1.dev164 → davout-0.1.1.dev166}/source/Davout/PythonicUtilities/path_tools.py +0 -0
- {davout-0.1.1.dev164 → davout-0.1.1.dev166}/source/Davout/PythonicUtilities/programming_tools.py +0 -0
- {davout-0.1.1.dev164 → davout-0.1.1.dev166}/source/Davout/PythonicUtilities/recursion_tools.py +0 -0
- {davout-0.1.1.dev164 → davout-0.1.1.dev166}/source/Davout/PythonicUtilities/string_tools.py +0 -0
- {davout-0.1.1.dev164 → davout-0.1.1.dev166}/source/Davout/PythonicUtilities/tensor_and_math_tools.py +0 -0
- {davout-0.1.1.dev164 → davout-0.1.1.dev166}/source/Davout/PythonicUtilities/testing_tools.py +0 -0
- {davout-0.1.1.dev164 → davout-0.1.1.dev166}/source/Davout/PythonicUtilities/user_interaction_tools.py +0 -0
- {davout-0.1.1.dev164 → davout-0.1.1.dev166}/source/Davout/StochasticUtilities/__init__.py +0 -0
- {davout-0.1.1.dev164 → davout-0.1.1.dev166}/source/Davout/StochasticUtilities/aa_tests/__init__.py +0 -0
- {davout-0.1.1.dev164 → davout-0.1.1.dev166}/source/Davout/StochasticUtilities/aa_tests/test_delaunay_tools.py +0 -0
- {davout-0.1.1.dev164 → davout-0.1.1.dev166}/source/Davout/StochasticUtilities/domain_decomposition/__init__.py +0 -0
- {davout-0.1.1.dev164 → davout-0.1.1.dev166}/source/Davout/StochasticUtilities/tool_box/__init__.py +0 -0
- {davout-0.1.1.dev164 → davout-0.1.1.dev166}/source/Davout/StochasticUtilities/tool_box/delaunay_tools.py +0 -0
- {davout-0.1.1.dev164 → davout-0.1.1.dev166}/source/Davout/StochasticUtilities/tool_box/sampling_tools.py +0 -0
- {davout-0.1.1.dev164 → davout-0.1.1.dev166}/source/Davout/StochasticUtilities/tool_box/statistics_tools.py +0 -0
- {davout-0.1.1.dev164 → davout-0.1.1.dev166}/source/Davout/__init__.py +0 -0
- {davout-0.1.1.dev164 → davout-0.1.1.dev166}/source/Davout.egg-info/SOURCES.txt +0 -0
- {davout-0.1.1.dev164 → davout-0.1.1.dev166}/source/Davout.egg-info/dependency_links.txt +0 -0
- {davout-0.1.1.dev164 → davout-0.1.1.dev166}/source/Davout.egg-info/requires.txt +0 -0
- {davout-0.1.1.dev164 → davout-0.1.1.dev166}/source/Davout.egg-info/top_level.txt +0 -0
|
@@ -0,0 +1,553 @@
|
|
|
1
|
+
# Routine to train a neural network model as surrogate for the RVE kine-
|
|
2
|
+
# matics
|
|
3
|
+
|
|
4
|
+
import numpy as np
|
|
5
|
+
|
|
6
|
+
import tensorflow as tf
|
|
7
|
+
|
|
8
|
+
from time import time
|
|
9
|
+
|
|
10
|
+
from .....Davout.DeepMech.tool_box import ANN_tools, training_tools
|
|
11
|
+
|
|
12
|
+
from .....Davout.DeepMech.tool_box.loss_assembler_classes import MaximumAbsoluteError
|
|
13
|
+
|
|
14
|
+
from .....Davout.PythonicUtilities.path_tools import get_parent_path_of_file
|
|
15
|
+
|
|
16
|
+
from .....Davout.MultiMech.tool_box.binary_tools import read_field_from_binary
|
|
17
|
+
|
|
18
|
+
from .....Davout.GraphUtilities import paraview_tools
|
|
19
|
+
|
|
20
|
+
# Defines a class for the training and testing procedures
|
|
21
|
+
|
|
22
|
+
class SurrogateModel:
|
|
23
|
+
|
|
24
|
+
def __init__(self, displacement_data_file, input_data_file,
|
|
25
|
+
saved_model_file, results_path, n_training_samples,
|
|
26
|
+
quotient_space_dimension, n_monte_carlo_realizations, n_best_models,
|
|
27
|
+
n_best_samples, mesh_file_name, screenshots_path):
|
|
28
|
+
|
|
29
|
+
# Stores the data
|
|
30
|
+
|
|
31
|
+
self.displacement_data_file = displacement_data_file
|
|
32
|
+
|
|
33
|
+
self.input_data_file = input_data_file
|
|
34
|
+
|
|
35
|
+
self.saved_model_file = saved_model_file
|
|
36
|
+
|
|
37
|
+
self.results_path = results_path
|
|
38
|
+
|
|
39
|
+
self.n_training_samples = n_training_samples
|
|
40
|
+
|
|
41
|
+
self.quotient_space_dimension = quotient_space_dimension
|
|
42
|
+
|
|
43
|
+
self.n_monte_carlo_realizations = n_monte_carlo_realizations
|
|
44
|
+
|
|
45
|
+
self.n_best_models = n_best_models
|
|
46
|
+
|
|
47
|
+
self.n_best_samples = n_best_samples
|
|
48
|
+
|
|
49
|
+
self.mesh_file_name = mesh_file_name
|
|
50
|
+
|
|
51
|
+
self.screenshots_path = screenshots_path
|
|
52
|
+
|
|
53
|
+
# Reads the two files
|
|
54
|
+
|
|
55
|
+
self.output_data = np.load(self.results_path+"//"+
|
|
56
|
+
self.displacement_data_file)
|
|
57
|
+
|
|
58
|
+
self.n_output_neurons = self.output_data.shape[1]
|
|
59
|
+
|
|
60
|
+
# Sets a list of layers and the activation functions
|
|
61
|
+
|
|
62
|
+
self.activations_list = [{"elu": {"number of neurons": 100}}, {
|
|
63
|
+
"elu": {"number of neurons": 1000}}, {"linear":
|
|
64
|
+
self.n_output_neurons}]
|
|
65
|
+
|
|
66
|
+
# Defines a function to train the neural network model
|
|
67
|
+
|
|
68
|
+
def train_surrogate_model(self):
|
|
69
|
+
|
|
70
|
+
input_data = np.load(self.results_path+"//"+self.input_data_file)
|
|
71
|
+
|
|
72
|
+
# Reshufles data to put the displacement gradient as the first
|
|
73
|
+
# columns. This is a requirement of the implementation of the
|
|
74
|
+
# GatedQuotientSpace architecture
|
|
75
|
+
|
|
76
|
+
input_data = np.hstack((input_data[:,(input_data.shape[1]-
|
|
77
|
+
self.quotient_space_dimension):], input_data[:,:(
|
|
78
|
+
input_data.shape[1]-self.quotient_space_dimension)]))
|
|
79
|
+
|
|
80
|
+
# Sets the training data
|
|
81
|
+
|
|
82
|
+
training_data = input_data[0:self.n_training_samples,:]
|
|
83
|
+
|
|
84
|
+
training_true_values = self.output_data[0:(
|
|
85
|
+
self.n_training_samples),:]
|
|
86
|
+
|
|
87
|
+
# Gets the number of input and output neurons
|
|
88
|
+
|
|
89
|
+
n_input_neurons = input_data.shape[1]
|
|
90
|
+
|
|
91
|
+
# Creates the class of neural network information
|
|
92
|
+
|
|
93
|
+
ANN_class = ANN_tools.MultiLayerModel(n_input_neurons,
|
|
94
|
+
self.activations_list, enforce_customLayers=True, verbose=True,
|
|
95
|
+
parameters_dtype="float32", custom_architecture={"name": "Gate"+
|
|
96
|
+
"dQuotientSpace", "quotient space dimension":
|
|
97
|
+
self.quotient_space_dimension})
|
|
98
|
+
|
|
99
|
+
custom_model = ANN_class()
|
|
100
|
+
|
|
101
|
+
# Sets the number of training iterations and the number of iter-
|
|
102
|
+
# ations to plot results in the terminal
|
|
103
|
+
|
|
104
|
+
maximum_iterations = 1000
|
|
105
|
+
|
|
106
|
+
verbose_delta_iterations = 50
|
|
107
|
+
|
|
108
|
+
# Sets the optimization class for training
|
|
109
|
+
|
|
110
|
+
training_class = training_tools.ModelCustomTraining(custom_model,
|
|
111
|
+
training_data, training_true_values,
|
|
112
|
+
tf.keras.losses.MeanAbsoluteError(), verbose=True, n_iterations=
|
|
113
|
+
maximum_iterations, verbose_deltaIterations=
|
|
114
|
+
verbose_delta_iterations, save_model_file=self.saved_model_file,
|
|
115
|
+
match_data_float_type_to_trainables=True, parent_path=
|
|
116
|
+
self.results_path)
|
|
117
|
+
|
|
118
|
+
t_initial = time()
|
|
119
|
+
|
|
120
|
+
training_class()
|
|
121
|
+
|
|
122
|
+
elapsed_time = time()-t_initial
|
|
123
|
+
|
|
124
|
+
print("\nTrains at "+str(elapsed_time)+" seconds")
|
|
125
|
+
|
|
126
|
+
# Tests Monte Carlo training
|
|
127
|
+
|
|
128
|
+
training_class.monte_carlo_training(n_realizations=
|
|
129
|
+
self.n_monte_carlo_realizations, best_models_rank_size=
|
|
130
|
+
self.n_best_models, show_reinitialization_distance=True)
|
|
131
|
+
|
|
132
|
+
# Checks the loss again with the best model of the Monte Carlo
|
|
133
|
+
# training
|
|
134
|
+
|
|
135
|
+
print("\nThe loss function evaluated again over the set of tra"+
|
|
136
|
+
"ining data for the best model is "+str(
|
|
137
|
+
training_class.loss_unseen_data(training_true_values,
|
|
138
|
+
training_data, output_as_numpy=True)))
|
|
139
|
+
|
|
140
|
+
# Defines a function to test the model
|
|
141
|
+
|
|
142
|
+
def test_surrogate_model(self):
|
|
143
|
+
|
|
144
|
+
# Reads the input file
|
|
145
|
+
|
|
146
|
+
input_data = np.load(self.results_path+"//"+self.input_data_file)
|
|
147
|
+
|
|
148
|
+
print("The data has a total of "+str(input_data.shape[0])+"sam"+
|
|
149
|
+
"ples\n")
|
|
150
|
+
|
|
151
|
+
# Reshufles data to put the displacement gradient as the first
|
|
152
|
+
# columns. This is a requirement of the implementation of the
|
|
153
|
+
# GatedQuotientSpace architecture
|
|
154
|
+
|
|
155
|
+
input_data = np.hstack((input_data[:,(input_data.shape[1]-
|
|
156
|
+
self.quotient_space_dimension):], input_data[:,:(
|
|
157
|
+
input_data.shape[1]-self.quotient_space_dimension)]))
|
|
158
|
+
|
|
159
|
+
# Sets the test data
|
|
160
|
+
|
|
161
|
+
test_data = input_data[self.n_training_samples:,:]
|
|
162
|
+
|
|
163
|
+
test_true_values = self.output_data[self.n_training_samples:,:]
|
|
164
|
+
|
|
165
|
+
# Defines the loss function metric
|
|
166
|
+
|
|
167
|
+
loss_metric = tf.keras.losses.MeanAbsoluteError()
|
|
168
|
+
|
|
169
|
+
maximum_absolute_error = MaximumAbsoluteError()
|
|
170
|
+
|
|
171
|
+
# Iterates through the best models
|
|
172
|
+
|
|
173
|
+
for i in range(self.n_best_models):
|
|
174
|
+
|
|
175
|
+
# Loads this model
|
|
176
|
+
|
|
177
|
+
loaded_model = tf.keras.models.load_model(self.results_path+
|
|
178
|
+
"//"+str(i+1)+"_best_model.keras")
|
|
179
|
+
|
|
180
|
+
# Gets the output of the loaded model
|
|
181
|
+
|
|
182
|
+
output_model = loaded_model(test_data)
|
|
183
|
+
|
|
184
|
+
# Gets the loss of the test data
|
|
185
|
+
|
|
186
|
+
test_loss = loss_metric(test_true_values, output_model)
|
|
187
|
+
|
|
188
|
+
print("Loads the "+str(i+1)+"-th best model")
|
|
189
|
+
|
|
190
|
+
print("Loss function on test set:", format(test_loss.numpy(
|
|
191
|
+
), '.5e'))
|
|
192
|
+
|
|
193
|
+
# Verifies with the maximum absolute error
|
|
194
|
+
|
|
195
|
+
maximum_absolute_value = maximum_absolute_error(
|
|
196
|
+
test_true_values, output_model)
|
|
197
|
+
|
|
198
|
+
print("Maximum absolute error on test set: "+str(format(
|
|
199
|
+
maximum_absolute_value.numpy(),'.5e'))+"\nwhereas the mini"+
|
|
200
|
+
"mum absolute error is "+str(format(
|
|
201
|
+
maximum_absolute_error.minimum_absolute_error(
|
|
202
|
+
test_true_values, output_model).numpy(), '.5e')))
|
|
203
|
+
|
|
204
|
+
# Gets the mean absolute error for each row
|
|
205
|
+
|
|
206
|
+
loss_per_sample = tf.reduce_mean(tf.abs(test_true_values-
|
|
207
|
+
output_model), axis=1).numpy()
|
|
208
|
+
|
|
209
|
+
# Gets the samples indices with the lowest error
|
|
210
|
+
|
|
211
|
+
best_samples_indices = np.argsort(loss_per_sample)[
|
|
212
|
+
:self.n_best_samples]
|
|
213
|
+
|
|
214
|
+
print("The "+str(self.n_best_samples)+" best samples have "+
|
|
215
|
+
"the following mean absolute error:\n"+str(loss_per_sample[
|
|
216
|
+
best_samples_indices])+"\n")
|
|
217
|
+
|
|
218
|
+
# Saves as binary files the true data and the output data of
|
|
219
|
+
# the best preserving samples
|
|
220
|
+
|
|
221
|
+
np.save(self.results_path+"//true_best_samples_of_"+str(i+1
|
|
222
|
+
)+"_best_model.npy", test_true_values[best_samples_indices,:
|
|
223
|
+
])
|
|
224
|
+
|
|
225
|
+
np.save(self.results_path+"//surrogate_best_samples_of_"+
|
|
226
|
+
str(i+1)+"_best_model.npy", output_model.numpy()[
|
|
227
|
+
best_samples_indices,:])
|
|
228
|
+
|
|
229
|
+
# Defines a function to insert the results into a function space and
|
|
230
|
+
# plot it for the samples of the training set
|
|
231
|
+
|
|
232
|
+
def plot_training_response(self):
|
|
233
|
+
|
|
234
|
+
# Gets the input data
|
|
235
|
+
|
|
236
|
+
input_data = np.load(self.results_path+"//"+self.input_data_file)
|
|
237
|
+
|
|
238
|
+
# Reshufles data to put the displacement gradient as the first
|
|
239
|
+
# columns. This is a requirement of the implementation of the
|
|
240
|
+
# GatedQuotientSpace architecture
|
|
241
|
+
|
|
242
|
+
input_data = np.hstack((input_data[:,(input_data.shape[1]-
|
|
243
|
+
self.quotient_space_dimension):], input_data[:,:(
|
|
244
|
+
input_data.shape[1]-self.quotient_space_dimension)]))
|
|
245
|
+
|
|
246
|
+
# Sets the training data
|
|
247
|
+
|
|
248
|
+
training_data = input_data[0:self.n_training_samples,:]
|
|
249
|
+
|
|
250
|
+
training_true_values = self.output_data[0:(
|
|
251
|
+
self.n_training_samples),:]
|
|
252
|
+
|
|
253
|
+
# Defines the loss function metric
|
|
254
|
+
|
|
255
|
+
loss_metric = tf.keras.losses.MeanAbsoluteError()
|
|
256
|
+
|
|
257
|
+
maximum_absolute_error = MaximumAbsoluteError()
|
|
258
|
+
|
|
259
|
+
# Iterates through the best models
|
|
260
|
+
|
|
261
|
+
for i in range(self.n_best_models):
|
|
262
|
+
|
|
263
|
+
# Loads this model
|
|
264
|
+
|
|
265
|
+
loaded_model = tf.keras.models.load_model(self.results_path+
|
|
266
|
+
"//"+str(i+1)+"_best_model.keras")
|
|
267
|
+
|
|
268
|
+
# Gets the output of the loaded model
|
|
269
|
+
|
|
270
|
+
output_model = loaded_model(training_data)
|
|
271
|
+
|
|
272
|
+
# Gets the loss of the test data
|
|
273
|
+
|
|
274
|
+
test_loss = loss_metric(training_true_values, output_model)
|
|
275
|
+
|
|
276
|
+
print("Loads the "+str(i+1)+"-th best model")
|
|
277
|
+
|
|
278
|
+
print("Loss function on training set:", format(
|
|
279
|
+
test_loss.numpy(), '.5e'))
|
|
280
|
+
|
|
281
|
+
# Verifies with the maximum absolute error
|
|
282
|
+
|
|
283
|
+
maximum_absolute_value = maximum_absolute_error(
|
|
284
|
+
training_true_values, output_model)
|
|
285
|
+
|
|
286
|
+
print("Maximum absolute error on test set: "+str(format(
|
|
287
|
+
maximum_absolute_value.numpy(),'.5e'))+"\nwhereas the mini"+
|
|
288
|
+
"mum absolute error is "+str(format(
|
|
289
|
+
maximum_absolute_error.minimum_absolute_error(
|
|
290
|
+
training_true_values, output_model).numpy(), '.5e')))
|
|
291
|
+
|
|
292
|
+
# Gets the mean absolute error for each row
|
|
293
|
+
|
|
294
|
+
loss_per_sample = tf.reduce_mean(tf.abs(training_true_values
|
|
295
|
+
-output_model), axis=1).numpy()
|
|
296
|
+
|
|
297
|
+
# Gets the samples indices with the lowest error
|
|
298
|
+
|
|
299
|
+
best_samples_indices = np.argsort(loss_per_sample)[
|
|
300
|
+
:self.n_best_samples]
|
|
301
|
+
|
|
302
|
+
print("The "+str(self.n_best_samples)+" best samples have "+
|
|
303
|
+
"the following mean absolute error:\n"+str(loss_per_sample[
|
|
304
|
+
best_samples_indices])+"\n")
|
|
305
|
+
|
|
306
|
+
# Recovers the name of the file that contains the displace-
|
|
307
|
+
# ment DOFs of this model
|
|
308
|
+
|
|
309
|
+
displacement_output_file = (self.results_path+"//surrogate"+
|
|
310
|
+
"_best_training_samples_of_"+str(i+1)+"_best_model.npy")
|
|
311
|
+
|
|
312
|
+
# Recovers the name of the file with the true values of dis-
|
|
313
|
+
# placement
|
|
314
|
+
|
|
315
|
+
true_displacement_output_file = (self.results_path+"//true"+
|
|
316
|
+
"_best_training_samples_of_"+str(i+1)+"_best_model.npy")
|
|
317
|
+
|
|
318
|
+
# Saves as binary files the true data and the output data of
|
|
319
|
+
# the best preserving samples
|
|
320
|
+
|
|
321
|
+
np.save(true_displacement_output_file, training_true_values[
|
|
322
|
+
best_samples_indices,:])
|
|
323
|
+
|
|
324
|
+
np.save(displacement_output_file, output_model.numpy()[
|
|
325
|
+
best_samples_indices,:])
|
|
326
|
+
|
|
327
|
+
# Reads the binary file directly and converts it to a FEniCS
|
|
328
|
+
# function space data class. Selects the flag
|
|
329
|
+
# 'data_matrix_has_time_point_per_row' as False, since the
|
|
330
|
+
# first column of the data matrix is composed of actual dis-
|
|
331
|
+
# placement DOFs, not time points.
|
|
332
|
+
# On the other hand, the argument 'time_step' is set to 0 to
|
|
333
|
+
# capture the first row of the data matrix, which corres-
|
|
334
|
+
# ponds to the best sample of the surrogate model. Thus,
|
|
335
|
+
# this variable has no meaning of time in the context of the
|
|
336
|
+
# particular application of this code
|
|
337
|
+
|
|
338
|
+
_, _, xdmf_field_file = read_field_from_binary(
|
|
339
|
+
displacement_output_file, self.mesh_file_name, {"Displacem"+
|
|
340
|
+
"ent": {"field type": "vector", "interpolation function":
|
|
341
|
+
"CG", "polynomial degree": 2}},
|
|
342
|
+
data_matrix_has_time_point_per_row=False, time_step=0,
|
|
343
|
+
return_visualization_file_name=True, save_to_xdmf=True)
|
|
344
|
+
|
|
345
|
+
# Makes a visualization copy for the true displacement as
|
|
346
|
+
# well
|
|
347
|
+
|
|
348
|
+
_, _, xdmf_true_field_file = read_field_from_binary(
|
|
349
|
+
true_displacement_output_file, self.mesh_file_name, {"Disp"+
|
|
350
|
+
"lacement": {"field type": "vector", "interpolation functi"+
|
|
351
|
+
"on": "CG", "polynomial degree": 2}},
|
|
352
|
+
data_matrix_has_time_point_per_row=False, time_step=0,
|
|
353
|
+
return_visualization_file_name=True, save_to_xdmf=True)
|
|
354
|
+
|
|
355
|
+
# Sets the name of the screenshot file
|
|
356
|
+
|
|
357
|
+
screenshot_file = ("surrogate_best_training_sample_of_"+str(
|
|
358
|
+
i+1)+"_best_model.png")
|
|
359
|
+
|
|
360
|
+
# Sets the name of the screenshot file for the true displa-
|
|
361
|
+
# cement
|
|
362
|
+
|
|
363
|
+
screenshot_true_file = ("true_best_training_sample_of_"+str(
|
|
364
|
+
i+1)+"_best_model.png")
|
|
365
|
+
|
|
366
|
+
# Takes a snapshot of a simulation saved in the xdmf file
|
|
367
|
+
# whose field is called as 'Displacement' inside FEniCS. The
|
|
368
|
+
# edges of the finite elements will be shown
|
|
369
|
+
|
|
370
|
+
paraview_tools.frozen_snapshots(xdmf_field_file, "Displace"+
|
|
371
|
+
"ment", time=0.0, representation_type="Surface With Edges",
|
|
372
|
+
axes_color="black", legend_bar_font="latex", zoom_factor=1.0,
|
|
373
|
+
component_to_plot="Magnitude", warp_by_vector=True,
|
|
374
|
+
resolution_ratio=10, background_color="WhiteBackground",
|
|
375
|
+
display_reference_configuration=False,
|
|
376
|
+
transparent_background=True, legend_bar_font_color="black",
|
|
377
|
+
set_camera_interactively=False,
|
|
378
|
+
#color_bar_min_value=0.1, color_bar_max_value=0.6,
|
|
379
|
+
output_imageFileName=screenshot_file, output_path=
|
|
380
|
+
self.screenshots_path, read_camera_settings_dictionary=True,
|
|
381
|
+
legend_bar_visibility=True)
|
|
382
|
+
|
|
383
|
+
# Makes the same screenshot for the true values of displace-
|
|
384
|
+
# ment
|
|
385
|
+
|
|
386
|
+
paraview_tools.frozen_snapshots(xdmf_true_field_file, "Dis"+
|
|
387
|
+
"placement", time=0.0, representation_type="Surface With E"+
|
|
388
|
+
"dges", axes_color="black", legend_bar_font="latex",
|
|
389
|
+
zoom_factor=1.0, component_to_plot="Magnitude",
|
|
390
|
+
warp_by_vector=True, resolution_ratio=10, background_color=
|
|
391
|
+
"WhiteBackground", display_reference_configuration=False,
|
|
392
|
+
transparent_background=True, legend_bar_font_color="black",
|
|
393
|
+
set_camera_interactively=False,
|
|
394
|
+
#color_bar_min_value=0.1, color_bar_max_value=0.6,
|
|
395
|
+
output_imageFileName=screenshot_true_file, output_path=
|
|
396
|
+
self.screenshots_path, read_camera_settings_dictionary=True,
|
|
397
|
+
legend_bar_visibility=True)
|
|
398
|
+
|
|
399
|
+
# Defines a function to insert the results into a function space and
|
|
400
|
+
# plot it for the samples of the test set
|
|
401
|
+
|
|
402
|
+
def plot_test_response(self):
|
|
403
|
+
|
|
404
|
+
# Iterates over the best models
|
|
405
|
+
|
|
406
|
+
for i in range(n_best_models):
|
|
407
|
+
|
|
408
|
+
# Recovers the name of the file that contains the displace-
|
|
409
|
+
# ment DOFs of this model
|
|
410
|
+
|
|
411
|
+
displacement_output_file = (self.results_path+"//surrogate"+
|
|
412
|
+
"_best_samples_of_"+str(i+1)+"_best_model.npy")
|
|
413
|
+
|
|
414
|
+
# Recovers the name of the file with the true values of dis-
|
|
415
|
+
# placement
|
|
416
|
+
|
|
417
|
+
true_displacement_output_file = (self.results_path+"//true"+
|
|
418
|
+
"_best_samples_of_"+str(i+1)+"_best_model.npy")
|
|
419
|
+
|
|
420
|
+
# Reads the binary file directly and converts it to a FEniCS
|
|
421
|
+
# function space data class. Selects the flag
|
|
422
|
+
# 'data_matrix_has_time_point_per_row' as False, since the
|
|
423
|
+
# first column of the data matrix is composed of actual dis-
|
|
424
|
+
# placement DOFs, not time points.
|
|
425
|
+
# On the other hand, the argument 'time_step' is set to 0 to
|
|
426
|
+
# capture the first row of the data matrix, which corres-
|
|
427
|
+
# ponds to the best sample of the surrogate model. Thus,
|
|
428
|
+
# this variable has no meaning of time in the context of the
|
|
429
|
+
# particular application of this code
|
|
430
|
+
|
|
431
|
+
_, _, xdmf_field_file = read_field_from_binary(
|
|
432
|
+
displacement_output_file, self.mesh_file_name, {"Displacem"+
|
|
433
|
+
"ent": {"field type": "vector", "interpolation function":
|
|
434
|
+
"CG", "polynomial degree": 2}},
|
|
435
|
+
data_matrix_has_time_point_per_row=False, time_step=0,
|
|
436
|
+
return_visualization_file_name=True, save_to_xdmf=True)
|
|
437
|
+
|
|
438
|
+
# Makes a visualization copy for the true displacement as
|
|
439
|
+
# well
|
|
440
|
+
|
|
441
|
+
_, _, xdmf_true_field_file = read_field_from_binary(
|
|
442
|
+
true_displacement_output_file, self.mesh_file_name, {"Disp"+
|
|
443
|
+
"lacement": {"field type": "vector", "interpolation functi"+
|
|
444
|
+
"on": "CG", "polynomial degree": 2}},
|
|
445
|
+
data_matrix_has_time_point_per_row=False, time_step=0,
|
|
446
|
+
return_visualization_file_name=True, save_to_xdmf=True)
|
|
447
|
+
|
|
448
|
+
# Sets the name of the screenshot file
|
|
449
|
+
|
|
450
|
+
screenshot_file = ("surrogate_best_sample_of_"+str(i+1)+"_"+
|
|
451
|
+
"best_model.png")
|
|
452
|
+
|
|
453
|
+
# Sets the name of the screenshot file for the true displa-
|
|
454
|
+
# cement
|
|
455
|
+
|
|
456
|
+
screenshot_true_file = ("true_best_sample_of_"+str(i+1)+"_"+
|
|
457
|
+
"best_model.png")
|
|
458
|
+
|
|
459
|
+
# Takes a snapshot of a simulation saved in the xdmf file
|
|
460
|
+
# whose field is called as 'Displacement' inside FEniCS. The
|
|
461
|
+
# edges of the finite elements will be shown
|
|
462
|
+
|
|
463
|
+
paraview_tools.frozen_snapshots(xdmf_field_file, "Displace"+
|
|
464
|
+
"ment", time=0.0, representation_type="Surface With Edges",
|
|
465
|
+
axes_color="black", legend_bar_font="latex", zoom_factor=1.0,
|
|
466
|
+
component_to_plot="Magnitude", warp_by_vector=True,
|
|
467
|
+
resolution_ratio=10, background_color="WhiteBackground",
|
|
468
|
+
display_reference_configuration=False,
|
|
469
|
+
transparent_background=True, legend_bar_font_color="black",
|
|
470
|
+
set_camera_interactively=False,
|
|
471
|
+
#color_bar_min_value=0.1, color_bar_max_value=0.6,
|
|
472
|
+
output_imageFileName=screenshot_file, output_path=
|
|
473
|
+
self.screenshots_path, read_camera_settings_dictionary=True,
|
|
474
|
+
legend_bar_visibility=True)
|
|
475
|
+
|
|
476
|
+
# Makes the same screenshot for the true values of displace-
|
|
477
|
+
# ment
|
|
478
|
+
|
|
479
|
+
paraview_tools.frozen_snapshots(xdmf_true_field_file, "Dis"+
|
|
480
|
+
"placement", time=0.0, representation_type="Surface With E"+
|
|
481
|
+
"dges", axes_color="black", legend_bar_font="latex",
|
|
482
|
+
zoom_factor=1.0, component_to_plot="Magnitude",
|
|
483
|
+
warp_by_vector=True, resolution_ratio=10, background_color=
|
|
484
|
+
"WhiteBackground", display_reference_configuration=False,
|
|
485
|
+
transparent_background=True, legend_bar_font_color="black",
|
|
486
|
+
set_camera_interactively=False,
|
|
487
|
+
#color_bar_min_value=0.1, color_bar_max_value=0.6,
|
|
488
|
+
output_imageFileName=screenshot_true_file, output_path=
|
|
489
|
+
self.screenshots_path, read_camera_settings_dictionary=True,
|
|
490
|
+
legend_bar_visibility=True)
|
|
491
|
+
|
|
492
|
+
# Execution block block
|
|
493
|
+
|
|
494
|
+
if __name__=="__main__":
|
|
495
|
+
|
|
496
|
+
results_path = get_parent_path_of_file()+"//results_lagrange"
|
|
497
|
+
|
|
498
|
+
displacement_data_file = ("00_succesful_displacement_matrix_pc_mat"+
|
|
499
|
+
"heus.npy")
|
|
500
|
+
|
|
501
|
+
input_data_file = ("00_successful_complete_data_matrix_pc_matheus."+
|
|
502
|
+
"npy")
|
|
503
|
+
|
|
504
|
+
saved_model_file = "saved_model"
|
|
505
|
+
|
|
506
|
+
n_training_samples = 10000
|
|
507
|
+
|
|
508
|
+
quotient_space_dimension = 9
|
|
509
|
+
|
|
510
|
+
# Trains a new model
|
|
511
|
+
|
|
512
|
+
n_monte_carlo_realizations = 500
|
|
513
|
+
|
|
514
|
+
n_best_models = 30
|
|
515
|
+
|
|
516
|
+
n_best_samples = 10
|
|
517
|
+
|
|
518
|
+
training_flag = False
|
|
519
|
+
|
|
520
|
+
test_flag = False
|
|
521
|
+
|
|
522
|
+
# Gets the mesh of the RVE
|
|
523
|
+
|
|
524
|
+
mesh_file_name = get_parent_path_of_file()+"//box_mesh_mecsol"
|
|
525
|
+
|
|
526
|
+
# Gets the path to the directory of screenshots
|
|
527
|
+
|
|
528
|
+
screenshots_path = results_path+"//screenshots"
|
|
529
|
+
|
|
530
|
+
# Instantiates the class of the surrogate model
|
|
531
|
+
|
|
532
|
+
surrogate_model_class = SurrogateModel(displacement_data_file,
|
|
533
|
+
input_data_file, saved_model_file, results_path, n_training_samples,
|
|
534
|
+
quotient_space_dimension, n_monte_carlo_realizations, n_best_models,
|
|
535
|
+
n_best_samples, mesh_file_name, screenshots_path)
|
|
536
|
+
|
|
537
|
+
# Sets training forth if it is the case
|
|
538
|
+
|
|
539
|
+
if training_flag:
|
|
540
|
+
|
|
541
|
+
surrogate_model_class.train_surrogate_model()
|
|
542
|
+
|
|
543
|
+
# Sets testing forth if it is the case
|
|
544
|
+
|
|
545
|
+
if test_flag:
|
|
546
|
+
|
|
547
|
+
surrogate_model_class.test_surrogate_model()
|
|
548
|
+
|
|
549
|
+
# Plots the best models
|
|
550
|
+
|
|
551
|
+
surrogate_model_class.plot_training_response()
|
|
552
|
+
|
|
553
|
+
#surrogate_model_class.plot_test_response()
|
{davout-0.1.1.dev164 → davout-0.1.1.dev166}/source/Davout/DeepMech/tool_box/training_tools.py
RENAMED
|
@@ -54,6 +54,10 @@ class ModelTraining:
|
|
|
54
54
|
|
|
55
55
|
self.verbose = verbose
|
|
56
56
|
|
|
57
|
+
# Gets the number of trainable parameters of the model
|
|
58
|
+
|
|
59
|
+
self.number_trainable_parameters = self.model.count_params()
|
|
60
|
+
|
|
57
61
|
# Saves the parent path where to save the model
|
|
58
62
|
|
|
59
63
|
if parent_path=="get current path":
|
|
@@ -146,7 +150,11 @@ class ModelTraining:
|
|
|
146
150
|
|
|
147
151
|
print("Iteration "+integer_toString(i, max_digits)+
|
|
148
152
|
": loss="+format(loss_value.numpy(), '.5e')+", gra"+
|
|
149
|
-
"dient norm: "+format(gradient_norm.numpy(), '.5e')
|
|
153
|
+
"dient norm: "+format(gradient_norm.numpy(), '.5e')+
|
|
154
|
+
", gradient norm divided by the square root of the"+
|
|
155
|
+
" number of trainable parameters: "+format(
|
|
156
|
+
gradient_norm.numpy()/
|
|
157
|
+
self.number_trainable_parameters, '.5e'))
|
|
150
158
|
|
|
151
159
|
# Evaluates the elapsed time
|
|
152
160
|
|
|
@@ -581,7 +589,8 @@ class ModelCustomTraining:
|
|
|
581
589
|
# ing multiple times and generating multiple models
|
|
582
590
|
|
|
583
591
|
def monte_carlo_training(self, n_realizations=50,
|
|
584
|
-
best_models_rank_size=None, show_reinitialization_distance=False
|
|
592
|
+
best_models_rank_size=None, show_reinitialization_distance=False,
|
|
593
|
+
model_base_name="model"):
|
|
585
594
|
|
|
586
595
|
print("\n#####################################################"+
|
|
587
596
|
"###################\n# Initializes Monte Ca"+
|
|
@@ -693,9 +702,9 @@ class ModelCustomTraining:
|
|
|
693
702
|
# corresponding one to the last key
|
|
694
703
|
|
|
695
704
|
path_tools.delete_file(str(list(
|
|
696
|
-
models_ranking_dict.keys())[-1])+"
|
|
697
|
-
"
|
|
698
|
-
ignore_non_existing_file=True)
|
|
705
|
+
models_ranking_dict.keys())[-1])+"_best_"+
|
|
706
|
+
model_base_name+".keras", parent_path=
|
|
707
|
+
self.parent_path, ignore_non_existing_file=True)
|
|
699
708
|
|
|
700
709
|
# Move every other model below this one one step
|
|
701
710
|
# downwards
|
|
@@ -711,9 +720,10 @@ class ModelCustomTraining:
|
|
|
711
720
|
|
|
712
721
|
# And renames the model file
|
|
713
722
|
|
|
714
|
-
path_tools.rename_file(str(j)+"
|
|
715
|
-
"
|
|
716
|
-
|
|
723
|
+
path_tools.rename_file(str(j)+"_best_"+
|
|
724
|
+
model_base_name+".keras", str(j+1)+"_best_"+
|
|
725
|
+
model_base_name+".keras", parent_path=
|
|
726
|
+
self.parent_path, saving_function=
|
|
717
727
|
self.model.save)
|
|
718
728
|
|
|
719
729
|
# Finally adds the current loss
|
|
@@ -724,7 +734,7 @@ class ModelCustomTraining:
|
|
|
724
734
|
# Saves this model
|
|
725
735
|
|
|
726
736
|
path_tools.rename_file(self.save_model_file, str(
|
|
727
|
-
model_number+1)+"
|
|
737
|
+
model_number+1)+"_best_"+model_base_name+".keras",
|
|
728
738
|
saving_function=self.model.save)
|
|
729
739
|
|
|
730
740
|
# Breaks the loop
|
{davout-0.1.1.dev164 → davout-0.1.1.dev166}/source/Davout/MultiMech/tool_box/binary_tools.py
RENAMED
|
@@ -575,8 +575,8 @@ return_visualization_file_name=False):
|
|
|
575
575
|
mpi_print(comm_object, "Saves the visualization copy at file '"+
|
|
576
576
|
str(copy_file_name)+"'\n")
|
|
577
577
|
|
|
578
|
-
mpi_print(comm_object, "Creates a new XDMFFile instance
|
|
579
|
-
"
|
|
578
|
+
mpi_print(comm_object, "Creates a new XDMFFile instance for th"+
|
|
579
|
+
"e visualization copy file\n")
|
|
580
580
|
|
|
581
581
|
visualization_copy_file = XDMFFile(
|
|
582
582
|
function_space_info.monolithic_solution.function_space().mesh(
|
|
@@ -588,6 +588,14 @@ return_visualization_file_name=False):
|
|
|
588
588
|
|
|
589
589
|
time_points = [time_points]
|
|
590
590
|
|
|
591
|
+
# Verifies if the read function is not a list
|
|
592
|
+
|
|
593
|
+
if not isinstance(read_function, list):
|
|
594
|
+
|
|
595
|
+
read_function = [read_function]
|
|
596
|
+
|
|
597
|
+
# Iterates over the time steps
|
|
598
|
+
|
|
591
599
|
for step, time_point in enumerate(time_points):
|
|
592
600
|
|
|
593
601
|
visualization_copy_file.write(read_function[step], time_point)
|
|
@@ -982,8 +990,6 @@ return_visualization_file_name=False):
|
|
|
982
990
|
|
|
983
991
|
time_points_copy = time_step+0
|
|
984
992
|
|
|
985
|
-
print("time_points_copy: "+str(time_points_copy))
|
|
986
|
-
|
|
987
993
|
# Saves a visualization copy. Sets the flag 'reading_is_ready'
|
|
988
994
|
# to True since the file has already been read and the function
|
|
989
995
|
# space is ready for plotting in a xdmf file
|