The document discusses training a machine learning model using Modulus' Solver class. It describes creating a solver using the domain and configurations, then executing the solve method. Validation predictions are saved to a checkpoint directory and can be viewed using Tensorboard to see the model accurately predicts pressure fields for unseen permeability fields.
The document discusses training a machine learning model using Modulus' Solver class. It describes creating a solver using the domain and configurations, then executing the solve method. Validation predictions are saved to a checkpoint directory and can be viewed using Tensorboard to see the model accurately predicts pressure fields for unseen permeability fields.
The document discusses training a machine learning model using Modulus' Solver class. It describes creating a solver using the domain and configurations, then executing the solve method. Validation predictions are saved to a checkpoint directory and can be viewed using Tensorboard to see the model accurately predicts pressure fields for unseen permeability fields.
We can create a solver by using the domain we just created along with the other configurations that define the optimizer choices, settings using Modulus’ Solver class. The solver can then be executed using the solve method. [ ]: # to make the logging work in the jupyter cells # Need to execute this only once! import logging logging.getLogger().addHandler(logging.StreamHandler())
[ ]: import os from modulus.sym.solver import Solver
# optional set appropriate GPU in case of multi-GPU machine
The checkpoint directory is saved based on the results recording frequency specified in the rec_results_freq parameter of its derivatives. The network directory folder contains several plots of different validation predictions. Several are shown below, and you can see that the model is able to accurately predict the pressure field for permeability fields it had not seen previously. These visualizations can also be viewed during the training using the Tensorboard. FNO validation predictions. (Left to right) Input permeability, true pressure, predicted pressure, error.
1.7 Part 2: Solution Using AFNO
Let’s see how to solve the problem using the AFNOs. The complete problem setup can be found in the darcy_AFNO.py script, but here for the sake of understanding, we will build the constraints and the case step by step. config_AFNO.yaml lists the configs required for the problem. Let’s start by loading them. The process of setting the AFNO training is very similar from a case setup standpoint hence we will only highlight the important differences wherever necessary. The AFNO is based on the ViT transformer architecture and requires tokenization of the inputs. Here each token is a patch of the image with a patch size defined in the configuration file through the parameter patch_size. The embed_dim parameter defines the size of the latent embedded features used inside the model for each patch.