Train Machine Learning Surrogate

With the generated training data it is possible to train a machine learning (ML) method of your choice, as log as it can be exported as an ONNX.

This step has to be performed by the user.

Example

For a naive feed-forward neural network exported to ONNX see AMIT-HSBI/NaiveONNX.jl.

import NaiveONNX
trainingData = "simpleLoop_data.csv"
profilingInfo = getProfilingInfo("simpleLoop.bson")[1]
onnxModel = "eq_$(profilingInfo.eqInfo.id).onnx" # Name of ONNX to generate

model = NaiveONNX.trainONNX(trainingData,
                            onnxModel,
                            profilingInfo.usingVars,
                            profilingInfo.iterationVariables;
                            nepochs=10,
                            losstol=1e-8)
Chain(
  Dense(2 => 20, σ),                    # 60 parameters
  Dense(20 => 10, tanh),                # 210 parameters
  Dense(10 => 1),                       # 11 parameters
)                   # Total: 6 arrays, 281 parameters, 1.473 KiB.