How fc-tud/material-optimization works
Project Type and Purpose
• The project is a research-oriented, full-stack machine learning system that trains various models (using approaches like AutoML, PyTorch, etc.) and then employs optimization routines to improve material design metrics.
• The README clarifies that the repository supports model training (with a generic train.py script) and a couple of use-case–specific optimization workflows (opti_sim_pan.py and opti_sim_trc.py) based on configurations found in config.py.
• The project integrates components such as experiment scripts, model binaries, result saving, and plotting utilities—all meant to replicate experiments described in the paper.
File Structure Highlights and Architectural Patterns
• Data: The project has a well-defined data layer in the data directory:
• Data is separated into “run” (for training) and “storage” (holding multiple datasets for different simulation cases like SIM-PAN-50, SIM-PAN-100, etc.).
• Environment Configurations: The envs folder has several YAML files for conda environments used with different frameworks (autosklearn, PyTorch, etc.).
• auto_ml (containing wrappers for autosklearn, XGBoost, etc.)
• pytorch models including custom architectures (e.g., ffnn_mtl)
• domain specific implementations such as sim_pan and sim_trc. The latter also includes an exeDir indicating potential external simulation executables.
• Helpers exist to provide common functionality like data handling or quantile regression.
• Optimization: The src/optimization directory contains key files that define constant parameters, various optimizers (ng_optimizer, sci_kit_optimizer), and use-case specific scripts for sim_pan and sim_trc optimization.
• Scripts: The scripts folder includes standalone scripts (both Python scripts and notebooks) to run the workflows: training, model evaluation, database creation, plotting, and optimization.
• Model Artifacts and Results: The ml_models_bin and results directories house output model files and experimental results respectively.
A. Data Layer:
• Data ingestion and storage system. Include nodes for:
• Raw datasets (from data/storage).
• Runtime data for training (data/run).
• How the data is accessed by the training scripts and pre-processing helpers within the models folder.
B. Model Training & Experimentation:
• Entry point (train.py) which reads configurations (config.py) and calls routines defined in src/models.
• Subdivide the training module into components:
▪ AutoML (using modules in src/models/auto_ml),
▪ PyTorch (in src/models/pytorch),
▪ Domain-specific models (SimPAN and SimTRC in src/models/sim_pan and src/models/sim_trc).
• That after training, models are serialized/pickled and stored in ml_models_bin.
C. Optimization Pipeline:
• Differentiate between the two use cases:
▪ SimPAN optimization (via opti_sim_pan.py and src/optimization/use_case_sim_pan.py),
▪ SimTRC optimization (via opti_sim_trc.py and src/optimization/use_case_sim_trc.py).
• That these scripts use the previously trained models (i.e., loading model.pkl from ml_models_bin) and run optimization algorithms (ng_optimizer, sci_kit_optimizer, etc.).
• External executables (e.g., in src/models/sim_trc/exeDir) might be depicted as “External Simulation Tools” that are executed as part of the workflow.
D. Result Storage & Visualization:
• A “Results Module”:
• Where results and logs are stored (results folder and workdir directories as mentioned in the README).
• Elements for the plotting and evaluation scripts/notebooks (e.g., evaluate_opti_pan.ipynb, plot_sim_trc_f_over_dis.ipynb).
• That visualization depends on outputs from both training and optimization.
E. Supporting Infrastructure:
• Environment Setup: Represent the environment configurations (envs folder with multiple YAMLs) to underline dependency management.
• Configurations: A separate node for config.py that serves as the central configuration for training and optimization.
• Scripts & Database Creation: Include a component to cover additional utility scripts (scripts/create_pan_database.py, scripts/create_trc_database.py) that help set up or manage experiments.