|
Download README.md from guanwencan/Sparse_reconstruction_FE_damage_fields: direct link, hf CLI and curl.
- Browser
- Download file 4.62 kB
-
https://huggingface.co/guanwencan/Sparse_reconstruction_FE_damage_fields/resolve/main/README.md
- Command line
-
hf download hf://guanwencan/Sparse_reconstruction_FE_damage_fields/README.md
-
curl -L -o README.md https://huggingface.co/guanwencan/Sparse_reconstruction_FE_damage_fields/resolve/main/README.md
4.62 kB
| # Sparse reconstruction of FE damage fields: key methods | |
| Code for a subset of the reconstruction methods compared in | |
| > W. Guan, *Why do sparse surrogate reconstructions underestimate peak damage in localised finite element fields?*, International Journal of Damage Mechanics (under review). | |
| It takes the finite element reference fields published with the paper, draws the sparse observation set, reconstructs the full field with one of the methods below and reports the evaluation metrics. | |
| ## Methods | |
| | `--method` | paper name | prior | | |
| | -------------------------------------------- | --------------------------------------------- | ------------------------------------------------------------ | | |
| | `interp` | linear interpolation | none | | |
| | `gp_rbf`, `gp_matern15`, `gp_matern25` | stationary GP (RBF, Matérn 1.5, Matérn 2.5) | one length scale over the domain | | |
| | `nsgp_homo` | non-stationary GP, homoscedastic | length scale grows with distance from the tunnel wall | | |
| | `nsgp_hetero` | non-stationary GP, heteroscedastic | as above, with a fixed noise floor that is small at the wall | | |
| | `mlp` | multilayer perceptron | spectral bias of the network | | |
| | `ffmlp` | Fourier-feature MLP | random Fourier features, scale chosen on a validation split | | |
| | `dip` | deep image prior | convolutional network structure | | |
| The remaining methods of the paper (random forest, compressed sensing, Gappy POD, Fourier neural operator, mechanics-mean GP and the Mohr–Coulomb physics-informed network) are not included. | |
| ## Data | |
| Download the field files from the Hugging Face dataset and place them under `data/fields/`: | |
| ``` | |
| data/fields/plain_medium.npz | |
| data/fields/viscoplastic_medium.npz | |
| ... | |
| ``` | |
| `plain_medium` and `viscoplastic_medium` are the two reference fields of the paper. The other seven cases can be used in the same way. | |
| ## Usage | |
| ``` | |
| pip install -r requirements.txt | |
| python run.py --case data/fields/plain_medium.npz --field dkappa --method gp_matern15 --seeds 0,1,2,3,4 | |
| ``` | |
| `--field` is one of `dkappa`, `dWp`, `D`. Each run covers the three key instants 11.20, 13.38 and 14.70 s. For `mlp`, `ffmlp` and `dip`, every sampling seed is run from three random initialisations (`--starts`). Predictions are written as `.npy` files and the metrics as one `.json` file in `--out`. | |
| ## Protocol | |
| - Observations: 3200 elements drawn without replacement with probability proportional to 0.15 + (R/r)³, where r is the distance to the tunnel centre and R = 3.45 m is the outer lining radius. The sampling seed alone fixes the set. | |
| - Coordinates are divided by the largest |x| of the element centroids. Field values are divided by the largest value over the three instants, and predictions are clipped at zero after scaling back. | |
| - Initialisation seeds: 100·seed + start for `mlp` and `ffmlp`. For `dip` they are 0, 1 and 2 for sampling seed 0, and 1000·seed + start otherwise. | |
| ## Metrics | |
| - `P`: peak recovery ratio, maximum of the prediction over maximum of the reference. | |
| - `R2`: coefficient of determination over all soil elements. | |
| - `GSR`: gradient sharpness ratio in the 2.2 m ring around the lining, over the cells with the top 30 % of reference gradient. | |
| - `RE`: signed relative error, weighted by the reference value, over elements above the 80th percentile within ±6 m of the tunnel. | |
| - `dtheta`: front orientation error in degrees, weighted by the reference gradient, over the cells with the top 20 % of reference gradient in the same ring. | |
| GSR and dtheta are computed on a 200 × 200 grid over ±6 m with Gaussian smoothing of 1.6 cells before differentiation. | |
| ## Reproducibility | |
| With sampling seed 0 on `plain_medium`, the observation set is identical to the one used in the paper. Linear interpolation and both non-stationary GPs reproduce the paper's predictions to within float32 rounding. Results of the stochastic methods depend on the PyTorch version and the device. The paper used Python 3.12, NumPy 2.5, SciPy 1.18, scikit-learn 1.9 and PyTorch 2.11 with CUDA 12.8. | |
| ## Licence | |
| MIT. |