预测矩阵的下一个配置

时间:2019-06-15 09:11:08

标签: tensorflow machine-learning keras deep-learning conv-neural-network

我正在构建一个意见建模系统,其中的人口居住在二进制矩阵配置中。喜欢: [0,1] [1,1] 该模型的下一个实例仅取决于当前状态(以及其他1个参数Field-strength,因此该模型为Markovian。因此,我认为我不需要LSTM或RNN。

我有100张图像的序列。偶数(例如20)时间实例作为输入,而奇数(例如21)时间实例作为输出。 这是我在Keras中制作的CNN。但这并没有收敛。准确度保持在0.3-0.5。

# Creating a Model and adding the layers
x = Input(shape=(50,50,1))

# Encoder
conv1_1 = Conv2D(32, (3, 3), activation='relu', padding='same')(x)
pool1 = MaxPooling2D((2, 2), padding='same')(conv1_1)
conv1_2 = Conv2D(16, (3, 3), activation='relu', padding='same')(pool1)
h = MaxPooling2D((2, 2), padding='same')(conv1_2)

#flattening the image to add Temprature and Random Seed
flat = Flatten()(h)
f1 = Dense(3705, activation="relu")(flat)

# Input stream for adding Temperature/Feild into the CNN

inputs_temp = Input(shape=(1,))
den = Dense(1, activation='relu')(inputs_temp)

#Merging the new input with CNN

concat = concatenate([f1,den])
f2 = Dense(3705, activation="relu")(concat)
f3 = Dense(2704, activation="relu")(f2)
r_shape = Reshape((13, 13, 16))(f3)


# Decoder
conv2_1 = Conv2D(16, (3, 3), activation='relu', padding='same')(r_shape)
up1 = UpSampling2D((2, 2))(conv2_1)
conv2_2 = Conv2D(16, (3, 3), activation='relu', padding='same')(up1)
up2 = UpSampling2D((2, 2))(conv2_2)
decoded = Conv2D(1, (3, 3), activation='', padding='same')(up2)
r = Cropping2D((1,1))(decoded)

这些配置是50x50尺寸的二进制矩阵。

我该如何调整此类数据的超参数,需要哪种网络拓扑/激活功能/架构?

谢谢。

0 个答案:

没有答案