使用Keras GAN架构生成一系列值

问题描述

我正在尝试生成类似的内容
这是我的真实数据函数(我正在尝试模仿)中的随机样本。

numbers = [ 54.,87.,103.,209.,356.,371.,383.,448.,452.,38.,37.,30.,22.,24.,48.,52.,61.,66.,150.,163.,406.,545.,557.,566.,508.,413.,26.,12.,19.,28.,90.,93.,126.,155.,362.,476.,470.,455.,410.,345.,252.,233.,62.,45.,42.,40.,27.,16.,18.,21.,63.,67.,96.,177.,228.,331.,382.,183.,31.,14.,13.,23.,68.,104.,179.,273.,428.,446.,388.,77.,4.,0.,0.]

enter image description here

生成器和鉴别器的外观如何?

这是我尝试创建G&D的尝试:

def create_G(num=100):
  G_in = Input(shape=num)
  x = Dense(num/2,activation=LeakyReLU())(G_in)
  x = Dropout(0.5)(x)
  x = Dense(num/4,activation=LeakyReLU())(x)
  x = Dropout(0.5)(x)
  x = Dense(num)(x)
  G = Model(G_in,x)
  G.compile(loss='binary_crossentropy',optimizer=Adam(learning_rate=0.001))
  return G

def create_D(num=100):
  D_in = Input(shape=num)
  x = Reshape((-1,1))(D_in)
  x = Conv1D(num,3,activation='relu')(x)
  x = Dropout(0.5)(x)
  x = Flatten()(x)
  x = Dense(2,activation='sigmoid')(x)
  D = Model(D_in,x)
  D.compile(loss='binary_crossentropy',optimizer=Adam(lr=0.003))
  return D

我正在用正确的例子训练真实的例子。 但是我的G不能愚弄D。
这是蓝色的G.predict(noise)值与橙色的实际值进行比较的示例。

enter image description here

我想念什么?

感谢对不同体系结构的任何建议。

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)