Skip to content

Instantly share code, notes, and snippets.

View NetEase-GameAI's full-sized avatar

NetEase-GameAI

  • NetEase GameAI
  • Hangzhou, China
View GitHub Profile
@NetEase-GameAI
NetEase-GameAI / spatchgan_discriminator_pytorch.py
Last active December 7, 2023 03:52
A pytorch implementation of the SPatchGAN discriminator
# A pytorch implementation of the SPatchGAN discriminator, tested with pytorch 1.7.1.
# This file is released under the BSD 3-Clause license, see https://github.com/NetEase-GameAI/SPatchGAN/blob/main/LICENSE
# Author: shaoxuning@corp.netease.com
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.nn.utils import spectral_norm
class SPatchDiscriminator(nn.Module):