GAN Mathematical Formulation
1. Generator Function
G(z) = xfake
Where:
z = Random noise vector
G = Generator network
xfake = Generated fake sample
The Generator transforms random noise into realistic synthetic data.
2. Discriminator Function
D(x) = P(Real)
Where:
x = Input sample
D(x) = Probability that the input is real
D(x) ≈ 1 → Real image
D(x) ≈ 0 → Fake image
3. GAN Objective Function
minG maxD V(D,G) =
Ex~Pdata[log D(x)] +
Ez~Pz[log(1 − D(G(z)))]
Where:
G = Generator
D = Discriminator
Pdata = Distribution of real data
Pz = Distribution of random noise
The Discriminator maximizes the objective by correctly classifying real and fake
samples.
The Generator minimizes it by producing fake samples that fool the Discriminator.
LSTM Mathematical Formulation
1. Forget Gate
ft = σ(Wf[ht−1, xt] + bf)
2. Input Gate
it = σ(Wi[ht−1, xt] + bi)
3. Candidate Memory
C̃t = tanh(Wc[ht−1, xt] + bc)
4. Cell State Update
Ct = ft ⊙ Ct−1 + it ⊙ C̃t
5. Output Gate
ot = σ(Wo[ht−1, xt] + bo)
6. Hidden State
ht = ot ⊙ tanh(Ct)
RNN Equations
Hidden State: ht = tanh(Wxhxt + Whhht−1 + bh)
Output: yt = Whyht + by