如何在Predetor Prey数据集上实现GAN模型?

问题描述

我正在尝试使用GAN架构生成Predator-Prey数据集
显然,两者具有相关性(某些数学函数)。

我需要使用GAN生成它们的数字,而无需找到方程式的参数。
* 我在GAN中相对较新

例如:

Pray     = [50.   50.  50. ...  88.  88.  89.]  # length 10000
Predator = [100.  99.  99. ... 462. 462. 462.]  # length 10000

enter image description here

您如何适应这种情况?
我什至只能使用密集/线性(+ Relu)图层来解决此问题?

我尝试了这一点:(同时从原始数据中采样了1000个值)

class Generator_distribution(nn.Module):
    def __init__(self):
        # initialize nn Module
        super().__init__()
        
        self.layers = nn.ModuleList() 
        
        # architecture
        self.layers.append(nn.Linear(1000,64))
        self.layers.append(nn.LeakyReLU())
        self.layers.append(nn.Linear(64,32))
        self.layers.append(nn.LeakyReLU())
        self.layers.append(nn.Linear(32,1))
        
    def forward(self,input_tensor):
        x = input_tensor
        for l in self.layers:
            x = l(x)
        return x
    
class discriminator_distribution(nn.Module):
    def __init__(self):
        super().__init__()
        
        self.layers = nn.ModuleList() 
        
        self.layers.append(nn.Linear(1000,16))
        self.layers.append(nn.LeakyReLU())
        self.layers.append(nn.Linear(16,8))
        self.layers.append(nn.LeakyReLU())
        self.layers.append(nn.Linear(8,1))
        self.layers.append(nn.Sigmoid())
    
    def forward(self,input_tensor):
        x = input_tensor
        for l in self.layers:
            print(x.shape)
            x = l(x)
        return x

# later used :  nn.bceloss() & Adam()

但是效果不佳:

enter image description here

解决方法

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

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

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