January 31, 2025
How to Develop a 1D Generative Adversarial Network From Scratch in Keras
https://machinelearningmastery.com/how-to-develop-a-generative-adversarial-network-for-a-1-dimensional-function-from-scratch-in-keras/
page 4
The function
generate_samples(n) returns an array of n pairs where the first value is random and
the second value is the squared value of the first.
The dimension of the array is n rows and two columns.
page 5
The discriminator predicts whether the sample is real or fake as a probability.
page 6/7
The function generate_real_samples(n) returns an array of n pairs where the first value is random and
the second value is the squared value of the first, as well as an array of labels that are all=1,
meaning that these values are real.
The function generate_fake_samples(n) returns an array of n pairs where the first value is random and
the second value is another random value, as well as an array of labels that are all=0,
meaning that these values are fake.
The function train_discriminator() trains the discriminator with real and fake samples.