Borrar filtros
Borrar filtros

Porting Network from Keras to Matlab

6 visualizaciones (últimos 30 días)
Hamza Yerlikaya
Hamza Yerlikaya el 18 de Nov. de 2019
Respondida: Sivylla Paraskevopoulou el 27 de Abr. de 2022
I am trying to port a simple network from python+keras to matlab. Model in question is the following,
def build_network(input_features=None):
# first we specify an input layer, with a shape == features
inputs = Input(shape=(input_features,), name="input")
x = Dense(32, activation='relu', name="hidden1")(inputs)
x = Dense(32, activation='relu', name="hidden2")(x)
x = Dense(32, activation='relu', name="hidden3")(x)
x = Dense(32, activation='relu', name="hidden4")(x)
x = Dense(16, activation='relu', name="hidden5")(x)
# for regression we will use a single neuron with linear (no) activation
prediction = Dense(1, activation='linear', name="final")(x)
model = Model(inputs=inputs, outputs=prediction)
model.compile(optimizer='adam', loss='mean_absolute_error')
return model
Looking throught the list of builtin layers [1]. What I've figured out is keras dense layer is matlab fullyConnectedLayer but i can not find a input layer that is not an lstm layer or an image layer. What would be the matlab equavelent of keras's Input layer?
[1] https://www.mathworks.com/help/deeplearning/ug/list-of-deep-learning-layers.html

Respuestas (1)

Sivylla Paraskevopoulou
Sivylla Paraskevopoulou el 27 de Abr. de 2022
The MATLAB Deep Learning Toolbox introduced featureInputLayer in R2020b. For more information on how the importTensorFlowNetwork function tranlates TensorFlow-Keras layers to MATLAB layers, see TensorFlow-Keras Layers Supported for Conversion into Built-In MATLAB Layers.

Categorías

Más información sobre Image Data Workflows en Help Center y File Exchange.

Productos


Versión

R2019b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by