【问题标题】:Convolutional Neural Network with Extra Parameters具有额外参数的卷积神经网络
【发布时间】:2018-01-13 12:49:21
【问题描述】:

我正在尝试训练 CNN 来预测给定温度下 2D Ising 模型的地面(平衡)状态。本质上,一个方阵是随机初始化的,有两个可能的值。在一组规则下,系统会随着时间的推移而达到平衡。

问题在于基态取决于温度,CNN 需要知道温度。是否可以创建一个以温度和矩阵为输入并输出平衡的 CNN?

如果这很重要,我打算使用 Keras。

【问题讨论】:

    标签: neural-network keras conv-neural-network


    【解决方案1】:

    首先对单独的输入(例如卷积)进行操作,然后在输入最终密集层之前将它们连接起来。

    input_1 = Input(shape=(100, 100, 1), name="matrix")
    input_2 = Input(shape=[1], name="temperature")
    
    matrix = Conv2D(24, kernel_size = 3, strides = 2, padding='same', activation='relu')(input_1)
    
    concat = Concatenate()([matrix, input_2])
    
    dense_layer = Dense(512, activation='relu')(concat)
    output = Dense(num_classes, activation='softmax')(dense_layer)
    
    model = Model([input_1,input_2], output)
    

    【讨论】:

    • 谢谢,很快就会试试这个。
    猜你喜欢
    • 2020-08-21
    • 2017-01-01
    • 1970-01-01
    • 2017-08-22
    • 1970-01-01
    • 2020-03-27
    • 2020-12-02
    • 2020-11-01
    相关资源
    最近更新 更多