【问题标题】:How to plot machine learning model horizontally?如何水平绘制机器学习模型?
【发布时间】:2020-10-01 20:56:41
【问题描述】:

我想画一个机器学习模型。 在一些论文中,他们水平绘制模型,如图 11、12、13、14、15 在https://tches.iacr.org/index.php/TCHES/article/view/7388/6560 中。 这些似乎是从 keras 中绘制模型的。 我该怎么做?

【问题讨论】:

    标签: plot keras


    【解决方案1】:

    你可以使用这个例子:

    from keras.models import Sequential
    from keras.layers import Dense, Activation
    
    model = Sequential([
        Dense(32, input_shape=(784,)),
        Activation('relu'),
        Dense(10),
        Activation('softmax'),
    ])
    
    from keras.utils import plot_model
    plot_model(model,
               show_shapes=True,
               to_file='model.png'
    )
    

    结果是:

    【讨论】:

    • 我可以这样画,但我想知道如何使用多列进行绘制
    猜你喜欢
    • 1970-01-01
    • 2020-09-29
    • 2023-03-28
    • 1970-01-01
    • 1970-01-01
    • 2016-07-12
    • 1970-01-01
    • 1970-01-01
    • 2016-10-27
    相关资源
    最近更新 更多