romAI - Tips & Tricks for Beginners


Altair romAI uses neural networks and systems theory to create Reduced Order Models (ROMs) from existing simulation data or field tests. Even though it is an easy-to-use tool, when I first started using it, I often found myself unable to train ROMs properly. With some research and a little bit of trial and error, I’ve discovered some good practices that I always follow to avoid issues and to get good performance from the ROMs I train with romAI. In this guide, I share those fundamentals.
Note: These apply to non-linear, dynamic models trained in romAI only.
- Keep the neural network architecture as simple as possible:
You might think a bigger neural network will be able to better represent a system’s response but, in fact, romAI works in such a way that the opposite is often true. Always start testing a simple network and increase hidden layers and neurons just if needed. These are the recommended ranges:
- Hidden layers: Between 2 and 4
- Neurons per layer: Between 20 and 40
Bigger neural networks will likely have worse performance than these.
2. Define Inputs, Outputs and States smartly:
Choosing the signals used to replicate a system’s response is crucial and might make or break an AI ROMs performance. You must choose these wisely. Most importantly, keep things as simple as possible, avoid defining more than 3 internal states and only define the outputs strictly required for your application. Even if there are a lot of states available for you to train, sometimes using a single internal state and an output will provide better results than defining several states.
You might encounter a use case in which there appear to be many ways of defining I/O/S. In this case, you might need to train in different ways and evaluate. The correlation viewer utility can help a lot here. You can launch it from romAI Director’s pre-processing tab, from this icon:
This utility shows correlation between the signals in your dataset, i.e., it shows whether one signal affects another one. Knowing the output of interest, you can use this tool to understand which signals play a significant role in producing that output and define them as inputs and states accordingly. E.g., consider this example in which the output of interest is Ibat, the correlation viewer shows that Iref and Iin affect what the output will be, whereas Vin does not:
Pick signals appropriately and you’ll likely train a good-performing ROM.
3. Divide and conquer. Use multiple ROMs:
Sometimes several system outputs will be of interest. romAI allows defining more than one output and this may work correctly in many cases. However, I’ve found that performance is reduced for each output when the trained ROM must provide coherent outputs for several signals.
Luckily, training a model in romAI Director is very easy and you can train several ROMs with the same dataset, one for each output of interest. In this way, each model can be trained to produce accurate results for a single output.
4. Remove unimportant frequencies for training:
ROMs are intended as surrogate models that capture a system’s important dynamics at a lower resolution. Therefore, the system’s response to replicate should be simplified as much as possible. E.g., a system’s response might contain a high-frequency ripple which is not important for system-level analysis. In this case, high-frequency content should be filtered out from all signals to simplify training.
This can be done very easily from romAI Director’s pre-processor tab.
5. Narrow down each ROM’s application:
Let’s say you have simulation data for a system’s response to a step, a ramp and an impulse. Instead of trying to train a ROM for capturing the response to each of these inputs, narrow down the training for the system to capture the response for a single kind of input, depending on your use case.
Training will be easier, and you’ll get better performance if you approach a single case (kind of input) at once. I.e., what are you trying to predict with a ROM? Keep it simple and just train it for that.
6. Training data doesn’t have to start at t = 0:
It might be the case that a system is at rest at t = 0, gets perturbed by an input signal until it reaches steady state at some operational point, and then that perturbance changes, along with the system’s output until it reaches steady state in another operational point.
romAI can have a hard time trying to predict responses at once from rest to steady state and from one given operational point to another. In this case, training data can be trimmed to ignore initial transients. I.e., the ROM just trains on input changes once the system is already at a given operational point, like in this example:
For doing this, simply populate the training dataset only with the regions of interest.
7. Create train/test & validation dataset:
Apart from the train/test dataset used for training, having an additional, smaller dataset of previously unseen simulations to check the performance of a ROM after training is highly beneficial. This dataset can even span longer simulation times, contain new combinations of inputs, etc. It will give you a better picture of how the ROM generalizes, which is more important than any performance metric.
You can use validation datasets for testing in romAI Director’s Post-Processor tab which by default will use the dataset used for training:
8. Use HyperStudy to build your dataset from a DOE
Even though you can manually define the operational points at which to run simulations to build a dataset, I highly encourage using a tool like Altair HyperStudy for building a dataset from a Design of Experiment (DOE). Some of the advantages are:
- Automation: Whether running 10 or 100 simulations, you don’t need to manually run each.
- Flexibility: You can define number of runs, parameter distributions, etc.
- Repeatibility: You can share a DOE and anyone will be able to understand it, unlike scripting the automation workflow or running manually.
- Optimal choice of operational conditions.
Conclusion
One common takeaway you will find in all these tips is that we should simplify the task for romAI as much as possible. Altair romAI is an amazing tool, but it’s not magic! Narrowing down the system and response we want to replicate will simplify things for us and possibly save us a lot of time.
With this in mind, you can extend the tips I’ve put here and get the most out of romAI.