How to properly train a GAN model?

I tried to train a ViT-GAN model (from this repo) on my database, where i have images as input and output. The input image is a PNG map of a path planning problem. Red channel is obstacle map, green and blue is one pixel with start/goal. The output image would be the planned path on the red channel and this is what i am trying to teach the model. The model from the repo works nicely on the included examples and that is a much more complex problem than mine, so i naturally thought this network would solve my problem without much further tuning.

My issue is that even without touching the network, just replacing the training data to mine it completely messes up the output. I tried tweaking the network in so many ways, but the result always remains the same -> either the same structured garbage output for any given input (white patch on black), or some noisy rgb patches on black background. I just cant get it to learn the expected output.

On the left is the given input and on the right is the expected output. Middle is the output of the network. I read about training GAN’s on i get they are volatile and hard to find the right structure/parameter set, but i just cant figure out what to do next with it. What i already tried:

  • Making the network smaller by removing some transformer/convulutional layers
  • Lowering the number of filters hence my problem is not that complex
  • Adjusting the learning rates of the generator/discriminator -> together and separately
  • Changing the activation function of the output layer of the discriminator to sigmoid as suggested in another similar post
  • Removed all ReLU activation functions and replaced them with LeakyReLU to address possible vanishing gradient problems
  • Adding Wasserstein loss to the discriminator loss function to avoid model collapse
  • Changing mean diff of pixels in the generator loss function to sum diff (to punish full black output more)
  • Use bias to avoid vanishing gradient
  • Changing the random initializer of filter from (0.0, 0.02) -> (0.0, 1.0) to make the initial filter more varied
  • Changing the lambda, batch size, ff_dim, number of heads, patch size, embed dim, projection dim params
  • Train for 200 epochs and for 20 also. All for the same output structure.
  • Train on smaller portion of dataset (400 images), and on larger (1000 and 3000 images)

I am aware that this problem could be solved with other (maybe simplier) netwroks also, but i would like to make this GAN work and understand why it wouldn’t work in the first place. I added my current state of changes to this repo. I have no idea where to look next. If someone has some suggestions please feel free to share. If you suggest to adjust some params please write a concrete value. If i forgot anything from the description let me know.

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật