human
Write me a the Python program you requested given the following:
I am working on the file "Day-5/Day 5 - Vanilla GAN Solved.ipynb".
The first task is:
5.4 The basic network for the discriminator
Can you write Python program for it?
assistant
#Here is the Python program you requested.

class Discriminator:
    """The discriminator network
    
    the discriminator network takes as input a vector x of dimension input_dim, and transforms it 
    to a vector of size output_dim. The network has one hidden layer of size hidden_dim.
    
    You will define the following methods: 
    
    __init__: initializes all variables by using tf.get_variable(...) 
                and stores them to the class, as well a list in self.theta
    forward: defines the forward pass of the network - how do the variables
                interact with respect to the inputs
    """
    
    def __init__(self, input_dim, hidden_dim, output_dim):
        
        with tf.variable_scope("discriminator"):
            
            self.W1 = tf.get_variable(name="W1", 
                                      shape=[input_dim, hidden_dim], 
                                      initializer=tf.contrib.layers.xavier_initializer())
            self.b1 = tf.get_variable(name="b1", shape=[hidden_dim], 
                                      initializer=tf.zeros_initializer())
            
            self.W2 = tf.get_variable(name="W2", 
                                      shape=[hidden_dim, output_dim], 
                                      initializer=tf.contrib.layers.xavier_initializer())
            self.b2 = tf.get_variable(name="b2", 
                                      shape=[output_dim], 
                                      initializer=tf.zeros_initializer())

            self.theta = [self.W1, self.W2, self.b1, self.b2]
    
    def forward(self, x):
        """The forward pass of the network -- here we will define the logic of how we combine
        the variables through multiplication and activation functions in order to get the
        output.
        
        """
        h1 = tf.nn.relu(tf.matmul(x, self.W1) + self.b1)
        logit = tf.matmul(h1, self.W2) + self.b2
        prob = tf.nn.sigmoid(logit)

        return prob, logit