フィルターのクリア

Feedforward Net convert from Python

3 ビュー (過去 30 日間)
Stephen Gray
Stephen Gray 2020 年 3 月 9 日
回答済み: Srivardhan Gadila 2020 年 3 月 16 日
Hi.
I have an example of a feedforward network written in Python using an ADAM optimizer which I want to replicate in Matlab. The basics are
network = models.Sequential()
network.add(layers.Dense(units=64, activation='relu', input_shape=(len(features.columns),)))
network.add(layers.Dense(units=32, activation='relu'))
network.add(layers.Dense(units=1, activation='sigmoid'))
network.compile(loss='binary_crossentropy', optimizer='adam', metrics=['accuracy'])
es = EarlyStopping(monitor='val_loss', mode='min', verbose=0, patience=500)
mc = ModelCheckpoint('data/best_model.h5', monitor='val_loss', mode='min', verbose=2, save_best_only=True)
history = network.fit(train_features, train_target,
epochs=1000, verbose=0, batch_size=128,
validation_data=(test_features, test_target), callbacks=[es, mc])
I believe I cannot use the Adam optimizer in the feedforward function so can I directly convert this or woud I have to create some layers myself rather than use the feedforward function?

採用された回答

Srivardhan Gadila
Srivardhan Gadila 2020 年 3 月 16 日
You can train the above network in keras framework and import it to matlab using the importKerasLayers, importKerasNetwork functions.
Alternatively you can define the above network in matlab using the Deep Learning Layers in MATLAB and mention the 'adam' optimizer as the sovlerName in the trainingOptions.

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeCall Python from MATLAB についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by