The model is an instance of this class:

  
      github.com
  
  
    taoxugit/AttnGAN/blob/master/code/model.py#L397

    self.img = nn.Sequential(
        conv3x3(ngf, 3),
        nn.Tanh()
    )


def forward(self, h_code):
    out_img = self.img(h_code)
    return out_img




class G_NET(nn.Module):
def __init__(self):
    super(G_NET, self).__init__()
    ngf = cfg.GAN.GF_DIM
    nef = cfg.TEXT.EMBEDDING_DIM
    ncf = cfg.GAN.CONDITION_DIM
    self.ca_net = CA_NET()


    if cfg.TREE.BRANCH_NUM > 0:
        self.h_net1 = INIT_STAGE_G(ngf * 16, ncf)
        self.img_net1 = GET_IMAGE_G(ngf)