3. Using Surface Variable Prediction on New Geometries¶
This tutorial demonstrates how to use a trained model from the surface variable training pipeline to predict surface variable values for new geometries in the AhmedML Dataset.
If you haven’t yet completed the training tutorial, do so first to output a model ready for predictions.
3.1. Creating the Manifest¶
The run-create-manifest-prediction
script generates the required manifest for the AhmedML dataset. To create the manifest, run the script pointing to your dataset location:
./run-create-manifest-prediction /path/to/ahmed/dataset
This will generate a manifest
prediction.manifest
: Lists of geometry files for predicting the surface variable values
You can customize the manifest to use different geometries by editing run-create-manifest-prediction
script:
#!/bin/bash
# ...
# Get a list of run folders for prediction
predict_run_folders=($(ls -d "$dataset_prefix/run_"*))
# Uncomment to get a list of 5 random runs (if you want to reduce the dataset size for testing)
# predict_run_folders=($(ls -d "$dataset_prefix/run_"* | shuf -n 5))
# Create predict.manifest with geometries only (no ground truth surface variable data)
mlsimkit-manifest create -m "prediction.manifest" -f "name=geometry_files,file_glob=*.stl" "${predict_run_folders[@]}"
A manifest is a JSON Lines (.manifest
) file that lists the paths to the geometry files. Each line in the manifest represents a single data file entry, containing the following keys:
"geometry_files"
: A list of relative or absolute paths to the geometry files (e.g.,.stl
)
Here’s an example manifest entry:
{
"geometry_files": ["file:///data/ahmed/run_90/ahmed_90.stl"]
}
This entry lists the path to a single geometry file (ahmed_90.stl
).
3.2. Understanding the configuration File¶
The surface variable prediction pipeline is configured using prediction.yaml.
This file configures the prediction step, using the trained models from the training pipeline. Key settings include:
output-dir
: Directory for storing prediction outputs (e.g., predicted values)surface.manifest_uri
: Path to the manifest of unseen geometriessurface.preprocess
: Hyperparameters related to data preprocessing of unseen geometriessurface.predict
: Hyperparameters related to surface variable model inference
To get an introduction to the available configuration options, use the mlsimkit-learn surface --help
command and the --help
option for each sub-command. This will provide an overview of the options and their purposes, which can be helpful when configuring the prediction pipeline.
3.3. Running the Pipeline¶
With the manifest created and the configuration file in place, you can run the surface variable prediction pipeline using the provided script.
Run prediction:
./run-prediction
This script executes the necessary commands using the prediction.yaml
configuration file.
3.4. Reviewing Results¶
3.4.1. During Prediction¶
The prediction step generates surface variable values predicted by the trained model for unseen geometries. The prediction output is located in the outputs/prediction/predictions
directory. Since the prediction manifest contains only geometry files (no ground truth surface variable data), the prediction outputs do not include error metrics or actual surface variable values for comparison. Here is the prediction output.
results/predicted_*.vtp
: Predictions of surface variable values for the unseen geometries
3.5. Next Steps¶
Dive into the surface variable prediction user guide for detailed information on more configuration options and how they impact model training and performance.