INNER CODE UNIT · Python

relu

amanchadha/coursera-deep-learning-specialization · C2 - Improving Deep Neural Networks Hyperparameter tuning, Regularization and Optimization/Week 2/opt_utils.py:21

def relu(x):
    """
    Compute the relu of x

    Arguments:
    x -- A scalar or numpy array of any size.

    Return:
    s -- relu(x)
    """
    s = np.maximum(0,x)
    
    return s

def load_params_and_grads(seed=1):
    np.random.seed(seed)
    W1 = np.random.randn(2,3)
    b1 = np.random.randn(2,1)

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…