Code implementation – discriminator
The discriminator in SimGAN is a fairly simple Convolutional Neural Network (CNN) with a small twist at the end—it outputs the likelihood of simulated and real. In this section, we'll also make use of a function from the loss class we built earlier.
Getting ready
We've built a set of loss functions and the generator class, so now it's time to build the discriminator class. You should see the following structure in your directory:
├── data ├── docker │ ├── build.sh │ ├── clean.sh │ ├── Dockerfile │ └── kaggle.json ├── imgs │ ├── create_token.png │ ├── kaggle_signup.png │ ├── MyAccount.png │ ├── refiner_network_training.png │ └── simGAN_network.png ├── out │ └── Generator_Model.png ├── README.md ├── run.sh └── src ├── discriminator.py ├── generator.py ├── loss.py
How to do it...
The discriminator is very similar to other discriminators we've built in previous chapters. In this case, we're essentially building a CNNÂ with a slightly different...