0

I am trying to do time series prediction using GANs. I am using MXNet/Gluon. Thus, I have a sequential data of size (N, 1), which I have transformed it into (N-stepsize, stepsize). Now I have a hard time understanding the input out shapes of the network. Here, the code for Generator and Discriminator networks.

netG = nn.Sequential()
with netG.name_scope():
    netG.add(nn.Dense(20))
    netG.add(nn.BatchNorm(momentum = 0.8))
    netG.add(nn.Dropout(0.5))
    netG.add(nn.Dense(15))
    netG.add(nn.BatchNorm(momentum = 0.8))
    netG.add(nn.Dropout(0.5))
    netG.add(nn.Dense(20))
    netG.add(nn.BatchNorm(momentum = 0.8))
    netG.add(nn.Dropout(0.5))
    netG.add(nn.Dense(step_size, activation = "tanh"))


#300, 50, 2
#input shape is inferred
netD = nn.Sequential()
with netD.name_scope():
    netD.add(nn.Dense(20))
    netG.add(nn.BatchNorm(momentum = 0.8))
    netD.add(nn.Dense(15, activation='tanh'))
    netG.add(nn.BatchNorm(momentum = 0.8))
    netD.add(nn.Dense(20, activation='tanh'))
    netD.add(nn.Dense(step_size))

Thanks in advance.

Dick
  • 1,035
  • 1
  • 8
  • 8

1 Answers1

0

You can check the tensor shapes with the following code: print(mx.viz.print_summary(netG(mx.sym.var('data')), shape={'data':(1,100,10)})) I am assuming here that N-stepsize is equal 100 and stepsize is equal 10.

You have 2 errors in the discriminator: you add the Batchnorm layers to netG instead of netD

NRauschmayr
  • 131
  • 1