import numpy as np


class Activation:
    def __init__(self):
        pass

    @staticmethod
    def sigmoid(z, derivative=False):
        sig = 1 / (1 + np.exp(-z))
        if derivative:
            return sig * (1 - sig)
        else:
            return sig

    @staticmethod
    # derivative not required as only used in output layer and cross entropy eliminates excess term
    def soft_max(z):
        e = np.exp(z)
        return e / np.sum(e, axis=1, keepdims=True)
