Export tensorflow.keras.Sequential model as FMU file

142 views Asked by At

I've trained a neural network and am looking to save it as an FMU (Functional Mock-up Interface)file

import tensorflow as tf
from tensorflow.keras import layers, models, optimizers,initializers


model = models.Sequential([
    layers.Input(shape=(X_train.shape[1],)),   
    layers.Dense(4, activation='elu',kernel_initializer='he_normal'),
   
    layers.Dense(2, activation='elu'), 
  
    layers.Dense(1, activation='relu') 
])


model.compile(optimizer='Nadam',
              loss=tf.keras.losses.MeanSquaredError(),   
              metrics=['mae'])

model.summary()

model.fit(X_train, y_train, epochs=50, batch_size=10,validation_split=0.2,shuffle=True)

I can export this model as a Keras model, but I need it in FMU(Functional Mock-up Interface) format.

1

There are 1 answers

0
Christian Bertsch On

I do not think that there is a complete toolchain available.

I see two possibilities: